Skip to content

Replace the sleeping tenant's data directory with a snapshot's state.

POST
/v0/projects/{id}/restore
curl --request POST \
--url https://infra-hyphae.run/v0/projects/example/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "snapshot_id": "example" }'

Runs hyphae restore --backup <snapshot dir> --data-dir <fresh dir> (Native verifies the backup, stages, runs doctor, activates), then swaps the fresh directory into place. The previous directory is moved aside under replaced/ and retained; the Cloud deletes nothing. This is a replacement, not a branch: there is one data directory per project. The tenant is left asleep. 409 tenant_running if awake; 404 for an unknown snapshot id.

id
required
string
/^prj_[0-9a-f]{16}$/
Media typeapplication/json
object
snapshot_id
required
string
/^snap_[0-9a-f]{16}$/
Examplegenerated
{
"snapshot_id": "example"
}

Restored; tenant is sleeping.

Media typeapplication/json
object
project
required
string
/^prj_[0-9a-f]{16}$/
snapshot_id
required
string
/^snap_[0-9a-f]{16}$/
state
required
string
Allowed values: stopped running sleeping
restored_at
required

RFC 3339, UTC.

string format: date-time
replaced_dir

Where the previous data directory was moved. Retained, never deleted by the Cloud.

string | null
native
required

Output of hyphae restore. Field names are Native’s.

object
backup
required

Output of hyphae backup create / backup verify. Field names are Native’s.

object
backup_path
required
string
checkpoint_digest
required
string
file_count
required
integer
total_bytes
required
integer
status
required
string
Allowed values: created verified
visible_csn
required
integer
data_path
required
string
doctor
required
object
snapshot_verified
required
boolean
status
required
string
verified_open
required
boolean
status
required
string
Allowed value: restored
Example
{
"state": "stopped",
"native": {
"backup": {
"status": "created"
},
"status": "restored"
}
}

Malformed or out-of-bounds input (invalid_request).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request authentication_required authorization_denied not_found conflict payload_too_large not_implemented tenant_not_running tenant_running function_runtime_missing function_timeout function_bad_output function_busy orchestrator_unavailable upstream_unavailable internal
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}

Missing, malformed, duplicate, or unknown credential (authentication_required).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request authentication_required authorization_denied not_found conflict payload_too_large not_implemented tenant_not_running tenant_running function_runtime_missing function_timeout function_bad_output function_busy orchestrator_unavailable upstream_unavailable internal
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}
WWW-Authenticate
string
Allowed value: Bearer realm="hyphae-cloud"

Unknown route, or a project the caller does not own (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request authentication_required authorization_denied not_found conflict payload_too_large not_implemented tenant_not_running tenant_running function_runtime_missing function_timeout function_bad_output function_busy orchestrator_unavailable upstream_unavailable internal
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}

The operation needs Native’s directory lock and the engine is running; sleep the tenant first (tenant_running).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request authentication_required authorization_denied not_found conflict payload_too_large not_implemented tenant_not_running tenant_running function_runtime_missing function_timeout function_bad_output function_busy orchestrator_unavailable upstream_unavailable internal
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}

The engine failed to start or did not answer (upstream_unavailable).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request authentication_required authorization_denied not_found conflict payload_too_large not_implemented tenant_not_running tenant_running function_runtime_missing function_timeout function_bad_output function_busy orchestrator_unavailable upstream_unavailable internal
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}

The host cannot run tenants right now — engine binary missing, wrong pin, or ports exhausted (orchestrator_unavailable).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request authentication_required authorization_denied not_found conflict payload_too_large not_implemented tenant_not_running tenant_running function_runtime_missing function_timeout function_bad_output function_busy orchestrator_unavailable upstream_unavailable internal
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}