v13

OpenAPI 3.0.32026-07-31359869.4 MB
sandboxes

Kill a command

Sends a signal to terminate a running command in a session. The signal can be used to gracefully stop (SIGTERM) or forcefully kill (SIGKILL) the process. The command must still be running for this operation to succeed.

post/v2/sandboxes/sessions/{sessionId}/cmd/{cmdId}/kill

Path parameters

cmdIdstring required

The unique identifier of the command to terminate.

Example:cmd_abc123

The unique identifier of the command to terminate.

sessionIdstring required

The unique identifier of the session containing the command.

Example:sbx_abc123

The unique identifier of the session containing the command.

Query parameters

teamIdstring
Example:team_1a2b3c4d5e6f7g8h9i0j1k2l

The Team identifier to perform the request on behalf of.

slugstring
Example:my-team-url-slug

The Team slug to perform the request on behalf of.

Request body

signalnumber required

The POSIX signal number to send to the process. Common values: 15 (SIGTERM) for graceful termination, 9 (SIGKILL) for forced termination.

Example request

{
  "signal": 15
}

Response

The command was terminated successfully.

Example response

{
  "command": {
    "id": "cmd_123a6c5209bc3778245d011443644c8d27dc2c50",
    "name": "npm",
    "args": [
      "run",
      "build"
    ],
    "cwd": "/vercel/sandbox",
    "sessionId": "sbx_123a6c5209bc3778245d011443644c8d27dc2c50",
    "startedAt": 1673123456789,
    "durationMs": 1234
  }
}