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 (required: absent is 428, * unconditional; stale is 412 with currentVersion). Answers 200 with the staged document; the engine’s verdict lands later 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-MatchstringRequired

Required on every entity write: the ETag the read minted, quoted or bare — the version this write was computed against — or * to write unconditionally on purpose. Absent is refused 428 PRECONDITION_REQUIRED; a weak validator 400 INVALID_IF_MATCH; a stale value 412 VERSION_CONFLICT (CONFIG_SEQ_CONFLICT on an algo’s config write) with currentVersion and a fresh ETag: re-read, reapply, retry. Every write restates the whole record: a * write overwrites every field from your copy, a colleague’s amend since your read included. State the version unless you mean the overwrite.

X-Request-IdstringOptional

Your own id for the request: 8 to 128 of [A-Za-z0-9._-]. It becomes the request’s id and is echoed on the response. A value off that grammar is replaced with a fresh id, never refused.

Query parameters

minGlobalSequencestringOptionalformat: "^[0-9]{1,19}$"

A position you hold — an X-Immix-Global-Sequence you read, or a 202’s commandGlobalSequence: this member answers only once it has folded the platform’s stream through it, waiting up to its deadline, then 503 PROJECTION_BEHIND with Retry-After. Within that stream a read is never older than what you have seen; drop your positions after an announced stream cut. A retry stating its 202’s position attaches to or replays that operation while the journal holds its key, never publishing twice. Stated once: one to nineteen digits, at most 9223372036854775807; else 400 MALFORMED_REQUEST.

Request

This endpoint expects an object.
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.

remarkstringOptional

Why — at most 256 bytes of UTF-8; empty when none is given. Optional in this body: absent or null reads as "" — no remark.

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; empty when none was given.

submittedAtNsstringformat: "^-?[0-9]+$"

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

actorobjectOptional

Who submitted it — a member or an API key.

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.

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
428
Update Instance Config Algos Request Precondition 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