> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Start a supervised background process

> Start a supervised background process

> [!WARNING]
>
> **Confirm your deployment before running this request.** This page describes an API contract;
> a published reference does not establish hosted availability. Check the dated
> [host report](/api-reference/hosts) and obtain your deployment URL and credentials.
> Replace the example host if your provisioned service uses a different URL.

### Path parameters

**id** `string (uuid)` *required*

Sandbox identifier

### Request body

`StartProcessRequest`

**command** `string | string[]` *required*

Minimum length: `1`. Maximum length: `100000`.

**command**

**Option 1: string**

Minimum length: `1`. Maximum length: `100000`.

**Option 2: string\[]**

Minimum items: `1`. Maximum items: `1000`.

**working\_dir** `string`

Minimum length: `1`. Maximum length: `4096`.

**env** `object`

Additional keys map to values of type `string`.

**name** `string`

Minimum length: `1`. Maximum length: `128`.

**restart** `string`

Allowed values: `'never'`, `'on-failure'`, `'always'`. Default: `'never'`.

**max\_restarts** `integer`

Minimum: `0`. Maximum: `10000`.

**restart\_backoff\_ms** `integer`

Minimum: `0`. Maximum: `300000`.

**stdin** `boolean`

Default: `false`.

**timeout\_seconds** `integer,null`

Minimum: `1`. Maximum: `2592000`.

**log** `object`

**log**

**max\_bytes** `integer`

Minimum: `4096`. Maximum: `17179869184`.

**keep\_rotations** `integer`

Minimum: `0`. Maximum: `100`.

### Response

No response body. Process started.

### Status codes

| Code | Meaning |
| - | - |
| `201` | Process started |
| `400` | Invalid request |
| `404` | Sandbox not found |
| `429` | Too many running processes in the sandbox |
| `501` | The sandbox's exec agent does not support supervised processes |

### Using this contract

Read the [source OpenAPI document](/spec/sandbox.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request POST \
  --url 'https://api.sandbox.stateset.app/api/v1/sandbox/{id}/processes' \
  --header 'Authorization: ApiKey YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "command": "string",
  "working_dir": "string",
  "env": {},
  "name": "Two-Person Tent",
  "restart": "never",
  "max_restarts": 1,
  "restart_backoff_ms": 250,
  "stdin": false,
  "timeout_seconds": 250,
  "log": {
    "max_bytes": 4096,
    "keep_rotations": 1
  }
}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.