POST /v1/environments
Creates a new cloud execution environment for hosting Agent sessions.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT> |
Content-Type | Yes | application/json |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Non-empty environment name |
description | string | No | Environment description |
config | Environment config | Yes | Environment configuration |
metadata | Metadata object | No | Custom metadata. Defaults to {} |
Example request
Example response
HTTP 201 CreatedResponse fields
| Field | Type | Description |
|---|---|---|
id | string | Environment unique identifier with the env_ prefix |
type | string | Always "environment" |
name | string | Environment name |
description | string | Environment description |
status | string | Environment status (such as "ready") |
config | Environment config | Environment configuration |
metadata | Metadata object | Custom metadata |
archived | boolean | Whether archived (default false) |
archived_at | string|null | Archive time (ISO 8601), null when not archived |
created_at | string | Creation time (ISO 8601) |
updated_at | string | Last update time (ISO 8601) |
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | Missing required field name |
| 400 | invalid_request_error | Missing required field config |
| 400 | invalid_request_error | Invalid config or metadata value |
| 401 | authentication_error | PAT invalid or expired |
| 403 | permission_error | Not authorized for this operation |
Related
Cloud environment setup
Choose the container, network, and dependencies your agent runs in.