Skip to navigation

Create a portfolio

Creates a portfolio (portfolios:manage); portfolios have no maker-checker, so it is live at once. A name in use refuses 409 NAME_TAKEN.

Authentication

AuthorizationBearer

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

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.

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.
namestringRequired

At most 128 bytes; longer refuses INVALID_FIELD.

portfolioIdinteger or nullOptional

0 = create.

expectedVersionstring or nullOptionalformat: "^-?[0-9]+$"
int64 as a decimal JSON string

Response

The portfolio as the platform now holds it after the write — the same row the read serves, with the answering change’s position, the row’s ETag and, on a replayed key, Idempotent-Replay.

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

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

namestring

Natural key — per-org unique among live portfolios. At most 128 bytes; longer refuses INVALID_FIELD.

orgIdinteger

Owner-stamped.

portfolioIdinteger
Sticky entity key.
statusenum

UNKNOWN is the unset sentinel: outputs only — as input the field is required, and explicit UNKNOWN refuses 400. A consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict

Allowed values:
versionstringformat: "^-?[0-9]+$"

The row’s version: monotonic per record, bumped on every change — served as the ETag and taken by If-Match. int64 as a decimal JSON string

Errors

400
Create Portfolios Request Bad Request Error
401
Create Portfolios Request Unauthorized Error
403
Create Portfolios Request Forbidden Error
409
Create Portfolios Request Conflict Error
413
Create Portfolios Request Content Too Large Error
422
Create Portfolios Request Unprocessable Entity Error
429
Create Portfolios Request Too Many Requests Error
500
Create Portfolios Request Internal Server Error
503
Create Portfolios Request Service Unavailable Error