curl -X POST https://agentgate.mynewapi.com/v1/runs/run_abc123/cancel \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "run_abc123",
"status": "cancelled",
"cancelledAt": "2024-01-15T10:32:00Z"
}
{
"error": {
"code": "INVALID_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://agentgate.mynewapi.com/v1/runs/run_abc123/cancel \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "run_abc123",
"status": "cancelled",
"cancelledAt": "2024-01-15T10:32:00Z"
}
{
"error": {
"code": "INVALID_REQUEST",
"message": "Cannot cancel run with status 'succeeded'"
}
}
string
required
Run ID to cancel (format:
run_xxxxx).string
Run identifier.
string
New status (will be
cancelled).string
ISO 8601 timestamp of cancellation.
Only runs in
pending or running status can be cancelled.curl -X POST https://agentgate.mynewapi.com/v1/runs/run_abc123/cancel \
-H "Authorization: Bearer YOUR_API_KEY"
{
"id": "run_abc123",
"status": "cancelled",
"cancelledAt": "2024-01-15T10:32:00Z"
}
{
"error": {
"code": "INVALID_REQUEST",
"message": "Cannot cancel run with status 'succeeded'"
}
}