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

Start episodes

POST
/v1/tasks/{id}/episodes
curl --request POST \
--url https://api.elefork.com/v1/tasks/example/episodes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "count": 1, "size": "nano", "ttl_seconds": 1 }'

Creates count branches from the task’s template, one episode each. Wait for each branch’s operation, then issue credentials for it.

id
required
string
Idempotency-Key
string
<= 200 characters
Media typeapplication/json
object
count
integer
default: 1 >= 1 <= 100
size
string
Allowed values: nano small medium large
ttl_seconds

Branch TTL (at most 10 years); omitted = default (L0: 24 h)

integer
<= 315360000

Branches are being created

Media typeapplication/json
object
episodes
required
Array<object>
object
episode
required
object
id
required
string
org_id
required
string
task_id
required
string
branch_id
required
string
state
required
string
Allowed values: running sealing scoring scored tampered failed
seal_checkpoint_id
required

Checkpoint of the sealed state. Kept for the retention period (longer for failed, tampered or review episodes); fork it to reproduce.

One of:
string
integrity

Tampered: the environment was changed in a way that can fake a result (no score). review: scored, but something needs a human look (e.g. episode WAL unavailable).

string
Allowed values: clean review tampered
score
required

Weighted share of rules passed (0-1)

One of:
number
passed
required

All rules passed

One of:
boolean
result
required

Scorer report (empty until scored).

object
integrity
string
tamper_evident

False for superuser tasks; some cheats cannot be detected generically

boolean
findings
Array<object>
object
kind
required
string
object
string
change
required

Added, removed, changed, transient (modified and restored; seen only in WAL), …

string
severity
required
string
Allowed values: high review info
detail
string
wal_scan
object
status
string
Allowed values: ok incomplete unavailable
detail
string
from
string
to
string
catalog_writes
object
key
additional properties
integer
rules
One of:
null
score
One of:
number
passed
One of:
boolean
data_changes

Episode record of table changes relative to the start state.

Array<object>
object
table
required
string
change
required
string
Allowed values: added removed modified columns
rows_before
required
integer
rows_after
required
integer
detail
string
scoring_ms
integer
error
string
created_at
required
string format: date-time
sealed_at
required
One of:
string format: date-time
scored_at
required
One of:
string format: date-time
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

Example

{
"episodes": [
{
"episode": {
"state": "running",
"integrity": "clean",
"result": {
"findings": [
{
"severity": "high"
}
],
"wal_scan": {
"status": "ok"
},
"data_changes": [
{
"change": "added"
}
]
}
},
"branch": {
"durability": "L0",
"pause_policy": "idle",
"size": "nano",
"state": "creating",
"source_kind": "template"
},
"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"
}
}

Task not ready (task_not_ready), or request_in_progress (Idempotency-Key)

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

Example

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

idempotency_mismatch: this Idempotency-Key was used with a different request

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