HTTP API

Tasks, queues and storage

29 routes your API key can call. Each says who may call it; every example assumes KEY is your API key. What only the dashboard does (signing in, making API keys, connecting accounts) isn't listed here: it's in the full OpenAPI spec.

GET/v1/workspaces/{wid}/tasks/{tid}

A task, with its sandboxes, checkpoints and one page of its journal

People and API keys

A task is the work a journal follows across sandboxes: every sandbox gets one when it starts, and a resumed sandbox joins its checkpoint's. sandboxes and checkpoints are the newest 100 of each; journal is newest first, paged by page and perPage, and meta describes the journal.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • taskobjectrequired
    • idstring
    • sandboxesSandbox[]
    • checkpointsCheckpoint[]
    • journalJournalEntry[]
    • secret_groupsSecretRef[]

      What the task's new sandboxes get (a resume, or fan-out), in order

  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid' \
  -H 'Authorization: Bearer anx_live_…'
PUT/v1/workspaces/{wid}/tasks/{tid}/secret_groups

Change the secret groups a task's future sandboxes get

People and API keys

A resume, or a sandbox started with task, gets these groups' current values. Running sandboxes keep what they started with. An API key may add only groups it was granted (keeping or dropping any). A task token: 403.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id

Body

  • secret_groupsstring[]required

Answer · 200

  • secret_groupsSecretRef[]required
    • idstring
    • namestring
    • versioninteger

      Goes up with every change to the group's values

Terminal
curl -X PUT 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/secret_groups' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"secret_groups":["…"]}'
POST/v1/workspaces/{wid}/tasks/{tid}/queues/{name}/messages

Push a message onto one of the task's queues

People, API keys and the sandbox's own task token

Queues are coordination, not storage: they live in Redis only and expire with everything else of the task 7 days after its last activity. Write results to the key-value store, which is kept in Postgres and survives Redis being wiped, for as long as that; keep them longer in your own files. A queue is made by its first push; a task has 100 at most, each 100,000 messages at most (409 past it). Idempotency-Key: the same key and body within 24 hours returns the first message (200, Idempotent-Replayed: true); the same key with another body is 409.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
nameInpathTypestringAboutQueue name
Idempotency-Key?InheaderTypestringAbout

Body

  • bodyobjectrequired

    Any JSON value, 256 KiB at most once compacted

Answer · 200

Replayed for a repeated Idempotency-Key

Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/queues/name/messages' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"body":{}}'
POST/v1/workspaces/{wid}/tasks/{tid}/queues/{name}/claim

Claim up to max messages, hidden from other claims for visibility_seconds

People, API keys and the sandbox's own task token

Messages whose claim ran out (or were released) come first, then new ones, oldest first. A claimed message not acked before claimed_until comes back for another claim; one claimed 5 times and never acked goes to the queue's dead list instead. An empty list means nothing is waiting now. The body may be left out.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
nameInpathTypestringAboutQueue name

Body

  • maxinteger
  • visibility_secondsinteger

Answer · 200

  • messagesMessage[]required
    • idstring
    • queuestring
    • bodyobject

      The JSON pushed (claims and dead messages only)

    • attemptsinteger

      Times claimed

    • enqueued_atstring
    • claimed_untilstring

      Claims only: when it can be claimed again unless acked

    • died_atstring

      Dead messages only

Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/queues/name/claim' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"max":1,"visibility_seconds":300}'
POST/v1/workspaces/{wid}/tasks/{tid}/queues/{name}/messages/{mid}/ack

Done with a claimed message; it is gone for good (send Content-Type application/json, no body)

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
nameInpathTypestringAboutQueue name
midInpathTypestringAboutMessage id (msg_…)

Answer · 204

Acked

Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/queues/name/messages/mid/ack' \
  -H 'Authorization: Bearer anx_live_…'
POST/v1/workspaces/{wid}/tasks/{tid}/queues/{name}/messages/{mid}/release

Give a claimed message back now, for another claim

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
nameInpathTypestringAboutQueue name
midInpathTypestringAboutMessage id (msg_…)

Answer · 204

Released

Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/queues/name/messages/mid/release' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/tasks/{tid}/queues

One page of the task's queues, by name, with their counts

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • queuesQueue[]required
    • namestring
    • depthinteger

      Waiting to be claimed

    • in_flightinteger

      Claimed, not yet acked

    • deadinteger

      Claimed 5 times and never acked

  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/queues' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/tasks/{tid}/queues/{name}/dead

One page of a queue's dead messages, oldest first (the newest 10,000 are kept)

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
nameInpathTypestringAboutQueue name
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • messagesMessage[]required
    • idstring
    • queuestring
    • bodyobject

      The JSON pushed (claims and dead messages only)

    • attemptsinteger

      Times claimed

    • enqueued_atstring
    • claimed_untilstring

      Claims only: when it can be claimed again unless acked

    • died_atstring

      Dead messages only

  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/queues/name/dead' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/tasks

The workspace's tasks, the one with the newest activity first, each summed from its sandboxes

People and API keys

A task is the work a journal follows across machines: every sandbox started with the same task, and those a resume or carrying on starts. active counts its running, paused, pausing and resuming sandboxes; cost_micros is what they cost so far. Members and API keys. MCP: task_journal list.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • tasksobject[]required
    • idstring
    • sandboxesinteger
    • activeinteger
    • providersstring[]
    • started_atstring
    • last_activity_atstring
    • cost_microsinteger
  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/tasks/{tid}/webhooks

The task's inbound webhooks, newest first, with how many calls each took

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id

Answer · 200

  • webhooksobject[]required
    • idstring
    • taskstring
    • namestring
    • queuestring
    • deliver"sandbox" | "queue"
    • commandstring
    • wakeboolean
    • urlstring

      Only in the answer that made it: Annex keeps only a hash

    • created_atstring
    • last_delivery_atstring | null
    • deliveriesinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/webhooks' \
  -H 'Authorization: Bearer anx_live_…'
POST/v1/workspaces/{wid}/tasks/{tid}/webhooks

Make an inbound webhook for the task

People, API keys and the sandbox's own task token

A secret URL (/hooks/anx_hook_…, answered in this response only) that any service may call. Each call goes on the task's queue in Redis and is answered 202 at once; with deliver sandbox (the default) Annex then writes it into the task's newest running sandbox as /tmp/annex-inbox/<webhook id>/<message id>.json and runs command there if set (the call on stdin, ANNEX_WEBHOOK_FILE set; tried again until it exits 0, 5 times at most); with deliver queue it waits there for the agent to claim. Members, API keys and the task's own sandboxes (task token). 20 per task.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id

Body

  • namestring
  • deliver"sandbox" | "queue"
  • commandstring
  • wakeboolean

    deliver sandbox only: resume the task's newest paused sandbox when a call finds none running

  • queuestring

    deliver queue only: webhooks if left out. A sandbox webhook has a queue of its own, named after it (422 if one is named)

Answer · 201

  • webhookobjectrequired
    • idstring
    • taskstring
    • namestring
    • queuestring
    • deliver"sandbox" | "queue"
    • commandstring
    • wakeboolean
    • urlstring

      Only in the answer that made it: Annex keeps only a hash

    • created_atstring
    • last_delivery_atstring | null
    • deliveriesinteger
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/webhooks' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"name":"…","deliver":"sandbox"}'
DELETE/v1/workspaces/{wid}/tasks/{tid}/webhooks/{hid}

Turn a webhook off; its URL is refused from then on (within a minute on every server)

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
hidInpathTypestringAbout

Answer · 204

Turned off

Terminal
curl -X DELETE 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/webhooks/hid' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/tasks/{tid}/runs

The task's runs, newest first

People, API keys and the sandbox's own task token

Annex records each webhook call as a run on its own, with no change to the agent: queued (waiting for a running sandbox, or for the agent to claim it), running (written into a sandbox, or claimed by the agent), succeeded (the webhook's command exited 0, or the agent acked it), delivered (written into the sandbox with no command, so Annex can't see the outcome), failed (tried 5 times: on the queue's dead list). Members, API keys and the task's own sandboxes (task token). MCP: task_run list.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • runsobject[]required
    • idstring
    • taskstring
    • trigger"webhook" | "agent"
    • webhookstring
    • namestring
    • messagestring
    • status"queued" | "running" | "stuck" | "delivered" | "succeeded" | "failed" | "cancelled"
    • sandboxstring
    • attemptsinteger
    • exit_codeinteger | null
    • errorstring
    • received_atstring
    • started_atstring | null
    • ended_atstring | null
    • last_seen_atstring | null
    • wait_msinteger | null
    • duration_msinteger | null
    • resultstring
    • may_have_run_twiceboolean
    • replay_ofstring
    • agent_cost_microsinteger
  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/runs' \
  -H 'Authorization: Bearer anx_live_…'
POST/v1/workspaces/{wid}/tasks/{tid}/runs

Start a run of the agent's own

People, API keys and the sandbox's own task token

The agent records work that no webhook started (a scheduled job, a step of a plan) and reports on it with events, heartbeats and finish. timeout_seconds (30 to 86400, 600 by default) is how long it may go quiet before it is stuck. MCP: task_run start.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id

Body

  • namestringrequired
  • timeout_secondsinteger

Answer · 201

  • runobjectrequired
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/runs' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"name":"…"}'
GET/v1/workspaces/{wid}/tasks/{tid}/runs/{rid}

One run with its events and cost

People, API keys and the sandbox's own task token

events are each attempt, why one failed and the task's journal lines from its sandbox while it ran (500 at most). cost_micros is what the sandboxes it ran on cost from its start to its end, shared with anything else running there then. MCP: task_run get.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
ridInpathTypestringAbout

Answer · 200

  • runobjectrequired
    • idstring
    • taskstring
    • trigger"webhook" | "agent"
    • webhookstring
    • namestring
    • messagestring
    • status"queued" | "running" | "stuck" | "delivered" | "succeeded" | "failed" | "cancelled"
    • sandboxstring
    • attemptsinteger
    • exit_codeinteger | null
    • errorstring
    • received_atstring
    • started_atstring | null
    • ended_atstring | null
    • last_seen_atstring | null
    • wait_msinteger | null
    • duration_msinteger | null
    • resultstring
    • may_have_run_twiceboolean
    • replay_ofstring
    • agent_cost_microsinteger
    • cost_microsinteger
    • eventsobject[]
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/runs/rid' \
  -H 'Authorization: Bearer anx_live_…'
POST/v1/workspaces/{wid}/tasks/{tid}/runs/{rid}/events

Add an event the agent reports to a run

People, API keys and the sandbox's own task token

kind is step, tool, log, error, usage or the agent's own word (lowercase, 32 characters); text 2,000 characters at most, with the sandbox's secret values taken out; cost_micros is what the step cost apart from sandboxes, added to agent_cost_micros. A delivered or stuck run is running again. 409 once it has ended, or past 1,000 events. MCP: task_run event.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
ridInpathTypestringAbout

Body

  • kindstringrequired
  • textstring
  • cost_microsinteger

Answer · 200

  • runobjectrequired
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/runs/rid/events' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"kind":"…"}'
POST/v1/workspaces/{wid}/tasks/{tid}/runs/{rid}/heartbeat

Say the agent is still working on a run

People, API keys and the sandbox's own task token

Keeps it from going stuck (timeout_seconds changes how long it may go quiet) and keeps the queue claim of the call it works on for another window. The answer says cancel true once the run was cancelled: stop working on it. MCP: task_run heartbeat.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
ridInpathTypestringAbout

Body

  • timeout_secondsinteger

Answer · 200

  • statusstring
  • cancelboolean
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/runs/rid/heartbeat' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"timeout_seconds":1}'
POST/v1/workspaces/{wid}/tasks/{tid}/runs/{rid}/finish

End a run as the agent says

People, API keys and the sandbox's own task token

status succeeded or failed, with a short result or error (2,000 characters each) and cost_micros. 409 once it has ended. MCP: task_run finish.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
ridInpathTypestringAbout

Body

  • status"succeeded" | "failed"required
  • resultstring
  • errorstring
  • cost_microsinteger

Answer · 200

  • runobjectrequired
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/runs/rid/finish' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"status":"succeeded"}'
POST/v1/workspaces/{wid}/tasks/{tid}/runs/{rid}/cancel

Cancel a run

People, API keys and the sandbox's own task token

A waiting call is handed to no one, a claimed one is acked when next claimed, a webhook command running for it is stopped within 2 seconds, and the agent's next heartbeat answers cancel true. 409 once it has ended. MCP: task_run cancel.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
ridInpathTypestringAbout

Answer · 200

  • runobjectrequired
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/runs/rid/cancel' \
  -H 'Authorization: Bearer anx_live_…'
POST/v1/workspaces/{wid}/tasks/{tid}/runs/{rid}/replay

Send a webhook call again as a new run

People, API keys and the sandbox's own task token

The call's message is kept 7 days; its webhook must still be on. Answers the new run (replay_of names this one). 409 otherwise. MCP: task_run replay.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
ridInpathTypestringAbout

Answer · 201

  • runobjectrequired
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/runs/rid/replay' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/tasks/{tid}/run-subscriptions

The URLs the task's run events go to, with each one's last try

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id

Answer · 200

  • run_subscriptionsRunSubscription[]required
    • idstring
    • taskstring
    • urlstring
    • eventsstring[]
    • secretstring

      Only in the answer that made it

    • created_atstring
    • last_attempt_atstring | null
    • last_statusinteger
    • last_errorstring
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/run-subscriptions' \
  -H 'Authorization: Bearer anx_live_…'
POST/v1/workspaces/{wid}/tasks/{tid}/run-subscriptions

Send the task's run events to a URL

People, API keys and the sandbox's own task token

Each status change (run.started, run.succeeded, run.failed, run.stuck, run.cancelled, run.delivered; all if events is left out) is POSTed as {id, type, created_at, run} with Annex-Event and Annex-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<body>" keyed with secret>. Any 2xx counts; otherwise it is tried 3 more times over about 6 minutes, kept in Postgres meanwhile, so a restart drops none. https only; public addresses only. secret is in this answer only. 5 per task. MCP: task_run_subscription create.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id

Body

  • urlstringrequired
  • eventsstring[]

Answer · 201

  • run_subscriptionRunSubscriptionrequired
    • idstring
    • taskstring
    • urlstring
    • eventsstring[]
    • secretstring

      Only in the answer that made it

    • created_atstring
    • last_attempt_atstring | null
    • last_statusinteger
    • last_errorstring
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/run-subscriptions' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"url":"…"}'
DELETE/v1/workspaces/{wid}/tasks/{tid}/run-subscriptions/{sid}

Stop sending run events to a URL

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
sidInpathTypestringAbout

Answer · 204

Removed

Terminal
curl -X DELETE 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/run-subscriptions/sid' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/tasks/{tid}/kv

One page of the task's keys starting with prefix, in key order, with their values

People, API keys and the sandbox's own task token

Kept in Postgres (Redis only caches it), so it survives Redis being wiped; everything of a task expires 7 days after its last activity. A task holds 10,000 keys at most. Key order is byte order.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
prefix?InqueryTypestringAbout
page?InqueryTypeintegerAboutA missing or invalid page is 1
perPage?InqueryTypeintegerAboutHeld between 1 and 100

Answer · 200

  • kvKV[]required
    • keystring
    • valueobject

      Any JSON value

    • versioninteger

      Counts the key's writes and deletes, from 1, and never goes back; match it with If-Match

    • updated_atstring
  • metaMetarequired
    • pageinteger
    • totalinteger

      Items matching, across all pages

    • pageCountinteger

      ceil(total / perPage)

    • perPageinteger
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/kv' \
  -H 'Authorization: Bearer anx_live_…'
GET/v1/workspaces/{wid}/tasks/{tid}/kv/{key}

One key, with an ETag of its version

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
keyInpathTypestringAboutMay hold slashes, like results/7

Answer · 200

  • kvKVrequired
    • keystring
    • valueobject

      Any JSON value

    • versioninteger

      Counts the key's writes and deletes, from 1, and never goes back; match it with If-Match

    • updated_atstring
Terminal
curl -X GET 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/kv/key' \
  -H 'Authorization: Bearer anx_live_…'
PUT/v1/workspaces/{wid}/tasks/{tid}/kv/{key}

Write a key; with If-Match, only if it is still at that version

People, API keys and the sandbox's own task token

If-Match "3" writes only if the key is at version 3, and "0" only if it doesn't exist yet; otherwise 412 precondition_failed: read it again and retry. Without If-Match it always writes. A version counts the key's writes and deletes and never goes back: a key deleted and made again goes on from where it was, so an If-Match read before the delete never matches. 409 past 10,000 keys.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
keyInpathTypestringAboutMay hold slashes, like results/7
If-Match?InheaderTypestringAbout

Body

  • valueobjectrequired

    Any JSON value, 64 KiB at most once compacted

Answer · 200

  • kvKVrequired
    • keystring
    • valueobject

      Any JSON value

    • versioninteger

      Counts the key's writes and deletes, from 1, and never goes back; match it with If-Match

    • updated_atstring
Terminal
curl -X PUT 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/kv/key' \
  -H 'Authorization: Bearer anx_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"value":{}}'
DELETE/v1/workspaces/{wid}/tasks/{tid}/kv/{key}

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id
keyInpathTypestringAboutMay hold slashes, like results/7

Answer · 204

Deleted

Terminal
curl -X DELETE 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/kv/key' \
  -H 'Authorization: Bearer anx_live_…'
POST/v1/workspaces/{wid}/tasks/{tid}/token/refresh

Keep the calling sandbox's task token for 24 hours more (task tokens only; an API key gets 403)

People, API keys and the sandbox's own task token

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id

Answer · 200

  • task_tokenobjectrequired
    • expires_atstring
Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/token/refresh' \
  -H 'Authorization: Bearer anx_live_…'
POST/v1/workspaces/{wid}/tasks/{tid}/heartbeat

The calling sandbox is alive (task tokens only; an API key gets 403)

People, API keys and the sandbox's own task token

Sent every 5 s by a loop Annex starts inside the sandbox; each beat keeps it counted alive for 15 s. A heartbeat that stops never marks a sandbox lost by itself: Annex then asks its provider. 410 gone means stop beating: nothing has used the sandbox through Annex for an hour.

ParameterInTypeAbout
widInpathTypestringAboutWorkspace id
tidInpathTypestringAboutTask id

Answer · 204

Keep beating

Terminal
curl -X POST 'https://annex.eversonder.com/v1/workspaces/wsp_…/tasks/tid/heartbeat' \
  -H 'Authorization: Bearer anx_live_…'