Skip to content
Start Trading

Submit Position Instructions

$ clst v1:positions submit-position-instructions
POST/v1/accounts/{account_id}/positions/instructions

Submit one or more position instructions (Exercise, Do-Not-Exercise, Contrary Exercise Advice) against the account.

Batch semantics:

  • All rows accepted → 200 OK. Every row is in data with status = SENT.
  • Partial success → 207 Multi-Status. data contains every row; rejected rows carry status = REJECTED and rejection_reason. The top-level error summarizes the batch failure.
  • All rows rejected → 4xx/5xx. The HTTP status reflects the aggregate cause: 409 when every row was a duplicate, 400 for validation failures like DNE/CEA on a non-expiry day, 503 if the clearing service is unavailable. data still contains every row carrying status = REJECTED and rejection_reason so callers can attribute failures by client_instruction_id; the top-level error summarizes the batch.
ParametersExpand Collapse
--account-id: number

Account identifier

--instruction: array of object { instruction_type, instrument_id, quantity, client_instruction_id }
ReturnsExpand Collapse
V1PositionSubmitPositionInstructionsResponse: BaseResponse { metadata, error }
data: array of PositionInstruction { id, account_id, client_instruction_id, 11 more }
id: string

Server-assigned id. Used as the path parameter on cancel.

account_id: number

Account the instruction belongs to.

client_instruction_id: string

Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied.

instruction_type: "EXERCISE" or "DO_NOT_EXERCISE" or "CONTRARY_EXERCISE"

The action this instruction requests.

"EXERCISE"
"DO_NOT_EXERCISE"
"CONTRARY_EXERCISE"
instrument_id: string

Identifier of the options contract this instruction acts on.

quantity: string

Number of contracts included in the instruction.

status: "SENT" or "ACCEPTED" or "REJECTED" or 4 more

Current lifecycle status.

"SENT"
"ACCEPTED"
"REJECTED"
"CANCEL_REQUESTED"
"CANCELLED"
"CANCEL_FAILED"
"UNKNOWN"
symbol: string

Options symbol (OSI) for display.

accepted_quantity: optional string

Number of contracts accepted by the clearing venue. Populated once the instruction reaches ACCEPTED. When a null/undefined value is observed, it indicates that there is no available data.

created_at: optional string

When the instruction was first accepted by the service. When a null/undefined value is observed, it indicates that there is no available data.

rejection: optional object { description, domain, metadata, reason }

Machine-readable counterpart to rejection_reason: a stable reason code, human-readable description, and params, present on every rejected row — on submit, cancel, get, and list alike. Branch on rejection.reason and read rejection.description instead of the top-level rejection_reason. When a null/undefined value is observed, it indicates it does not apply.

description: string

Human-readable explanation of the rejection. Duplicates the top-level rejection_reason; prefer this field.

domain: string

Namespacing domain of the reason code — com.clearstreet.oems.exercise for reasons OEMS validates, com.clearstreet.oems.clearing for clearing-owned reasons.

metadata: map[string]

Reason-specific parameters as a string→string map. Which keys are present depends on reason:

  • INSUFFICIENT_POSITION → available, requested
  • DNE_NOT_ON_EXPIRY / CEA_NOT_ON_EXPIRY → expiry, business_date
  • EXERCISE_PAST_CUTOFF → cutoff_time
  • DUPLICATE_INSTRUCTION → existing_id

Empty for reasons that carry no parameters. New keys may be added over time, so treat unknown keys leniently.

reason: string

Stable, machine-readable reason code, e.g. DNE_NOT_ON_EXPIRY, INSUFFICIENT_POSITION, OPTIONS_LEVEL_EXCEEDED, EXERCISE_PAST_CUTOFF.

rejection_reason: optional string

Human-readable explanation populated on any non-success terminal status — REJECTED or CANCEL_FAILED. On a 207 Multi-Status batch submit the top-level error field summarizes the batch; per-row detail continues to live here. When a null/undefined value is observed, it indicates it does not apply.

underlying_instrument_id: optional string

Identifier of the underlying instrument, when available. When a null/undefined value is observed, it indicates it does not apply.

updated_at: optional string

When the instruction’s lifecycle state last changed. When a null/undefined value is observed, it indicates that there is no available data.

Submit Position Instructions

clst v1:positions submit-position-instructions \
  --api-key 'My API Key' \
  --account-id 0 \
  --instruction "{instruction_type: EXERCISE, instrument_id: 0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02, quantity: '1'}"
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "status": "SENT",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd01"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "status": "SENT",
      "symbol": "AAPL  280121C00195000"
    },
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e03",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "Duplicate exercise instruction",
      "status": "REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 409,
    "message": "Duplicate exercise instruction"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd02"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e04",
      "instruction_type": "DO_NOT_EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "DO_NOT_EXERCISE must be submitted on the contract's expiration date",
      "status": "REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 400,
    "message": "DO_NOT_EXERCISE must be submitted on the contract's expiration date"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd03"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e05",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "Duplicate exercise instruction; existing_id=019e7415-de03-70c3-8ca1-9fdb72dfdbbc",
      "status": "REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 409,
    "message": "Duplicate exercise instruction"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd04"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e06",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "Could not process the instruction",
      "status": "REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 500,
    "message": "Could not process the instruction"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd05"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e07",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "Clearing service unavailable",
      "status": "REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 503,
    "message": "Clearing service unavailable"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd06"
  }
}
Returns Examples
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "status": "SENT",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd01"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "status": "SENT",
      "symbol": "AAPL  280121C00195000"
    },
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e03",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "Duplicate exercise instruction",
      "status": "REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 409,
    "message": "Duplicate exercise instruction"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd02"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e04",
      "instruction_type": "DO_NOT_EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "DO_NOT_EXERCISE must be submitted on the contract's expiration date",
      "status": "REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 400,
    "message": "DO_NOT_EXERCISE must be submitted on the contract's expiration date"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd03"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e05",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "Duplicate exercise instruction; existing_id=019e7415-de03-70c3-8ca1-9fdb72dfdbbc",
      "status": "REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 409,
    "message": "Duplicate exercise instruction"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd04"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e06",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "Could not process the instruction",
      "status": "REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 500,
    "message": "Could not process the instruction"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd05"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "client_instruction_id": "ui-20260424-001",
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e07",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "Clearing service unavailable",
      "status": "REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 503,
    "message": "Clearing service unavailable"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd06"
  }
}