v14

OpenAPI 3.0.32026-08-04377889.4 MB
sandboxes

Get a command

Retrieves the current status and details of a command executed in a session. Use the wait parameter to block until the command finishes execution.

get/v2/sandboxes/sessions/{sessionId}/cmd/{cmdId}

Path parameters

sessionIdstring required

The unique identifier of the session containing the command.

Example:sbx_abc123

The unique identifier of the session containing the command.

cmdIdstring required

The unique identifier of the command to retrieve.

Example:cmd_abc123

The unique identifier of the command to retrieve.

Query parameters

wait'true' | 'false'

If set to "true", the request will block until the command finishes execution. Useful for synchronously waiting for command completion.

If set to "true", the request will block until the command finishes execution. Useful for synchronously waiting for command completion.

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.

Response

The command data along with the exit code if the command did finish.

Example response

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