DocsAPI referenceBacktests

Backtests

Historical simulation.

Credentials

Credentials stay in this browser tab (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

GET
/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.

x-api-key

Path parameters

FieldTypeDescription
backtest_idrequiredstring
Backtest id returned by POST /simulate (or the backtest_id from POST /workflows).

Query parameters

FieldTypeDescription
include_seriesboolean
Include the value series in the response (downsampled). Defaults to false.
max_pointsinteger
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).

https://api.indexone.io/backtests/bkt_9Fq2LmVt41Xe?include_series=false&max_points=500

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

FieldTypeDescription
400Error
backtest_id is not a bkt_... id.
401Error
The API key is missing or invalid (invalid_api_key).
403Error
The backtest is owned by another team.
429object
API key usage-plan rate limit exceeded.

Start an async backtest of a workflow

Planned
POST
/workflows/{workflow_id}/backtest

PLANNED — 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.

x-api-key
Authorization: id token

Path parameters

FieldTypeDescription
workflow_idrequiredstring
Workflow id to backtest.

Request body

FieldTypeDescription
start_timestring
Override the workflow's own start time.
end_timestring
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

FieldTypeDescription
400object
Intended: the workflow's DAG failed validation.
401Error
The API key is missing or invalid (invalid_api_key) or the id token is missing, invalid or expired (unauthenticated).
403object
Caller's teams do not own this workflow.
404object
No such workflow.
429object
API key usage-plan rate limit exceeded.