Skip to main content
POST
Durably admit a trading command
Preview contract. Production availability remains subject to activation and release qualification. Examples are synthetic; the documentation cannot submit requests.

Authorization

positions:open, positions:modify or positions:terminate, selected by the action.

Behavior

A new intent returns 202 with a durable receipt; an identical retry returns 200 with the original receipt. OPEN allocates one position UUID; MODIFY requires a fresh expected_revision; TERMINATE omits request. Reusing an identity with different intent conflicts. Acceptance does not certify a fill or flatness.

JSON body example

The following shows the request shape, not live credentials or executable market defaults. Replace timestamps only when creating a new reviewed intent; never mutate them on a command retry.

Response and errors

The generated response schema below is the wire contract. Preserve fixed-point strings, nullable fields and endpoint-specific envelopes. Inspect HTTP status and Content-Type before decoding failures; reused trading routes may return JSON or plain text. Authentication, entitlement and exact link/instrument restrictions apply in addition to endpoint validation. See errors and recovery. Do not automatically repeat a mutation after transport ambiguity. Trading commands reuse the exact immutable identity; credential issuance and template writes require their documented metadata/read reconciliation. Read the related guide for lifecycle, units and recovery semantics.

Authorizations

Authorization
string
header
required

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

Body

application/json

Immutable namespace+client ID; lifespan <=300s. Open omits position_id; modify/terminate require it. Modify requires expected_revision; terminate omits request. Open/modify require request. Identical retries return original receipt, changed payload is 409.

client_command_id
string
required

Unique immutable namespace event identity; liftx-group: prefix is reserved.

Required string length: 1 - 128
issued_at
integer<int64>
required
expires_at
integer<int64>
required
action
enum<string>
required
Available options:
open,
modify,
terminate
Required range: 1 <= x <= 9007199254740991
instrument_id
string
required
position_id
string<uuid>
expected_revision
integer
Required range: x >= 1
request
object

Existing PositionRequest codec, also used by advanced TradingView. Paired row arrays must have equal lengths. Adapter batch limits and 256 KiB command body apply below the post-decode row ceiling. Creation and enabled protections require their operational fields. API modify requires outer expected_revision and fresh exact slot/order identities. TV modify must preserve OPEN rows. See position-request.md for all fields and units.

target
string

Optional explicit exact-position target; group selectors are TradingView-only.

Allowed value: "position"

Response

Identical existing command

Durable command receipt, never a fill/completion assertion. Terminal request fields correlate a durable termination owner handoff. Terminal arm writes kind/sequence while retaining dispatching; owner return or startup canonical evidence advances handed_off. Group parent position_id is null. Precedence is operator_required, dispatching, accepted, then homogeneous resolved state or partial. Zero-target parent is execution_observed. Counts and child states do not prove exposure is flat.

id
string<uuid>
required
client_command_id
string
required
action
string
required
state
enum<string>
required
Available options:
accepted,
dispatching,
handed_off,
execution_observed,
rejected,
expired,
operator_required,
partial
position_id
string<uuid> | null
required
error_code
string | null
required
created_at
integer<int64>
required
updated_at
integer<int64>
required
terminal_request_kind
enum<integer>
Available options:
1,
2
terminal_request_seq
integer<int64>
Required range: x >= 1
group_id
string<uuid>

Parent group on a child termination receipt.

group
object

Counts sum to the immutable target_count. Zero targets records an observed empty selection, not market flatness.

targets
object[]

Group detail only: at most 64 frozen ordinary termination receipts. Targets cannot contain nested groups or target arrays. Omitted on list responses and zero-target groups.

Maximum array length: 64