Skip to content
EleforkDocs
Internal preview. Elefork is not publicly available yet; APIs and hostnames may change.

Create branches

POST
/v1/projects/{id}/branches
curl --request POST \
--url https://api.elefork.com/v1/projects/example/branches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "durability": "L0", "size": "nano", "template": "example", "checkpoint": "example", "parent": "example", "count": 1, "ttl_seconds": 1, "pause_policy": "idle" }'

Create count branches from exactly one source: a template, a checkpoint, or a parent branch (fork). With parent alone the parent is checkpointed now; with parent + checkpoint the fork starts from that checkpoint of the parent.

id
required
string
Idempotency-Key
string
<= 200 characters
Media typeapplication/json
object
name

With count > 1, a prefix: name-1, name-2, …

string
durability

L0: reset to the last checkpoint after a crash. L1: async WAL replication. L2: no confirmed commit lost if any single host is lost (L1/L2 return 501 until available).

string
Allowed values: L0 L1 L2
size
string
Allowed values: nano small medium large
template

Template id or name

string
checkpoint
string
parent

Parent branch id (fork)

string
count
integer
default: 1 >= 1
ttl_seconds

Lifetime (at most 10 years); 0 = never expire; default 24 h for L0.

integer
<= 315360000
pause_policy

Default idle. A fork does not inherit its parent’s policy.

string
Allowed values: idle never

Branches are being created

Media typeapplication/json
object
branches
required
Array<object>
object
branch
required
object
id
required
string
project_id
required
string
org_id
required
string
parent_id
required
One of:
string
name
required
string
durability
required

L0: reset to the last checkpoint after a crash. L1: async WAL replication. L2: no confirmed commit lost if any single host is lost (L1/L2 return 501 until available).

string
Allowed values: L0 L1 L2
pause_policy
required

idle: paused automatically after the idle timeout without connections (woken on the next connection). never: never paused automatically; POST /v1/branches/{id}/pause still works.

string
Allowed values: idle never
size
required
string
Allowed values: nano small medium large
state
required
string
Allowed values: creating running paused failed deleting deleted
state_reason
string
source_kind
required
string
Allowed values: template checkpoint
source_ref
required
string
durability_ready
required
boolean
degraded
required
boolean
recovery_blocked
required
boolean
expires_at
required
One of:
string format: date-time
last_active_at
required
string format: date-time
created_at
required
string format: date-time
sealed_at

Set when the branch’s episode was sealed; a sealed branch gets no new credentials.

One of:
string format: date-time
operation
required
object
id
required
string
org_id
required
string
branch_id
required
One of:
string
kind
required
string
Allowed values: create checkpoint reset pause wake delete recover
state
required
string
Allowed values: pending running succeeded failed
error
string
params
required
object
result
required
object
created_at
required
string format: date-time
finished_at
required
One of:
string format: date-time
request_id

The API request that started the operation (X-Request-Id).

string
fork_checkpoint_operation
object
id
required
string
org_id
required
string
branch_id
required
One of:
string
kind
required
string
Allowed values: create checkpoint reset pause wake delete recover
state
required
string
Allowed values: pending running succeeded failed
error
string
params
required
object
result
required
object
created_at
required
string format: date-time
finished_at
required
One of:
string format: date-time
request_id

The API request that started the operation (X-Request-Id).

string

Example

{
"branches": [
{
"branch": {
"durability": "L0",
"pause_policy": "idle",
"size": "nano",
"state": "creating",
"source_kind": "template"
},
"operation": {
"kind": "create",
"state": "pending"
}
}
],
"fork_checkpoint_operation": {
"kind": "create",
"state": "pending"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}

Temporarily unavailable; retry after the Retry-After seconds. Codes: database_unavailable (the metadata database is failing over) and cube_admission (a compute node runs a sandbox shim below the platform minimum, so creates, forks, checkpoints and resets are refused until it is upgraded).

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string

Example

{
"error": {
"code": "not_found"
}
}
Retry-After
integer