---
title: "Run a command inside a Computer."
method: POST
path: "/v1/computers/{id}/exec"
tags: ["Computers"]
---

# Run a command inside a Computer.

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

## Request

- Base URL: `https://api.scalix.world`
- URL: `https://api.scalix.world/v1/computers/{id}/exec`
- Auth: HTTP bearer

## Path parameters

- `id` string, required

## Request body

- ComputerExecRequest: Request body for running a command inside a Computer.
  - `command` string, required
  - `args` string[], nullable
  - `cwd` string, nullable: Working directory inside the guest.
  - `env` object
  - `timeout_ms` integer, nullable: 1000..600000, default 60000.

## Response `200`

Command finished

- ComputerExecResult: Result of a command executed inside a Computer.
  - `exitCode` integer, required
  - `stdout` string, required
  - `stderr` string, required

## Other responses

- `404`: Not found
- `409`: The Computer is not RUNNING

---

[API](https://skmtc.dev/scalix/apis/scalix-cloud-api.md) · [All operations](https://skmtc.dev/scalix/apis/scalix-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/scalix/apis/scalix-cloud-api/revisions/2c04ca0a90bb?raw)
