Base URL
OpenAPI Specification
A machine-readable OpenAPI 3.1 schema is available at:Authentication
Use the following header on every request:Error Handling
Error responses follow RFC 9457 Problem Details and returnContent-Type: application/problem+json.
typeis a URI identifying the problem type (about:blankmeans no extra semantics beyond the HTTP status).statusis the HTTP status code.titleis the standard HTTP reason phrase.detailis a human-readable error message.
API Keys
API key management endpoints currently use the/api/public/v1 path family.
These endpoints use the same auth headers and Problem Detail error format as the /v1 endpoints.
List API keys
GET /api/public/v1/access-api-keys
GET /api/public/v1/access-api-keys
Create an API key
POST /api/public/v1/access-api-keys
POST /api/public/v1/access-api-keys
Revoke an API key
DELETE /api/public/v1/access-api-keys/{key_id}
DELETE /api/public/v1/access-api-keys/{key_id}
Identity
Get current user
GET /v1/me
GET /v1/me
Agents
Versioned agent endpoints live under/v1/agents.
List agents
GET /v1/agents
GET /v1/agents
Create an agent
POST /v1/agents
POST /v1/agents
201 CreatedGet an agent
GET /v1/agents/{agent_id}
GET /v1/agents/{agent_id}
Delete an agent
DELETE /v1/agents/{agent_id}
DELETE /v1/agents/{agent_id}
204 No Content — empty body on success. Returns 404 if the agent was not found.Runs
Trigger, list, cancel, and delete runs under each agent.List runs
GET /v1/agents/{agent_id}/runs
GET /v1/agents/{agent_id}/runs
Start a run
POST /v1/agents/{agent_id}/runs
POST /v1/agents/{agent_id}/runs
201 CreatedDelete a run
DELETE /v1/agents/{agent_id}/runs/{run_id}
DELETE /v1/agents/{agent_id}/runs/{run_id}
204 No Content — empty body on success. Returns 404 if the run was not found.Cancel a run
POST /v1/agents/{agent_id}/runs/{run_id}/cancel
POST /v1/agents/{agent_id}/runs/{run_id}/cancel
{} or omit the body altogether.Exampleerror means success. A non-empty value is informational (e.g. the run was already stopped).Events
List run events
GET /v1/agents/{agent_id}/runs/{run_id}/events
GET /v1/agents/{agent_id}/runs/{run_id}/events
Webhooks
Register webhook URLs to receive push notifications when runs change state. Instead of polling for run completion, your backend gets an HTTP POST for each lifecycle event.Event types
Create a webhook
POST /v1/agents/{agent_id}/webhooks
POST /v1/agents/{agent_id}/webhooks
201 CreatedList webhooks
GET /v1/agents/{agent_id}/webhooks
GET /v1/agents/{agent_id}/webhooks
Get a webhook
GET /v1/agents/{agent_id}/webhooks/{webhook_id}
GET /v1/agents/{agent_id}/webhooks/{webhook_id}
Update a webhook
PATCH /v1/agents/{agent_id}/webhooks/{webhook_id}
PATCH /v1/agents/{agent_id}/webhooks/{webhook_id}
Delete a webhook
DELETE /v1/agents/{agent_id}/webhooks/{webhook_id}
DELETE /v1/agents/{agent_id}/webhooks/{webhook_id}
204 No ContentWebhook payload
When a subscribed event fires, Twin sends an HTTP POST to your webhook URL with a JSON body:Verifying webhook signatures
Every webhook delivery includes two headers:HMAC-SHA256(signing_secret, raw_request_body) and compare it to the signature in the header.
Example (Node.js)
Schedules
Manage cron-based schedules for agents. Each agent can have at most one schedule.Get agent schedule
GET /v1/agents/{agent_id}/schedule
GET /v1/agents/{agent_id}/schedule
{"schedule": null} if no schedule is set.Set agent schedule
PUT /v1/agents/{agent_id}/schedule
PUT /v1/agents/{agent_id}/schedule
sec min hour day month day-of-week year.Delete agent schedule
DELETE /v1/agents/{agent_id}/schedule
DELETE /v1/agents/{agent_id}/schedule
Pause schedule
POST /v1/agents/{agent_id}/schedule/pause
POST /v1/agents/{agent_id}/schedule/pause
Resume schedule
POST /v1/agents/{agent_id}/schedule/resume
POST /v1/agents/{agent_id}/schedule/resume
List all schedules
GET /v1/schedules
GET /v1/schedules
Instructions
Read and update the auto-generated instructions for an agent, with version history.Get instructions
GET /v1/agents/{agent_id}/instructions
GET /v1/agents/{agent_id}/instructions
Update instructions
PUT /v1/agents/{agent_id}/instructions
PUT /v1/agents/{agent_id}/instructions
Get instructions history
GET /v1/agents/{agent_id}/instructions/history
GET /v1/agents/{agent_id}/instructions/history
Workspaces
Organize agents into workspaces (folders). Every user has at least one default workspace.List workspaces
GET /v1/workspaces
GET /v1/workspaces
Create a workspace
POST /v1/workspaces
POST /v1/workspaces
201 CreatedUpdate a workspace
PUT /v1/workspaces/{workspace_id}
PUT /v1/workspaces/{workspace_id}
Delete a workspace
DELETE /v1/workspaces/{workspace_id}
DELETE /v1/workspaces/{workspace_id}
Reorder workspaces
POST /v1/workspaces/reorder
POST /v1/workspaces/reorder
Move agent to workspace
POST /v1/agents/{agent_id}/move
POST /v1/agents/{agent_id}/move
Quick Reference
/v1 with standard HTTP methods.