Base URL
Authentication
All requests require an API key in theAuthorization header:
Error Handling
All error responses follow this format:API Keys
RESTful endpoints for managing API keys.List API keys
GET /api/public/v1/access-api-keys
GET /api/public/v1/access-api-keys
Returns all API keys for the authenticated user.ExampleResponse
Create an API key
POST /api/public/v1/access-api-keys
POST /api/public/v1/access-api-keys
Creates a new API key. The full key is only returned once — store it securely.Request body
ExampleResponse
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Optional name for the key |
Revoke an API key
DELETE /api/public/v1/access-api-keys/{keyId}
DELETE /api/public/v1/access-api-keys/{keyId}
Permanently revokes an API key. Any requests using it will stop working immediately.Path parameters
Example
| Field | Type | Required | Description |
|---|---|---|---|
keyId | string | Yes | The ID of the key to revoke |
Agents
Create, list, update, and delete agents. All agent endpoints usePOST with a JSON body.
Create an agent
POST /twin.service.TwinService/CreateAgentOnly
POST /twin.service.TwinService/CreateAgentOnly
Creates a new agent with a goal description.Request body
ExampleResponse
| Field | Type | Required | Description |
|---|---|---|---|
goal | string | Yes | Natural-language description of the task |
projectId | string | No | Project to assign the agent to |
Get an agent
POST /twin.service.TwinService/GetAgent
POST /twin.service.TwinService/GetAgent
Returns full details for a specific agent.Request body
ExampleResponse
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The agent’s ID |
List agents
POST /twin.service.TwinService/ListAgents
POST /twin.service.TwinService/ListAgents
Returns all agents, optionally filtered by project.Request body
ExampleResponse
| Field | Type | Required | Description |
|---|---|---|---|
projectId | string | No | Filter by project (omit for all) |
Update agent goal
POST /twin.service.TwinService/UpdateAgentGoal
POST /twin.service.TwinService/UpdateAgentGoal
Updates the natural-language goal for an existing agent.Request body
ExampleResponse
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The agent’s ID |
newGoal | string | Yes | The updated goal |
Delete an agent
POST /twin.service.TwinService/DeleteAgent
POST /twin.service.TwinService/DeleteAgent
Permanently deletes an agent and all associated data.Request body
ExampleResponse
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The agent’s ID |
Runs
Trigger agent executions, check status, and retrieve results.Start a run
POST /twin.service.TwinService/StartRun
POST /twin.service.TwinService/StartRun
Triggers a new run for a deployed agent.Request body
ExampleResponse
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The agent to run |
List runs
POST /twin.service.TwinService/ListAgentRuns
POST /twin.service.TwinService/ListAgentRuns
Returns paginated run history for an agent with optional filters.Request body
ExampleResponse
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | The agent’s ID |
page | integer | No | Page number (default 1) |
pageSize | integer | No | Results per page (default 20) |
filterStatus | string | No | "finished", "running", or omit for all |
filterStartedAfter | string | No | ISO 8601 date — only runs after this time |
filterStartedBefore | string | No | ISO 8601 date — only runs before this time |
Get run detail
POST /twin.service.TwinService/GetRunDetail
POST /twin.service.TwinService/GetRunDetail
Returns detailed information for a specific run, including step-by-step execution data.Request body
Example
| Field | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | The run’s ID |
Quick Reference
| Action | Method | Endpoint |
|---|---|---|
| List API keys | GET | /api/public/v1/access-api-keys |
| Create API key | POST | /api/public/v1/access-api-keys |
| Revoke API key | DELETE | /api/public/v1/access-api-keys/{keyId} |
| Create agent | POST | /twin.service.TwinService/CreateAgentOnly |
| Get agent | POST | /twin.service.TwinService/GetAgent |
| List agents | POST | /twin.service.TwinService/ListAgents |
| Update agent goal | POST | /twin.service.TwinService/UpdateAgentGoal |
| Delete agent | POST | /twin.service.TwinService/DeleteAgent |
| Start run | POST | /twin.service.TwinService/StartRun |
| List runs | POST | /twin.service.TwinService/ListAgentRuns |
| Get run detail | POST | /twin.service.TwinService/GetRunDetail |
API key endpoints (
/api/public/v1/...) use standard REST methods (GET, POST, DELETE). All other endpoints use POST with a JSON body — this is the gRPC-gateway convention used by Twin’s API.Get your API key
Sign in to Twin to generate your API key and start building.
