API Reference
Overview
The AgentPlatform API lets you manage agents, view runs, and monitor usage programmatically. The API follows REST conventions and returns JSON responses.
The full OpenAPI specification is available at /api/v1/openapi.json.
You can also browse the interactive Swagger UI
at /api/v1/docs.
Authentication
All API requests require a Bearer token. Generate an API key in Settings → API Keys.
Authorization: Bearer your-api-key
When creating an API key, you can set an expiration: 30 days, 60 days, 90 days, 1 year, or never. The key's last used timestamp is displayed on the API Keys settings page so you can identify unused keys.
Each API key has scopes that control what it can access:
agents:read— list and view agentsagents:write— create, update, and delete agentsruns:read— view agent run historyconnections:read— list calendar connectionsusage:read— view usage statisticssignals:write— send signals to agentsnotifications:read— list and view notificationsnotifications:write— mark notifications as readwebhooks:read— list and view webhook endpointswebhooks:write— create, update, and delete webhooksmcp:read— list and view MCP server configsmcp:write— create, update, and delete MCP serverscredentials:read— list and view credentialscredentials:write— create and revoke credentialsaudit_logs:read— list audit log entriesmcp:tools— access the MCP server endpoint
Base URL
https://your-domain.com/api/v1
Endpoints
Agents
| Method | Path | Description | Scope |
|---|---|---|---|
GET |
/agents |
List all agents | agents:read |
POST |
/agents |
Create an agent | agents:write |
GET |
/agents/:id |
Get agent details | agents:read |
PATCH |
/agents/:id |
Update an agent | agents:write |
DELETE |
/agents/:id |
Delete an agent | agents:write |
POST |
/agents/:id/pause |
Pause an agent | agents:write |
POST |
/agents/:id/resume |
Resume an agent | agents:write |
POST |
/agents/:id/signals |
Send a signal | signals:write |
Runs
| Method | Path | Description | Scope |
|---|---|---|---|
GET |
/agents/:agent_id/runs |
List runs for an agent | runs:read |
GET |
/runs/:id |
Get run details | runs:read |
Notifications
| Method | Path | Description | Scope |
|---|---|---|---|
GET |
/notifications |
List notifications | notifications:read |
GET |
/notifications/:id |
Get notification details | notifications:read |
POST |
/notifications/:id/read |
Mark notification as read | notifications:write |
POST |
/notifications/read-all |
Mark all notifications as read | notifications:write |
Webhooks
| Method | Path | Description | Scope |
|---|---|---|---|
GET |
/webhooks |
List webhook endpoints | webhooks:read |
POST |
/webhooks |
Create a webhook | webhooks:write |
GET |
/webhooks/:id |
Get webhook details | webhooks:read |
PATCH |
/webhooks/:id |
Update a webhook | webhooks:write |
DELETE |
/webhooks/:id |
Delete a webhook | webhooks:write |
MCP Servers
| Method | Path | Description | Scope |
|---|---|---|---|
GET |
/mcp-servers |
List MCP server configs | mcp:read |
POST |
/mcp-servers |
Create an MCP server | mcp:write |
GET |
/mcp-servers/:id |
Get MCP server details | mcp:read |
PATCH |
/mcp-servers/:id |
Update an MCP server | mcp:write |
DELETE |
/mcp-servers/:id |
Delete an MCP server | mcp:write |
Credentials
| Method | Path | Description | Scope |
|---|---|---|---|
GET |
/credentials |
List credentials | credentials:read |
POST |
/credentials |
Create a credential | credentials:write |
GET |
/credentials/:id |
Get credential details | credentials:read |
POST |
/credentials/:id/revoke |
Revoke a credential | credentials:write |
Approvals (HITL)
| Method | Path | Description | Scope |
|---|---|---|---|
GET |
/approvals |
List pending approval requests | agents:read |
GET |
/approvals/:id |
Get approval request details | agents:read |
POST |
/approvals/:id/approve |
Approve a request (resumes agent) | agents:write |
POST |
/approvals/:id/reject |
Reject a request | agents:write |
Display Messages
| Method | Path | Description | Scope |
|---|---|---|---|
GET |
/agents/:agent_id/messages |
List display messages for an agent | agents:read |
GET |
/runs/:run_id/messages |
List display messages for a run | agents:read |
Audit Logs
| Method | Path | Description | Scope |
|---|---|---|---|
GET |
/audit-logs |
List audit log entries | audit_logs:read |
Other
| Method | Path | Description | Scope |
|---|---|---|---|
GET |
/connections |
List calendar connections | connections:read |
GET |
/usage |
Get usage statistics | usage:read |
Signals
A signal is an event that triggers an agent to run. You can send signals programmatically via the API to trigger agent execution on demand.
curl -X POST \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"type": "custom_event", "payload": {"key": "value"}}' \
https://your-domain.com/api/v1/agents/:id/signals
For a no-code alternative, use Inbound Webhooks to trigger agents from external services without writing code.
Example: List Agents
curl -H "Authorization: Bearer your-api-key" \
https://your-domain.com/api/v1/agents
Response:
{"data": [{"id": "abc123", "name": "Daily Weather", "type": "weather_check", "status": "idle", "schedule": "0 7 * * *"}]}
Example: Create Agent
curl -X POST \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"name": "NYC Weather", "type": "weather_check", "config": {"location": "New York"}}' \
https://your-domain.com/api/v1/agents
Rate Limiting
API requests are rate-limited per API key. Current limits are returned in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 97
X-RateLimit-Reset: 1709654400
If you exceed the limit, you'll receive a 429 Too Many Requests
response. Wait until the reset time before retrying.
MCP Server
AgentPlatform exposes a Model Context Protocol (MCP)
server at /mcp.
External MCP clients like Claude Desktop or Cursor can connect to use your
platform tools (calendar, email, weather) directly.
Create an API key with the mcp:tools
scope in Settings → API Keys, then configure your MCP client:
URL: https://your-domain.com/mcp
Authorization: Bearer your-mcp-api-key
You can also connect external MCP servers to give your agents additional tools. Configure them in Settings → MCP Servers .