Cancel a sandbox command
Stop a command that is running in a Runpod sandbox through the REST API. The response shows whether the command is stopping or already finished.
Authorizations
Runpod API key authentication. Generate an API key in the Runpod console and send it in the Authorization header as Bearer <api_key>. Keys are scoped to the permissions granted when created; requests may return 403 when a valid key lacks access to the requested resource or action.
Console sessions (Clerk JWTs) act for the signed-in user. To act for a team instead, also send X-Team-Id: <team_id>; it applies only when the user owns or belongs to that team, otherwise the request runs against the user's own account. API keys created inside a team already act for that team and do not need the header.
Path Parameters
Sandbox identifier
Command identifier
^[0-9A-Za-z-]{1,64}$Response
The command had already finished.
Command identifier, scoped to its sandbox.
"6f1c2b8e-3d4a-4f7b-9a0e-2c5d8e1f4a7b"
running is the only non-terminal status.
exited: the command ended on its own;exitCodeholds its code.cancelled: stopped byDELETE.timedOut: stopped attimeoutSeconds.failed: never started;errorsays why.unknown: the container went away while it ran, for example because the sandbox stopped. Read the outcome fromstatus, notexitCode.
running, exited, cancelled, timedOut, failed, unknown The command's exit code when status is exited; null otherwise.
0
Why the command failed to start or did not finish normally, if known.
Whether output lines are tagged as stdout or stderr. When
false, the logs streams filter is unavailable.
Bytes of output captured so far.
True once output passed 32 MiB. Further output is dropped; the command keeps running.
True once a cancel has been requested.