Time Machine — undo a revert batch
The undo button. Puts every account in a revert batch back exactly where it was the moment before the revert ran: pre-revert balance, status, high-water mark and daily baseline are restored from the ledger, and every snapshot and order the batch voided is un-voided — the trader’s journal, order history, and daily stats come back like the revert never happened. Open terminals update live.
A revert destroys nothing (rows are stamped, not deleted), which is what makes this possible.
Per-account rules (each account is checked independently — eligible ones proceed, blocked ones come back in failures):
| Code | Meaning |
|---|---|
NEW_ACTIVITY | The trader placed orders after the revert, or a market close recorded a day with real activity since. The old timeline can’t be restored over a new one — this account stays as-is. |
NOT_LATEST_REVERT | A newer revert covers this account. Reverts undo newest-first, like a stack — undo the newer batch first. |
UNDO_UPDATE_ERROR | Failed to write the restored state — retry (idempotent). |
Batch-level error codes:
| Code | Status | Meaning |
|---|---|---|
BATCH_NOT_FOUND | 404 | Unknown batch id (or it belongs to a different organization) |
ALREADY_UNDONE | 409 | Every account in this batch has already been undone |
Timing: the undo window stays open as long as the account has no new activity — minutes or days later both work. In practice: if you realize the mistake before traders resume trading, everything restores; accounts that already traded again are individually skipped and reported.
Recommended flow: "preview": true first — you get the exact per-account restore report plus who would be blocked and why — then execute.
Example — preview, then undo:
# 1. Dry run — nothing changes
curl -X POST ".../v1/organization/revert-batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890/undo" \
-H "X-API-Key: hp_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "preview": true }'
# 2. Execute
curl -X POST ".../v1/organization/revert-batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890/undo" \
-H "X-API-Key: hp_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{ "reason": "Reverted the wrong day — restoring" }'
Authorizations
JWT Bearer token for user session auth. Format: "Bearer {token}". Used by User and Organization endpoints.
Path Parameters
Batch id returned by the revert call
Body
Why the undo happened — stored in the audit trail and webhook events. Defaults to a generated message.
3"Reverted the wrong day — restoring"
Dry run: per-account report of what the undo WOULD restore (and which accounts are blocked), nothing changed.
true
Related topics
Time Machine — list revert batchesTime Machine — inspect a revert batchTime Machine — bulk revert accounts to a trading dayTime Machine — revert an account to a trading dayChangelog