---
title: "POST /v1/sandboxes/{id}/exec"
method: POST
path: "/v1/sandboxes/{id}/exec"
tags: ["Sandboxes"]
---

# POST /v1/sandboxes/{id}/exec

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

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/v1/sandboxes/{id}/exec`
- Auth: HTTP bearer

## Path parameters

- `id` string, required

## Request body

- ExecBody
  - `cmd` string[], required
  - `cwd` string, nullable
  - `env` object

## Response `200`

Command finished (non-zero exit is NOT an error)

- ExecResponse
  - `exit_code` integer, required
  - `stderr` string, required
  - `stdout` string, required

## Other responses

- `404`: Sandbox not found

## Changes

- **2026-04-25** `774be20905f2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/v1/sandboxes/:id/exec/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
