---
title: "Kill a command"
method: POST
path: "/v2/sandboxes/sessions/{sessionId}/cmd/{cmdId}/kill"
tags: ["sandboxes"]
---

# Kill a command

`POST /v2/sandboxes/sessions/{sessionId}/cmd/{cmdId}/kill`

## Request

- Base URL: `https://api.vercel.com`
- URL: `https://api.vercel.com/v2/sandboxes/sessions/{sessionId}/cmd/{cmdId}/kill`
- Auth: HTTP bearer

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.

## Path parameters

- `cmdId` string, required: The unique identifier of the command to terminate.
- `sessionId` string, required: The unique identifier of the session containing the command.

## Query parameters

- `teamId` string
- `slug` string

## Request body

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

## Response `200`

The command was terminated successfully.

- object
  - `command` SessionCommand, required: This object represents a command run in a Vercel Sandbox session (v2 API).
    - `args` string[], required: The arguments of the command.
    - `cwd` string, required: The current working directory of the command.
    - `durationMs` number: Duration of the command execution in milliseconds.
    - `exitCode` number, nullable, required: If the command did finish, the exit code.
    - `id` string, required: The ID of the command.
    - `name` string, required: The name of the command.
    - `sessionId` string, required: The ID of the session associated with the command.
    - `startedAt` number, required: When the command was started, in milliseconds since the epoch.

## Other responses

- `400`: One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
- `401`: The request is not authorized.
- `403`: You do not have permission to access this resource.
- `404`
- `410`
- `422`
- `429`

## Changes

- **2026-10-23** `0ab54ee1bd2e`: 1 info
  - removed the non-success response with the status `500`
- **2026-07-08** `3ff660568354`: 1 info
  - added the optional property `command/durationMs` to the response with the `200` status
- **2026-06-11** `14b4658f819e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/vercel/apis/vercel-api/changes/v2/sandboxes/sessions/:sessionId/cmd/:cmdId/kill/post.md)

---

[API](https://skmtc.dev/vercel/apis/vercel-api.md) - [All operations](https://skmtc.dev/vercel/apis/vercel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vercel/apis/vercel-api/revisions/60686c0e1f6a?raw)
