Cancel Position Instruction
PositionCancelPositionInstructionResponse v1().positions().cancelPositionInstruction(PositionCancelPositionInstructionParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
DELETE/v1/accounts/{account_id}/positions/instructions/{instruction_id}
Cancel an outstanding position instruction by its server-assigned id.
Returns the updated instruction with status CANCEL_REQUESTED. The
terminal CANCELLED or CANCEL_FAILED state arrives asynchronously and
is observable via subsequent GETs.
Cancel Position Instruction
package com.clear_street.api.example;
import com.clear_street.api.client.ClearStreetClient;
import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionParams;
import com.clear_street.api.models.v1.positions.PositionCancelPositionInstructionResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
ClearStreetClient client = ClearStreetOkHttpClient.builder()
.fromEnv()
.apiKey("My API Key")
.build();
PositionCancelPositionInstructionParams params = PositionCancelPositionInstructionParams.builder()
.accountId(0L)
.instructionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
.build();
PositionCancelPositionInstructionResponse response = client.v1().positions().cancelPositionInstruction(params);
}
}{
"metadata": {
"request_id": "request_id",
"next_page_token": "U3RhaW5sZXNzIHJvY2tz",
"page_number": 0,
"previous_page_token": "U3RhaW5sZXNzIHJvY2tz",
"total_items": 0,
"total_pages": 0
},
"error": {
"code": 400,
"message": "Order quantity must be greater than zero",
"details": [
{
"foo": "bar"
}
]
},
"data": {
"id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
"account_id": 122503,
"instruction_id": "ui-20260424-001",
"instruction_type": "EXERCISE",
"instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
"quantity": "1",
"status": "SENT",
"symbol": "AAPL 280121C00195000",
"accepted_quantity": null,
"created_at": "2026-04-24T14:30:00Z",
"rejection_reason": null,
"updated_at": "2026-04-24T14:30:00Z"
}
}Returns Examples
{
"metadata": {
"request_id": "request_id",
"next_page_token": "U3RhaW5sZXNzIHJvY2tz",
"page_number": 0,
"previous_page_token": "U3RhaW5sZXNzIHJvY2tz",
"total_items": 0,
"total_pages": 0
},
"error": {
"code": 400,
"message": "Order quantity must be greater than zero",
"details": [
{
"foo": "bar"
}
]
},
"data": {
"id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
"account_id": 122503,
"instruction_id": "ui-20260424-001",
"instruction_type": "EXERCISE",
"instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
"quantity": "1",
"status": "SENT",
"symbol": "AAPL 280121C00195000",
"accepted_quantity": null,
"created_at": "2026-04-24T14:30:00Z",
"rejection_reason": null,
"updated_at": "2026-04-24T14:30:00Z"
}
}