REST API Reference

Generated from the API spec — do not edit by hand. Run pnpm gen to refresh.

Everything the CLI does rides on this /v1 surface.

export WORCA_API_URL="https://worca-hi-api.up.railway.app"

Authentication

Every endpoint requires a Bearer API key:

Authorization: Bearer wk_live_…

A missing or invalid key returns 401 with

{
  "error": "Invalid or missing API key"
}

The examples below use $WORCA_API_URL and $WORCA_API_KEY — the same variables the SDK and CLI read.

The task object

Every task-returning endpoint serializes this shape:

FieldTypeRequiredDescription
idstringnoCallback ID — poll GET /v1/tasks/:id with it
modestringnoAlways EXECUTE
typeenum: social_post · video_edit · phone_call · customnoTask type
statusenum: queued · awaiting_approval · in_progress · done · failednoWire status; done and failed are terminal. awaiting_approval (custom tasks): the quote is in — approve or decline
quote_centsnumbernullno
quoted_atstringnullno
picked_up_atstringnullno
concluded_atstringnullno
resultobjectnullno
proof_urlstringnullno
created_atstringnoISO timestamp the task was created

Endpoints

GET /v1/whoami

Who does this key belong to. Use it to validate a key and read the account name/tier.

Returns \{ account: \{ id, name, tier } }

curl -s "$WORCA_API_URL/v1/whoami" \
  -H "Authorization: Bearer $WORCA_API_KEY"

GET /v1/status

Platform-wide system status: worker-queue depth and the median time from task creation to human pickup. For bare uptime checks without a key, use GET /health.

Returns \{ ok, time, hours, queue: \{ queued, in_progress }, eta_s }eta_s is the median seconds until a human picks a task up (recent sample; null if there's no recent data).

curl -s "$WORCA_API_URL/v1/status" \
  -H "Authorization: Bearer $WORCA_API_KEY"

GET /v1/task-types

The machine-readable task catalog — what humans can do, with field-level input/result schemas and an example input per type. Same registry the CLI ships offline.

Returns \{ task_types: [...] } — one entry per type with name, title, summary, input_fields, result_fields, proof, and example_input.

curl -s "$WORCA_API_URL/v1/task-types" \
  -H "Authorization: Bearer $WORCA_API_KEY"

POST /v1/tasks

Create an execute task. A vetted human performs it; poll the returned id for the result.

Request body

FieldTypeRequiredDescription
typeenum: social_post · video_edit · phone_call · customyesWhich task type to run
inputobjectyesType-specific input — schema and example from GET /v1/task-types
deadlinestringnoISO timestamp the task must conclude by

Returns 201 with the created task object; status starts at queued. custom tasks are quoted first: poll until status is awaiting_approval, then approve or decline.

Errors

  • 400type missing or not an execute type
  • 400input fails the type's schema — \{ error: "invalid input", details: [...] } lists per-field problems
curl -s -X POST "$WORCA_API_URL/v1/tasks" \
  -H "Authorization: Bearer $WORCA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "type": "social_post", "input": { … } }'

POST /v1/tasks/:id/approve

Accept the quote on a custom task. The task joins the worker queue and work starts.

Returns The task object, now queued.

Errors

  • 404 — No task with that id on this account
  • 409 — Task is not awaiting approval
curl -s -X POST "$WORCA_API_URL/v1/tasks/tsk_3b91…/approve" \
  -H "Authorization: Bearer $WORCA_API_KEY"

POST /v1/tasks/:id/decline

Decline the quote. The task concludes; it reads as failed on the wire.

Returns The task object, now failed.

Errors

  • 404 — No task with that id on this account
  • 409 — Task is not awaiting approval
curl -s -X POST "$WORCA_API_URL/v1/tasks/tsk_3b91…/decline" \
  -H "Authorization: Bearer $WORCA_API_KEY"

GET /v1/tasks

List the account's tasks, newest first.

Query parameters

ParameterTypeRequiredDescription
statusenum: queued · awaiting_approval · in_progress · done · failednoFilter by wire status
limitnumbernoPage size (default 20, max 100)

Returns \{ tasks: [...] } — task objects, newest first.

curl -s "$WORCA_API_URL/v1/tasks?status=done&limit=10" \
  -H "Authorization: Bearer $WORCA_API_KEY"

GET /v1/tasks/:id

The callback endpoint. Poll until status is done or failed.

Returns The task object.

Errors

  • 404 — No task with that id on this account
curl -s "$WORCA_API_URL/v1/tasks/tsk_3b91…" \
  -H "Authorization: Bearer $WORCA_API_KEY"