Time Machine — bulk revert accounts to a trading day or an instant
Time Machine, org-wide: the same operation as the single-account revert, applied to many accounts in one call — built for exchange/platform outages.
Who — exactly one of:
accountIds(max 1000) — a targeted revert;allAccounts: true— every account in your organization with activity after the restore point;audience: { from, to, condition }— the accounts an outage window actually touched:traded(any fill in the window),loss(net realized P&L in the window below zero),failed(the account failed inside the window), orfailed_or_loss. Everyone else is left alone.
To when — tradingDay (end-of-day state of that Chicago trading day) or revertTo (exact state at an instant; see the single-account endpoint for how it is reconstructed). With an audience and neither given, the accounts go back to audience.from — the point at which the issues began.
Each account is processed independently: the response lists per-account results and per-account failures (one bad account never aborts the batch — per-account error codes match the single-account endpoint). All changes share one batchId in the audit trail, and the batch records the restore point and the audience that selected it.
Example — an outage at the NY open (09:30–10:00 ET on 8 Sep 2026) failed some accounts and cost others money; put exactly those accounts back to 09:30:
{
"audience": { "from": "2026-09-08T13:30:00Z", "to": "2026-09-08T14:00:00Z", "condition": "failed_or_loss" },
"reason": "Feed outage at the NY open, 8 Sep",
"preview": true
}
Undoable. The returned batchId is a Time Machine ledger entry (GET /revert-batches). If the batch was a mistake, POST /revert-batches/{batchId}/undo restores every account in it to its pre-revert state in one call — accounts with new trader activity since the revert are skipped and reported individually.
Batch-level error codes:
| Code | Status | Meaning |
|---|---|---|
NO_ACCOUNTS | 400 | Nothing to revert (empty accountIds, or allAccounts found no affected accounts). An empty audience is NOT an error: 200 with reverted: 0 |
TOO_MANY_ACCOUNTS | 400 | More than 1000 accounts in one call — split into batches |
AMBIGUOUS_TARGET | 400 | Not exactly one of accountIds / allAccounts / audience |
INVALID_AUDIENCE_WINDOW | 400 | audience.from is not before audience.to, or not timestamps |
INVALID_REVERT_POINT | 400 | Both tradingDay and revertTo, revertTo not a timestamp, or in the future |
AUDIENCE_ERROR | 500 | Could not read the activity needed to resolve the audience — retry |
Recommended flow: run with "preview": true first — you get the full per-account impact report (balances restored, accounts revived, orders voided) with zero changes — then execute.
Example — preview an org-wide revert, then execute:
# 1. Dry run
curl -X POST ".../v1/organization/accounts/revert-trading-day" \
-H "X-API-Key: hp_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "tradingDay": "2026-07-07", "allAccounts": true, "reason": "CME data feed outage on 2026-07-08", "preview": true }'
# 2. Execute
curl -X POST ".../v1/organization/accounts/revert-trading-day" \
-H "X-API-Key: hp_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "tradingDay": "2026-07-07", "allAccounts": true, "reason": "CME data feed outage on 2026-07-08" }'
Authorizations
JWT Bearer token for user session auth. Format: "Bearer {token}". Used by User and Organization endpoints.
Body
Why — audit trail, account metadata, webhooks
3"CME data feed outage on 2026-07-08"
END-OF-DAY restore: Chicago trading day (YYYY-MM-DD) to revert TO. One of tradingDay / revertTo; with an audience and neither given, the accounts are restored to audience.from.
^\d{4}-\d{2}-\d{2}$"2026-07-07"
POINT-IN-TIME restore: the exact instant (ISO 8601, UTC) every targeted account is restored to — typically the moment the outage began. See the single-account endpoint for how the state at an instant is reconstructed.
"2026-09-08T13:30:00Z"
Specific accounts to revert (max 1000 per call)
1 - 1000 elementsRevert every account in the organization with activity after the restore point (later trades or snapshots) — including accounts created during the outage day itself. Untouched accounts are skipped.
true Target the accounts an outage window actually touched, instead of naming them. Only non-voided activity counts. The response reports how many matched; an empty audience returns 200 with reverted: 0 (nothing to do is not an error).
Dry run: per-account report of what WOULD happen, nothing changed. Use it to build the confirmation screen before an org-wide revert.
true
Related topics
Time Machine — revert an account to a trading day or an instantTime Machine — list revert batchesTime Machine — inspect a revert batchChangelogTime Machine — undo a revert batch