Skip to main content
POST
Create a stack
Creates a stack owned by the manager identified by your API key. The stack is published immediately. There is no separate draft or publish step.
Try it sends a real request to staging. Creation immediately publishes a stack. Enter a new Idempotency-Key for each intended new stack.

Idempotency

Idempotency-Key must contain non-whitespace text. Keys are scoped to your manager account and stack creation. Accepted keys do not expire automatically. A retry with the same key and equivalent original input returns the same stack ID. It returns that stack’s current configuration and ETag. If the stack has been updated, this can differ from the first creation response. The retry does not revert changes or create a revision. The following differences do not change creation input identity:
  • JSON whitespace and object-field order.
  • Allocation-entry order.
  • Token-address capitalization that still passes address validation.
The exact name, token identities, integer weights, and schedule preset must match. Changing any of them under the same key returns 409 conflict. Use update a stack to change an existing stack. When matching requests arrive together, the first successfully saved creation establishes the result. There is no fixed application limit on key length. A key that exceeds supported storage size returns 400 invalid_request without creating a stack. A UUID is a practical creation key.

Errors

Shared errors cover authentication, body size, and service failures. After an uncertain creation result, retry with the same key and original input.

Authorizations

Authorization
string
header
required

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

Headers

Idempotency-Key
string
required

Required for creation. Must contain non-whitespace text. Reuse the exact same manager-scoped key and original input after an uncertain result. Keys do not expire automatically. No fixed application length cap applies. A key beyond the database receipt index storage limit returns 400 and rolls back the complete creation.

Minimum string length: 1
Pattern: \S
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.

Body

application/json

Complete stack configuration. Unknown fields are rejected in the body and nested objects. The request body must not exceed 262144 bytes.

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

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
required

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

Example:

Response

Identical creation retry. Returns the original stack ID with its current complete configuration and revision.

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: