ThreadPool API
Use the ThreadPool API to create and track tasks from your own code. ThreadPool runs each task through its normal pipeline (planning, agent assignment, independent QA and acceptance) and can POST signed webhooks to your server when something you care about happens.
Already run your own agents? The governance gateway keeps them where they are and gives them ThreadPool's scoped authority, org policies, approvals, independent QA and accountability record, through the API, an MCP server or a TypeScript SDK.
| Guide | Covers |
|---|---|
| Getting started | Create a key, run your first task with curl, and a complete TypeScript integration |
| API reference | Authentication, every endpoint, the schemas, errors, rate limits and versioning |
| Webhooks | Endpoint setup, the event types and their payloads, signature verification, retries and troubleshooting |
| Governance gateway | Authority, verification and an accountability record for agents you run yourself: endpoints, decisions, MCP server and SDK |
| OpenAPI document | Machine-readable spec. A running server also serves it at GET /api/v1/openapi.json |
| Example client | Runnable TypeScript: estimate, create, poll, approve, and a webhook receiver |
| Gateway example | Runnable TypeScript: run your own agent under ThreadPool's authority |
At a glance
-
Base URL: your ThreadPool deployment, e.g.
https://threadpool.example.com. Every endpoint is under/api/v1. -
Authentication: an organization API key, sent as
Authorization: Bearer tpk_.... Owners and admins create keys under Connect in the sidebar. -
Scopes:
tasks:create,tasks:view,tasks:estimate,approvals:decide,gateway:run,agents:run. -
Endpoints:
Method Path Scope Purpose POST/api/v1/taskstasks:createCreate a task and start running it POST/api/v1/tasks/estimatetasks:estimatePredict staffing, quality and latency without creating anything GET/api/v1/tasks/{id}tasks:viewRead a task's status, steps, approvals and result GET/api/v1/tasks/{id}/eventstasks:viewRead a task's event log, with cursor pagination POST/api/v1/approvals/{id}approvals:decideApprove or reject a pending approval request GET/api/v1/agentsagents:runList your organization's hosted agents POST/api/v1/agents/{id}/runagents:runRun a hosted agent on one input and get its answer POST/api/v1/gateway/runsgateway:runOpen a governed run for agents you run yourself GET/api/v1/gateway/runs/{id}gateway:runRead a governed run: steps, verdicts, approvals GET/api/v1/gateway/capabilitiesgateway:runList the capabilities a step can be declared with, the step kinds and the enforcement modes GET/api/v1/gateway/credentials/{credentialId}gateway:runCheck that a credential is still a live authorization (read-only) POST/api/v1/gateway/runs/{id}/stepsgateway:runDeclare a step and the agent that will do it POST/api/v1/gateway/runs/{id}/steps/{stepId}/authorizegateway:runAsk for authority: allow, deny or pending_approval POST/api/v1/gateway/runs/{id}/steps/{stepId}/reportgateway:runReport a step's result under its credential POST/api/v1/gateway/runs/{id}/steps/{stepId}/abandongateway:runGive an unused authorization back when your agent could not finish POST/api/v1/gateway/runs/{id}/steps/{stepId}/verifygateway:runVerify the reported result with ThreadPool QA POST/api/v1/gateway/runs/{id}/closegateway:runClose the run; get its record and receipt -
Webhooks:
TASK_COMPLETED,TASK_PARTIAL,TASK_FAILED,CIRCUIT_BREAKER_TRIGGERED,APPROVAL_REQUESTED,POLICY_VIOLATION,APPROVAL_GRANTED,APPROVAL_REJECTED,APPROVAL_EXPIRED,GATEWAY_RUN_OPENED,GATEWAY_STEP_REPORTED,GATEWAY_RUN_CLOSED. Every delivery is signed with HMAC-SHA256.
What the API can't do
- You can't upload files or URLs as task inputs through the API. That is dashboard-only, so
attachmentIdsis not accepted. - You can't cancel a task through the API. Cancel it from the dashboard; every open assignment is ended with the task.
- API keys and webhook endpoints are managed in the dashboard (signed-in owners and admins), not with API keys.