Backtests
Historical simulation.
Credentials
sessionStorage) and are sent only to https://api.indexone.io. They are cleared when the tab closes.Historical simulation of an index definition. Launched with POST /simulate and polled with GET /backtests/{backtest_id}.
Poll a backtest
/backtests/{backtest_id}Fetch a persisted backtest by id: a performance summary (point and holdings counts, start/end value, cumulative return) and, with ?include_series=true, the value series — evenly downsampled to max_points (default 500). When the backtest was run as part of a deploy, deployed_index_id carries the live index it produced. Waits server-side for the in-flight window, so polling straight after POST /simulate is fine. This is the REST twin of the MCP get_backtest tool — both call the same shared service.
Path parameters
| Field | Type | Description |
|---|---|---|
backtest_idrequired | string | Backtest id returned by POST /simulate (or the backtest_id from POST /workflows). |
Query parameters
| Field | Type | Description |
|---|---|---|
include_series | boolean | Include the value series in the response (downsampled). Defaults to false. |
max_points | integer | Cap on returned series points when include_series=true (default 500, max 2000). Defaults to 500. |
curl -X GET "https://api.indexone.io/backtests/bkt_9Fq2LmVt41Xe" \-H "x-api-key: YOUR_API_KEY"
Try it
Backtest id returned by `POST /simulate` (or the `backtest_id` from `POST /workflows`).
Include the value series in the response (downsampled).
Cap on returned series points when `include_series=true` (default 500, max 2000).
Example response
{"ok": true,"status": "completed","backtest_id": "bkt_9Fq2LmVt41Xe","created_at": "2026-07-22 09:14:02","name": "US Momentum 50","values_count": 1633,"holdings_events": 26,"start": {"time": "2020-01-02 21:00:00","value": 1000},"end": {"time": "2026-06-30 20:00:00","value": 1172.84},"cumulative_return": 0.17284,"deployed_index_id": null}
Errors
| Field | Type | Description |
|---|---|---|
400 | Error | backtest_id is not a bkt_... id. |
401 | Error | The API key is missing or invalid ( invalid_api_key). |
403 | Error | The backtest is owned by another team. |
429 | object | API key usage-plan rate limit exceeded. |
Start an async backtest of a workflow
/workflows/{workflow_id}/backtestPLANNED — this route does not exist. Today a workflow-plane backtest goes through POST /simulate, which is capped by the 29-second API Gateway integration timeout and therefore requires a WebSocket connection for any realistic run.
The intent is to replace that with a normal async job: POST starts the run and returns a bkt_... id immediately, and the caller polls GET /backtests/{backtest_id} until it completes — no WebSocket, no timeout ceiling. This is how the MCP run_backtest tool already behaves.
Unlike POST /simulate this takes a saved workflow id rather than an inline definition, so the backtested definition is exactly what is stored.
Path parameters
| Field | Type | Description |
|---|---|---|
workflow_idrequired | string | Workflow id to backtest. |
Request body
| Field | Type | Description |
|---|---|---|
start_time | string | Override the workflow's own start time. |
end_time | string | Stop the simulation early. |
curl -X POST "https://api.indexone.io/workflows/idx_bh7fgXWJMaa3/backtest" \-H "x-api-key: YOUR_API_KEY" \-H "Authorization: YOUR_ID_TOKEN" \-H "Content-Type: application/json" \-d '{"start_time": "2022-01-03 00:00:00","end_time": "2026-06-30 00:00:00"}'
Errors
| Field | Type | Description |
|---|---|---|
400 | object | Intended: the workflow's DAG failed validation. |
401 | Error | The API key is missing or invalid ( invalid_api_key) or the id token is missing, invalid or expired (unauthenticated). |
403 | object | Caller's teams do not own this workflow. |
404 | object | No such workflow. |
429 | object | API key usage-plan rate limit exceeded. |