Skip to main content
POST
Examples are illustrative; the documentation cannot submit requests.
Submit one immutable intent using a scoped API key. Liftx persists the intent before an existing trading owner executes it. A new command returns 202 Accepted; an identical retry returns 200 OK with the current receipt for the original command.

Headers and request rules

Use positions:open, positions:modify or positions:terminate for the corresponding action. Pro or an eligible trial is required. This endpoint accepts one JSON object up to 256 KiB, with exact case-sensitive field names and no duplicate or unknown keys. Compressed bodies are unsupported. Decimal coefficients are strings; do not convert money through binary floating-point. Omit TradingView-only fields (client_position_id, position_started_at, source_instance_id, sequence, binding_revision) from API commands. Optional inactive fields do not need placeholder values. request:null is not a TERMINATE request.

OPEN: limit entry with SL, SLx and TP

All examples on this page use a fictitious account link 17, illustrative UUIDs and 2030-01-01 UTC timestamps. BTC-USDT-SWAP illustrates an exact canonical catalog ID for a supported BTC/USDT linear perpetual; it is not a universal symbol alias. Assume the selected catalog permits the depicted order roles, cross margin, 2x leverage, price ticks and 0.001 BTC quantity. Resolve your own link and current catalog first. These values are not live quotes, minimum-size claims or trading recommendations.
This requests a long 0.001 BTC limit entry at 70,000 USDT, static SL at 68,600, price-trigger trailing SLx, and a full-position virtual-limit TP at 72,100. SLx activation, indent and step are percentage points times 1,000,000: 1%, 0.5% and 0.25%. TP weight 1000000 means one full TP; its zero quantity placeholder is sized by the existing protection owner from actual exposure. See OPEN for market/spot differences and catalog sizing.

New acceptance: HTTP 202

The current OPEN allocator uses the new command UUID as the position UUID, so these two fields match. Persist both returned fields instead of deriving one in client code. A position ID in an accepted receipt does not prove that the canonical position exists yet, that its order was placed or that it filled.

MODIFY: retain rows and adjust protection

The next request assumes a fresh publication with revision 7 and exactly the OPEN/TP rows and synthetic slot IDs shown below. It moves the static SL to 69,300, disables SLx and retains the OPEN and TP configuration. This is a complete request, not a patch. Do not reuse these assumed rows after fills or a manual change.
An accepted modification has its own receipt UUID and the existing position UUID:
Read modify positions before amending a physical order or removing a row. Omit unchanged leverage; asking to set it can cause exchange I/O before a later conflict is discovered.

TERMINATE: cancel pending work or close exposure

Do not send a position request, quantity or stale pending/open classification. The existing terminal owner reconciles fills, cancels pending work and closes remaining exposure as appropriate. A new acceptance is:
See termination outcomes for durable close/cancel receipts and the separate checks for completed closure.

Admission errors versus execution outcomes

These are errors from this HTTP submission, with the exact integration error envelope. HTTP 409 Conflict, if a known client ID is reused with changed intent:
HTTP 400 Bad Request, if API MODIFY omits the outer revision:
Other admission errors include INVALID_JSON (400), SCOPE_MISMATCH (400), SCOPE_DENIED (403), STALE_COMMAND (409), PENDING_CAPACITY (429), and ADMISSION_UNAVAILABLE (503). An acceptance commit whose result is unknown returns ACCEPTANCE_UNCERTAIN (503): retry the exact saved identity and payload, not a newly timestamped command. After 202, execution errors appear in the receipt, not in a second HTTP submission response. For example, an otherwise valid modification with no earlier effects can later be rejected with POSITION_REVISION_CONFLICT; uncertain side effects instead remain operator_required. A receipt GET still returns HTTP 200 for either state. See receipt states and recovery.

Submit a reviewed file

Create a current deadline only for a deliberately new intent. For a transport retry, retransmit the exact saved command. Identical known retries may return a later receipt state; they do not execute the mutation again. Use receipt detail for command progress and position state or the stream for trading outcomes.

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

Required. Immutable intent identity within one integration namespace, 1–256 UTF-8 bytes. Reuse unchanged for a retry; never for a new intent. Unique immutable namespace event identity; liftx-group: prefix is reserved.

Required string length: 1 - 256
issued_at
integer<int64>
required

Required. Integer UTC Unix seconds. Unseen identity must be within five minutes, allowing at most 30 seconds of future skew.

expires_at
integer<int64>
required

Required. Integer UTC Unix seconds after issued_at and at most 300 seconds later. An unseen expired intent cannot execute.

action
enum<string>
required

Required. Trading intent; see action-specific request and target requirements.

Available options:
open,
modify,
terminate

Required. Exact authorized linked account. Determines venue and environment; must match nested request when present.

Required range: 1 <= x <= 9007199254740991
instrument_id
string
required

Required. Exact opaque ID selected from that link catalog. Preserve case and bytes; must match nested request when present.

position_id
string<uuid>
required if action = modify or action = terminate

Conditional: required canonical position UUID for modify and terminate; forbidden for open, which allocates it once.

expected_revision
integer
required if action = modify

Conditional: required positive current revision for API modify. Omit for open/terminate; it is not a termination fence.

Required range: x >= 1
request
object
required if action = open or action = modify

Conditional: complete PositionRequest required for open and modify; forbidden for terminate.

target
string

Optional: only position is supported by the API. Group termination is TradingView-only. 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

Safe error reason, when available. A reason on operator_required does not prove absence of side effects or authorize replay; state remains authoritative for uncertainty.

created_at
integer<int64>
required
updated_at
integer<int64>
required
source
string

Source label on receipt reads, including group targets. API and TradingView derive from the integration kind; MCP uses the immutable OAuth-verified client name, such as ChatGPT or Claude. Initial command acknowledgments may omit this read metadata.

Maximum string length: 80
terminal_request_kind
enum<integer>
required if terminal_request_seq is set
Available options:
1,
2
terminal_request_seq
integer<int64>
required if terminal_request_kind is set
Required range: x >= 1
group_id
string<uuid>

Parent group on a child termination receipt.

group
object
required if targets is set

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