Skip to navigation

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

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

idintegerRequired

The instance's id — a positive 32-bit integer the platform minted; the value an algo's orders carry as algoInstanceId.

Headers

Idempotency-KeystringRequired

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.

If-MatchstringOptional

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

This endpoint expects an object.
remarkstringRequired

Why — required on every change, at most 256 bytes of UTF-8.

documentstringRequired

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.

instanceIdintegerOptional
The instance whose document changes.
expectedConfigSeqinteger or nullOptional

The configSeq this write was computed against; 0 = unconditional. A mismatch is refused with the current configSeq in the detail.

commandKeystringOptional

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.

accountIdslist of integers

Every account the document references, once each, ascending — the accounts the instance may trade.

commandKeystring

The write's Idempotency-Key, as sent.

configSeqinteger

The document's sequence number on its instance: 1 for the document the instance was created with, one more for every accepted write.

detailstring

The engine's reason where it refused the document; empty otherwise.

documentstring

The document as authored, comments included — at most 6144 bytes of UTF-8.

globalSequencestringformat: "^[0-9]+$"

The position as a decimal string — the last change this member had applied, orders, balance readings and algo instances included.

instanceIdinteger
The instance the document belongs to.
instrumentIdslist of strings

Every instrument the document references, once each, ascending — 64-bit ids as decimal strings.

orgIdinteger
The organisation that owns the instance.
outcomeenum

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.

Allowed values:
remarkstring
The submitter's remark.
submittedAtNsstringformat: "^-?[0-9]+$"

When it was submitted — epoch nanoseconds as a decimal string.

outcomeAtNsstring or nullOptionalformat: "^-?[0-9]+$"

When the engine's verdict landed — epoch nanoseconds as a decimal string; null while staged.

pendingByUserIdinteger or nullOptional

Reserved; always null.

userIdinteger or nullOptional
The user who submitted it.
unscaledbooleanOptionalDeprecated

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.

Errors

400
Update Instance Config Algos Request Bad Request Error
401
Update Instance Config Algos Request Unauthorized Error
403
Update Instance Config Algos Request Forbidden Error
404
Update Instance Config Algos Request Not Found Error
409
Update Instance Config Algos Request Conflict Error
412
Update Instance Config Algos Request Precondition Failed Error
413
Update Instance Config Algos Request Content Too Large Error
422
Update Instance Config Algos Request Unprocessable Entity Error
429
Update Instance Config Algos Request Too Many Requests Error
500
Update Instance Config Algos Request Internal Server Error
503
Update Instance Config Algos Request Service Unavailable Error