pydo.harness.post_session_sandbox_exec()

Generated on 6 Nov 2026 from pydo version v0.45.0

Usage

client.harness.post_session_sandbox_exec(
    session_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    body={
        "argv": [...],
        "workdir": "/workspace",
        "stdin": "",
        ...,
    },
)
Returns JSON Raises HttpResponseError

Description

Runs argv directly in the guest (no shell). Stdout/stderr are buffered and capped at 1 MiB each; truncation is indicated via response headers when present. A non-zero exit code is still HTTP 200.

Parameters

session_id string required

Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890

The session UUID.

argv array of strings required

Example: ['uname', '-a']

Program and arguments. Required and non-empty; run directly, with no shell interpretation.

workdir string optional

Example: /workspace

Working directory inside the sandbox. Empty uses the sandbox default (/workspace); not restricted to the workspace root.

stdin string optional

Optional base64 stdin payload, delivered in full and then closed so the process sees EOF. One-shot only — there is no streaming stdin on this endpoint.

timeout_seconds integer optional

Example: 60

Optional timeout. Clamped server-side (default 60, maximum 240) regardless of the value sent.

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "argv": [
    "uname",
    "-a"
  ],
  "workdir": "/workspace",
  "stdin": "",
  "timeout_seconds": 60
}

resp = client.harness.post_session_sandbox_exec(session_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890", body=req)

Response Example

Show Response Example
{
  "exit_code": 0,
  "stdout": "Linux",
  "stderr": "",
  "duration_ms": 12
}

More Information

See /v2/agents/sessions/{session_id}/sandbox/exec in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.