Update an instance's document
Stages a new config document for the instance (algos:manage), legal in every state but DELETED — while it runs too. If-Match is the instance’s configSeq (absent or * is unconditional; stale is 412 with currentVersion). Answers 200 with the staged document; the engine’s verdict is a later state, read on its documents. One document awaits a verdict at a time (409 CONFIG_PENDING).
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Path parameters
The instance's id — a positive 32-bit integer the platform minted; the value an algo's orders carry as algoInstanceId.
Headers
Required on every write: a URL-safe string of 1 to 64 characters from [A-Za-z0-9._~-] (a UUID fits), scoped to you. It names one operation on one record, ever: a retry replays the stored outcome (Idempotent-Replay: true) or attaches to the live one, and reuse on another record refuses 409 IDEMPOTENCY_KEY_REUSED. Missing or malformed, 400.
The ETag the read minted, quoted or bare; absent or * is unconditional; a weak validator refuses 400 INVALID_IF_MATCH. A stale value answers 412 VERSION_CONFLICT with currentVersion and a fresh ETag: re-read, reapply, retry. Send it — every write restates the whole record, so an unconditional write overwrites every field from your copy, and an amend against a pending proposal replaces that proposal.
Request
Why — required on every change, at most 256 bytes of UTF-8.
The new config document: JSON with comments, one object the version's params schema types whole, each reference an id or, through the trading gateway, a name the gateway replaces with its id before the command is sent, as on the create; at most 6144 bytes of UTF-8 as written and as sent, and its distinct references at most 1280 bytes, 4 an account and 8 an instrument.
The configSeq this write was computed against; 0 = unconditional. A mismatch is refused with the current configSeq in the detail.
The command's idempotency key, 1 to 64 characters of letters, digits, dot, underscore, tilde and hyphen; a replay restates the earlier answer.
Response
The document as staged — STAGED; the engine's verdict is a later change, read on GET /algos/instances/{id}/configs/{seq} — with the answering change's position and, on a replayed key, Idempotent-Replay. No ETag: a document carries no version.
Every account the document references, once each, ascending — the accounts the instance may trade.
The write's Idempotency-Key, as sent.
The document's sequence number on its instance: 1 for the document the instance was created with, one more for every accepted write.
The engine's reason where it refused the document; empty otherwise.
The document as authored, comments included — at most 6144 bytes of UTF-8.
The position as a decimal string — the last change this member had applied, orders, balance readings and algo instances included.
Every instrument the document references, once each, ascending — 64-bit ids as decimal strings.
STAGED until the engine answers, then APPLIED or REFUSED; PENDING_APPROVAL is reserved and never served today. The value set is append-only: read an unknown name as UNKNOWN.
When it was submitted — epoch nanoseconds as a decimal string.
When the engine's verdict landed — epoch nanoseconds as a decimal string; null while staged.
Reserved; always null.
Never present since 0.3.3: every money value on this API states its own scale on the wire — a policy amount or cap since 0.3.3, an order's and an execution's since 0.3.2, a balance's since 0.3.1 — so a row is never served raw, whether or not this member holds the asset or instrument it references. Kept, deprecated, so a client generated from 0.3.2 still compiles; it goes at the next major.