---
title: "Execute a command in a Box"
method: POST
path: "/boxes/{boxId}/commands"
tags: ["Box"]
---

# Execute a command in a Box

`POST /boxes/{boxId}/commands`

## Path parameters

- `boxId` string, required

## Request body

- CommandRequest
  - `command` string, required
  - `cwd` string — Relative working directory inside the Box work directory.
  - `timeoutSeconds` integer

## Response `200`

Command result.

- CommandResponse
  - `ok` boolean, required
  - `type` 'command.finished', required — Stable success envelope discriminator added by v1.
  - `success` boolean, required
  - `exitCode` integer, nullable, required
  - `signal` string, nullable
  - `stdout` string, required
  - `stderr` string, required
  - `stdoutTruncated` boolean
  - `stderrTruncated` boolean
  - `timedOut` boolean, required
  - `cwd` string
  - `startedAt` string, date-time
  - `finishedAt` string, date-time

---

[API](https://skmtc.dev/ascii/apis/box-public-api-v1.md) · [All operations](https://skmtc.dev/ascii/apis/box-public-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ascii/box-public-api-v1/revisions/82d576f82046/schema)
