Agents API
Auto-generated from
openapi-snapshot.json. Do not edit by hand — changes are overwritten byscripts/docs/generate_api_reference.py.
7 endpoints in this group.
GET /api/agents
List Agents
List AI agents for a tenant.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_id | query | integer | optional | |
active_only | query | boolean | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
POST /api/agents
Create Agent
Create a new AI agent.
Request body: application/json
Responses
| Code | Description |
|---|---|
201 | Successful Response |
422 | Validation Error |
GET /api/agents/leaderboard
Agent Leaderboard
Compute win-rate and avg P&L per agent based on realized_trades linked through the signals they generated.
Falls back to signal confidence distribution if trade linkage is absent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_id | query | integer | optional | |
period_days | query | integer | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
DELETE /api/agents/{agent_id}
Delete Agent
Soft-delete an agent by flagging is_active=false. A hard delete is avoided
because agent_signals and strategies FK to ai_agents.id.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | integer | required | |
tenant_id | query | integer | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
PATCH /api/agents/{agent_id}
Update Agent
Generic agent update. Only fields provided in the body are applied. Returns the full updated agent row. 404 if agent doesn’t exist for tenant.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | integer | required |
Request body: application/json
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
PATCH /api/agents/{agent_id}/toggle
Toggle Agent
Toggle agent active/inactive.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | integer | required | |
tenant_id | query | integer | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |
GET /api/agents/{agent_id}/track-record
Agent Track Record
Return signal history + outcome data for a specific agent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
agent_id | path | integer | required | |
tenant_id | query | integer | optional | |
account_id | query | — | optional | |
limit | query | integer | optional |
Responses
| Code | Description |
|---|---|
200 | Successful Response |
422 | Validation Error |