Stop a launch and release its spend reservation
curl --request POST \
--url https://useorgx.com/api/v1/launches/{launchId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"expected_aggregate_version": 2
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({expected_aggregate_version: 2})
};
fetch('https://useorgx.com/api/v1/launches/{launchId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://useorgx.com/api/v1/launches/{launchId}/cancel"
payload = { "expected_aggregate_version": 2 }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"launch_id": "1d2c3b4a-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"runs_cancelled": 1,
"jobs_cancelled": 1,
"reservation_released": 1,
"initiative_status_restored": true,
"aggregateVersion": 3,
"eventId": "9b8a7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
},
"meta": {
"apiVersion": "1",
"workspaceId": "5be1076d-8fd0-4c0f-847f-fd67fdb935e8"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docsUrl": "<string>",
"retryAfter": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docsUrl": "<string>",
"retryAfter": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docsUrl": "<string>",
"retryAfter": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docsUrl": "<string>",
"retryAfter": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docsUrl": "<string>",
"retryAfter": 123
}
}Launches
Stop a launch and release its spend reservation
The kill switch. In one call it releases the spend reservation, cancels the launch’s queued and running jobs and runs, and restores the initiative status this launch promoted — and reports each count separately so you can see what actually stopped.
Releasing the reservation is the part that matters most: until it is released the estimate keeps counting against your daily cap for the rest of the UTC day, whether or not the work ran.
Jobs already finished are left alone. Cancelling a launch that was already
cancelled returns 409.
POST
/
launches
/
{launchId}
/
cancel
Stop a launch and release its spend reservation
curl --request POST \
--url https://useorgx.com/api/v1/launches/{launchId}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"expected_aggregate_version": 2
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({expected_aggregate_version: 2})
};
fetch('https://useorgx.com/api/v1/launches/{launchId}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://useorgx.com/api/v1/launches/{launchId}/cancel"
payload = { "expected_aggregate_version": 2 }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"launch_id": "1d2c3b4a-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"runs_cancelled": 1,
"jobs_cancelled": 1,
"reservation_released": 1,
"initiative_status_restored": true,
"aggregateVersion": 3,
"eventId": "9b8a7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
},
"meta": {
"apiVersion": "1",
"workspaceId": "5be1076d-8fd0-4c0f-847f-fd67fdb935e8"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docsUrl": "<string>",
"retryAfter": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docsUrl": "<string>",
"retryAfter": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docsUrl": "<string>",
"retryAfter": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docsUrl": "<string>",
"retryAfter": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {},
"requestId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"docsUrl": "<string>",
"retryAfter": 123
}
}Authorizations
bearerAuthcookieAuth
OrgX API key, sent as Authorization: Bearer oxk_...
Headers
Workspace-scoped retry key for safe mutation replay.
Required string length:
1 - 200Pattern:
^[A-Za-z0-9][A-Za-z0-9._:/-]{0,199}$Path Parameters
Launch to cancel
Body
application/json
