---
search:
  tags:
    - exec
    - POST
seo:
  description: >-
    With Accept: application/x-ndjson the output is streamed as it is produced,…
    Reference for the POST /v1/sandboxes/{sandbox}/exec endpoint in the pols.so
    API.
sidebar:
  label: Run a command in a running sandbox
  badge: POST
title: Run a command in a running sandbox
type: openapi-operation
---
With `Accept: application/x-ndjson` the output is streamed as it is
produced, one `ExecEvent` JSON object per line, ending with an `exit`
(or `error`) event. Otherwise the call waits and returns an
`ExecResult` with the collected output (capped at 4 MiB per stream;
stream larger output).

`POST /v1/sandboxes/{sandbox}/exec`
