background: true on the exec endpoint — continue running inside the capsule until they exit or you stop them. The processes endpoints let you inspect what is running, send signals to terminate processes, and attach a streaming WebSocket to a process that is already underway.
List processes
Authentication
Your team’s API key.
Path parameters
The capsule ID.
Response (200)
Array of process objects.
Python SDK
Kill a process
Path parameters
The capsule ID.
A numeric PID (e.g.
42) or a string tag (e.g. bg-a1b2c3d4).Query parameters
Signal to send to the process. Accepted values:
SIGKILL (immediate termination) or SIGTERM (graceful shutdown request).Response
Returns HTTP 204 with no body on success.Examples
Kill by PID with the default signal (SIGKILL):Python SDK
kill() accepts a PID. To send SIGTERM instead of the default SIGKILL, use the REST API directly with the ?signal=SIGTERM query parameter — the SDK always sends SIGKILL.
Stream a running process
exit message when the process terminates.
This endpoint attaches to an existing process. To start a new process and stream it from the beginning, use the exec/stream endpoint instead.
Path parameters
The capsule ID.
A numeric PID or string tag identifying the process to attach to.
Server messages
Once connected, the server streams the same message format as the exec/stream endpoint:type | Fields | When sent |
|---|---|---|
start | pid: integer | Attached to process. |
stdout | data: string | A chunk of stdout. |
stderr | data: string | A chunk of stderr. |
exit | exit_code: integer | Process exited. |
error | data: string | An error occurred. |
Python SDK
Errors
| Status | Meaning |
|---|---|
404 | Capsule not found, or the process identified by the selector does not exist. |
409 | Capsule is not in the running state. |