Skip to main content
Background processes — started with 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

Returns all processes currently running inside the capsule, including background processes started via the API and any processes launched by the capsule’s init scripts or template.

Authentication

string
required
Your team’s API key.

Path parameters

string
required
The capsule ID.

Response (200)

object[]
Array of process objects.

Python SDK


Kill a process

Sends a signal to a running process. You can identify the process by its numeric PID or by its string tag.

Path parameters

string
required
The capsule ID.
string
required
A numeric PID (e.g. 42) or a string tag (e.g. bg-a1b2c3d4).

Query parameters

string
default:"SIGKILL"
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):
Kill by tag with SIGTERM:

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

Opens a WebSocket connection to attach to a background process that is already running. You receive stdout and stderr from the point of connection onwards, plus an 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

string
required
The capsule ID.
string
required
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:

Python SDK


Errors