Skip to main content
PATCH
Update a stack
Updates a stack owned by the manager identified by your API key. Every accepted update creates a new complete revision.
Try it saves a real update to staging. Every accepted update creates a revision. Use a stack ID from your own account.
Omitted fields retain their values from the current saved revision. A supplied allocation replaces the entire target list. Omitting a token from that supplied list removes its allocation. The replacement still needs weights totaling 10000. An empty object is invalid. Unknown fields and null field values are invalid.

Response

200 OK returns the complete stack response with the new current_revision_id. The response includes the new quoted revision ID in ETag. It also includes X-Request-Id. The saved configuration is visible immediately. An update does not trigger an immediate trade. See schedules for preset meanings and the planned execution contract.

Revisions and concurrent updates

Every successfully saved update creates a revision. This includes an update that repeats the current values. Concurrent updates are saved in sequence. For each supplied field, the last successfully saved value wins. A delayed older request can overwrite a newer request that was saved first. Omitted fields are copied from the current configuration when the update is saved. Neither If-Match nor Idempotency-Key is required or enforced for this endpoint. Sending them does not protect against overwrites or deduplicate a retry.
A retried PATCH is a new update. If a response is lost, read the stack before deciding whether to send another update. Use one ordered stream of updates per stack when your client needs to preserve its intended order.

Errors

See shared errors for authentication, body size, and service failures.

Authorizations

Authorization
string
header
required

Enter the API key supplied by MyStacks. The playground adds the Authorization: Bearer prefix for you.

Headers

X-Request-Id
string

Optional request trace ID. A nonempty value is echoed in the response. Missing or empty values cause a UUID to be generated.

Path Parameters

id
string<uuid>
required

UUID of a stack owned by this manager. Missing or unowned stacks return 404. Invalid UUIDs return 400.

Body

application/json

Supply at least one of name, allocation, or schedule. Omitted fields retain their saved values. A supplied allocation replaces the full target list. Unknown fields and null values are invalid. The request body must not exceed 262144 bytes.

name
string

Must contain non-whitespace text and must not contain U+0000. Accepted names retain their exact whitespace. No separate name-length limit applies within the body size limit.

Minimum string length: 1
Pattern: ^(?![\s\S]*\u0000)[\s\S]*\S[\s\S]*$
Example:

"Example stack"

allocation
object[]

The complete target allocation. Weights must total exactly 10000. Duplicate token identities are rejected after lowercase normalization. When supplied in PATCH, this list replaces the full saved allocation. Omitted tokens are removed.

Required array length: 1 - 30 elements
Example:
schedule
object

Schedule configuration only. Saving a preset does not execute trades.

Example:

Response

Complete saved configuration with the new revision and ETag.

Current complete configuration. No subscriber, balance, performance, or execution data is included.

id
string<uuid>
required

Stable stack identifier.

Example:

"bf4bc5e9-0d9e-454c-bc1c-30abc120b074"

current_revision_id
string<uuid>
required

Identifier of this complete saved configuration revision.

Example:

"e137435f-83ce-4b3c-86ae-75d6462487b6"

name
string
required

Must contain non-whitespace text and must not contain U+0000. Accepted names retain their exact whitespace. No separate name-length limit applies within the body size limit.

Minimum string length: 1
Pattern: ^(?![\s\S]*\u0000)[\s\S]*\S[\s\S]*$
Example:

"Example stack"

allocation
object[]
required

Complete saved allocation. Addresses are lowercase, unique, and ordered by token address. Weights total exactly 10000.

Required array length: 1 - 30 elements
Example:
schedule
object
required

Schedule configuration only. Saving a preset does not execute trades.

Example: