Agents

REST API

Same base, same auth, for anything that is not an MCP client.

BASE=https://usecotask.com/api/agent
AUTH="Authorization: Bearer pl_your_key"
Method and pathDoes
GET /Service info: the MCP URL, the REST base, how to authorize
GET /tasksList tasks — ?status=&project=&priority=&reminder=&query=&limit=
POST /tasksCreate a task (a draft unless you pass status)
GET /tasks/:idOne task with its attachments
PATCH /tasks/:idUpdate the fields you pass (PUT behaves the same)
DELETE /tasks/:idDelete — drafts only, for agents
GET /tasks/:id/attachmentsThe task's links and files
POST /tasks/:id/attachmentsAttach a link: {url, title?}
DELETE /tasks/:id/attachments/:attachmentIdRemove an attachment
POST /tasks/:id/filesAttach a file: {data} base64 or {source_url}
GET /projects · POST /projectsList · create projects
GET /preview?url=…Resolve a page's title and favicon without attaching it
POST /uploadsA signed upload URL for one object — the apps' three-step upload
PUT /tasks/:id/reminder · DELETE /tasks/:id/reminderSet when a task rings and how loudly · take the reminder off
POST /delegateSend a task to one of your routes — app session only. See Delegate through the API
GET /delegations · DELETE /delegations/:idScheduled sends (?status= — waiting by default, or all) · call one off while it waits
GET /webhooks · POST /webhooksList · create routes: {name, url, params?} for a webhook, {name, kind: "mac", runner, model?, effort?, params?} for a Mac route (app session only)
PATCH /webhooks/:id · DELETE /webhooks/:idChange · remove a route. params replaces the whole set
POST /webhooks/:id/token · PUT /webhooks/:id/secret · DELETE /webhooks/:id/tokenA Mac route's inbound token (new or rotated) · a webhook's signing secret · revoke either — app session only, shown once
POST /inbound/:id · GET /inbound/:id/:dispatchQueue work for a Mac route · how it went — authorized by the route's prt_ token, not your key
POST /storage/gcSweep files no attachment points at — app session only
DELETE /accountDelete the account and everything in it — app session only
curl "$BASE/tasks?status=todo" -H "$AUTH"

curl -X POST "$BASE/tasks" -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"title":"Review the Q3 plan","project":"Work","due_date":"2026-09-01","priority":"high"}'

curl -X PUT "$BASE/tasks/<id>/reminder" -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"remind_at":"2026-09-01T09:00","urgent":true}'   # 9am your time, as an alarm

curl -X PUT "$BASE/tasks/<id>/reminder" -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"remind_in":"45m"}'                              # in three quarters of an hour

curl -X PATCH "$BASE/tasks/<id>" -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"status":"doing"}'

curl -X POST "$BASE/tasks/<id>/attachments" -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"url":"https://www.notion.so/Meeting-notes-…"}'

curl -X POST "$BASE/tasks/<id>/files" -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"source_url":"https://example.com/q3.pdf"}'

Responses are JSON: {"task": …}, {"tasks": […]}, {"attachment": …}. Errors are {"error": "…"} with a real status code — 400 bad input, 401 missing or expired credentials (with a WWW-Authenticate header pointing an MCP client at the OAuth flow), 402 a Pro feature, or storage full, on a Free account, 403 something only you may do, 404 not found, 409 a Mac route with nothing to run, 413 a file or a body over the limit, 429 too many requests, 502 a webhook that could not be reached or did not answer 2xx.

Every task comes back with its attachments: id, title, url, kind (link or file), created_by, plus content_type and byte_size on files. url is always fetchable with no credentials.

OAuth endpoints#

Implemented for MCP clients that discover them automatically. You never call these by hand.

EndpointPurpose
GET /.well-known/oauth-protected-resourceRFC 9728 — points at the authorization server
GET /.well-known/oauth-authorization-serverRFC 8414 — endpoints and S256 PKCE
POST /registerRFC 7591 dynamic client registration
GET /authorizeRedirects to Cotask's hosted consent screen
POST /authorizeVerifies your credentials and mints a single-use code
POST /tokenauthorization_code (PKCE-verified) and rotating refresh_token

Only SHA-256 hashes of codes and tokens are stored.