---
title: "Execute command in sandbox"
method: POST
path: "/v1/stacks/{id}/exec"
tags: ["Stacks"]
---

# Execute command in sandbox

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

Run a command in the sandbox container and get the output

## Path parameters

- `id` string, required — Stack identifier

## Request body

- object
  - `command` string[], required — Command to execute as array

## Response `200`

Command execution result

- object
  - `stdout` string, required
  - `stderr` string, required
  - `exitCode` number, required

## Other responses

- `400` — Bad request
- `404` — Stack not found

## Changes

- **2025-10-29** `17a1ccb59fba` — 1 info
  - api operation id `exec_command` was added
- **2025-10-29** `1a4801fc49a1` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/benchify/apis/benchify-api/changes/v1/stacks/:id/exec/post.md)

---

[API](https://skmtc.dev/benchify/apis/benchify-api.md) · [All operations](https://skmtc.dev/benchify/apis/benchify-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/benchify/benchify-api/revisions/1a65aea8dd7d/schema)
