> ## Documentation Index
> Fetch the complete documentation index at: https://docs.buntime.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Kill Process

> Stop running processes in a session

## Request

<ParamField body="sessionId" type="string" required>
  Session ID containing the process
</ParamField>

<ParamField body="pid" type="integer" optional>
  Specific process ID to kill. If omitted, kills all processes.
</ParamField>

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key
</ParamField>

## Response

<ResponseField name="killed" type="integer">
  Number of processes killed
</ResponseField>

<ResponseField name="pids" type="array">
  Array of killed process IDs
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.buntime.sh/execution/kill \
    -H "Authorization: Bearer $BUNTIME_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"sessionId": "ses_abc123", "pid": 1234}'
  ```

  ```typescript TypeScript theme={null}
  await client.execution.kill({
    sessionId: 'ses_abc123',
    pid: 1234 // Optional
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "killed": 1,
    "pids": [1234]
  }
  ```
</ResponseExample>
