{"openapi":"3.1.0","info":{"title":"twelfth REST API","version":"1.0.0","description":"A deliberately small resource API for server-side twelfth integrations. It starts with workspace identity and current task reads; new resources are added only after their contracts and permissions are ready.\n\n**Authentication.** Send a workspace API key as `Authorization: Bearer <key>`. Give each server, script or automation its own labelled key and never expose a key in browser code.\n\n**Errors.** Every error is `application/problem+json` (RFC 9457), with a stable machine-readable `code` and a recovery `hint`.\n\n**Compatibility.** Paths are stable and unversioned. Published operations evolve additively: existing paths, fields and documented error codes remain supported.\n\n**Rate limits.** Responses carry `RateLimit-*` headers; a `429` also carries `Retry-After`.","contact":{"name":"twelfth AI developer enquiries","email":"hello@twelfth.ai","url":"https://twelfth.ai/developers"}},"x-api-lifecycle":{"versioning":"Stable, unversioned URL paths. A path names a resource or capability, never a release number.","deprecationPolicy":"Published paths, methods, fields and documented error codes remain backwards compatible. twelfth may add optional fields, resources and operations. Deprecated contract elements remain supported; a security or legal emergency that makes continued support impossible is announced at https://twelfth.ai/developers and signalled with Deprecation and Sunset headers where practical."},"externalDocs":{"description":"twelfth developer API guide","url":"https://twelfth.ai/docs/developers/"},"servers":[{"url":"https://api.twelfth.ai","description":"twelfth production API"}],"paths":{"/workspace":{"get":{"operationId":"getWorkspace","summary":"Get the workspace","description":"Returns the identity and operating defaults of the workspace attached to the API key. Use these timezone, currency and country values when interpreting dates and money from later resources.","security":[{"workspaceApiKey":[]}],"responses":{"200":{"description":"The workspace attached to the API key.","headers":{"RateLimit-Limit":{"description":"Request quota for the current window.","schema":{"type":"integer","example":120}},"RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","example":119}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer","example":47}},"RateLimit-Policy":{"description":"The quota policy, as `<limit>;w=<window-seconds>`.","schema":{"type":"string","example":"120;w=60"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"401":{"description":"The workspace API key is missing, invalid or revoked.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"The key no longer refers to an available workspace.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"405":{"description":"The resource is read-only.","headers":{"Allow":{"description":"Permitted methods.","schema":{"type":"string","example":"GET, HEAD, OPTIONS"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded. Retry after the window resets.","headers":{"RateLimit-Limit":{"description":"Request quota for the current window.","schema":{"type":"integer","example":120}},"RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","example":119}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer","example":47}},"RateLimit-Policy":{"description":"The quota policy, as `<limit>;w=<window-seconds>`.","schema":{"type":"string","example":"120;w=60"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","example":47}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Unexpected server error.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/tasks":{"get":{"operationId":"listTasks","summary":"List current tasks","description":"Returns up to 100 current tasks across the workspace. A current task is open and not snoozed into the future. Tasks are ordered by due date first, then creation time; tasks without a due date follow dated tasks.","security":[{"workspaceApiKey":[]}],"responses":{"200":{"description":"The workspace's current tasks.","headers":{"RateLimit-Limit":{"description":"Request quota for the current window.","schema":{"type":"integer","example":120}},"RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","example":119}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer","example":47}},"RateLimit-Policy":{"description":"The quota policy, as `<limit>;w=<window-seconds>`.","schema":{"type":"string","example":"120;w=60"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TasksResponse"}}}},"401":{"description":"The workspace API key is missing, invalid or revoked.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"405":{"description":"The resource is read-only.","headers":{"Allow":{"description":"Permitted methods.","schema":{"type":"string","example":"GET, HEAD, OPTIONS"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded. Retry after the window resets.","headers":{"RateLimit-Limit":{"description":"Request quota for the current window.","schema":{"type":"integer","example":120}},"RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","example":119}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer","example":47}},"RateLimit-Policy":{"description":"The quota policy, as `<limit>;w=<window-seconds>`.","schema":{"type":"string","example":"120;w=60"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","example":47}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Unexpected server error.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/exports/open-actions":{"get":{"operationId":"exportOpenActions","summary":"Export open actions as CSV","description":"Returns every current task in the workspace (up to 5,000) as one CSV table, for BI tools such as Power BI, Excel and Google Sheets that re-download a whole table on a schedule. Columns match the `Task` fields of `GET /tasks`, in the same order. The file is a snapshot: each workspace's export is rebuilt at most every 15 minutes, and `Last-Modified` gives the time it was taken. Cells that a spreadsheet would run as a formula are prefixed with an apostrophe.","security":[{"workspaceApiKey":[]}],"responses":{"200":{"description":"The workspace's current tasks, one row each, with a header row.","headers":{"RateLimit-Limit":{"description":"Request quota for the current window.","schema":{"type":"integer","example":120}},"RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","example":119}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer","example":47}},"RateLimit-Policy":{"description":"The quota policy, as `<limit>;w=<window-seconds>`.","schema":{"type":"string","example":"120;w=60"}},"Last-Modified":{"description":"When this snapshot was taken.","schema":{"type":"string","example":"Mon, 02 Nov 2026 06:00:00 GMT"}}},"content":{"text/csv":{"schema":{"type":"string","example":"id,title,details,dueAt,bookKey,assigneeName,assigneeEmail,sourceSessionId,sourceTitle,sourceSummary,sourceKind\r\ntask_01JABCDEFGHJKMNPQRSTVWXYZ,Review the Nintendo order,,2026-10-21T03:00:00.000Z,dept:toys,Sam Lee,sam@example.com,,,,\r\n"}}}},"401":{"description":"The workspace API key is missing, invalid or revoked.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"405":{"description":"The resource is read-only.","headers":{"Allow":{"description":"Permitted methods.","schema":{"type":"string","example":"GET, HEAD, OPTIONS"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit exceeded. Retry after the window resets.","headers":{"RateLimit-Limit":{"description":"Request quota for the current window.","schema":{"type":"integer","example":120}},"RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer","example":119}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer","example":47}},"RateLimit-Policy":{"description":"The quota policy, as `<limit>;w=<window-seconds>`.","schema":{"type":"string","example":"120;w=60"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","example":47}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Unexpected server error.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"securitySchemes":{"workspaceApiKey":{"type":"http","scheme":"bearer","description":"Workspace API key generated by a twelfth workspace owner or admin."}},"schemas":{"WorkspaceResponse":{"type":"object","required":["workspace"],"properties":{"workspace":{"$ref":"#/components/schemas/Workspace"}},"additionalProperties":true},"Workspace":{"type":"object","required":["id","name","slug","timezone","currencyCode","countryCode"],"properties":{"id":{"type":"string","description":"Stable workspace identifier.","example":"org_01JABCDEFGHJKMNPQRSTVWXYZ"},"name":{"type":"string","description":"Display name.","example":"Northstar Retail"},"slug":{"type":"string","description":"Human-readable workspace slug.","example":"northstar-retail"},"timezone":{"type":["string","null"],"description":"IANA timezone used for business dates.","example":"Australia/Melbourne"},"currencyCode":{"type":["string","null"],"description":"ISO 4217 reporting currency.","example":"AUD"},"countryCode":{"type":["string","null"],"description":"ISO 3166-1 alpha-2 country code.","example":"AU"}},"additionalProperties":true},"TasksResponse":{"type":"object","required":["tasks"],"properties":{"tasks":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/Task"}}},"additionalProperties":true},"Task":{"type":"object","required":["id","title","details","dueAt","bookKey","assigneeName","assigneeEmail","sourceSessionId","sourceTitle","sourceSummary","sourceKind"],"properties":{"id":{"type":"string","description":"Stable task identifier.","example":"task_01JABCDEFGHJKMNPQRSTVWXYZ"},"title":{"type":"string","description":"Short description of the work.","example":"Review the Nintendo order"},"details":{"type":["string","null"],"description":"Additional task context when available."},"dueAt":{"type":["string","null"],"format":"date-time","description":"Due time in RFC 3339 format, or null when the task has no due date.","example":"2026-10-21T03:00:00.000Z"},"bookKey":{"type":["string","null"],"description":"Buying-remit key, or null for a workspace-wide task.","example":"dept:toys"},"assigneeName":{"type":["string","null"],"description":"Display name of the assignee, when assigned.","example":"Sam Lee"},"assigneeEmail":{"type":["string","null"],"format":"email","description":"Email address of the assignee, when assigned.","example":"sam@example.com"},"sourceSessionId":{"type":["string","null"],"description":"Identifier of the source task that produced this one, when applicable."},"sourceTitle":{"type":["string","null"],"description":"Title of the source task, when applicable."},"sourceSummary":{"type":["string","null"],"description":"Summary of the source task, when available."},"sourceKind":{"type":["string","null"],"description":"Extensible source-task kind, when applicable."}},"additionalProperties":true},"Problem":{"type":"object","description":"A structured, machine-readable error (RFC 9457 problem detail).","required":["type","title","status","code","detail","hint"],"properties":{"type":{"type":"string","format":"uri-reference","default":"about:blank"},"title":{"type":"string","description":"Short, human-readable summary."},"status":{"type":"integer","description":"HTTP status code.","example":401},"code":{"type":"string","enum":["not_found","method_not_allowed","rate_limited","unauthorized","workspace_not_found","internal_error"],"description":"Stable error code for programmatic handling.","example":"unauthorized"},"detail":{"type":"string","description":"Explanation specific to this occurrence."},"hint":{"type":"string","description":"How to resolve or work around the error."}},"additionalProperties":true}}}}