curl -X POST https://api.crewship.dev/v1/runs/run_xyz789abc/cancel \
-H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"status": "canceled"
}
{
"error": {
"code": "bad_request",
"message": "Cannot cancel run with status: succeeded"
}
}
Runs
Cancel Run
Cancel a running or pending run
POST
/
v1
/
runs
/
{id}
/
cancel
curl -X POST https://api.crewship.dev/v1/runs/run_xyz789abc/cancel \
-H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"status": "canceled"
}
{
"error": {
"code": "bad_request",
"message": "Cannot cancel run with status: succeeded"
}
}
Path Parameters
string
required
Run ID (e.g.,
run_xyz789abc)Response
boolean
Whether the cancellation was successful
string
The updated run status (
canceled)curl -X POST https://api.crewship.dev/v1/runs/run_xyz789abc/cancel \
-H "Authorization: Bearer YOUR_API_KEY"
{
"success": true,
"status": "canceled"
}
{
"error": {
"code": "bad_request",
"message": "Cannot cancel run with status: succeeded"
}
}
Notes
- Only runs with status
pendingorrunningcan be canceled - Canceling a run stops execution and destroys the underlying machine
- The run status will be set to
canceledwith acompleted_attimestamp