Forward API reference.
Description
Creates a runtime environment configuration for Agent Sessions.
Path
POST /api/v1/forward/environments
Request headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT or SAT> |
Content-Type | Yes | application/json |
Idempotency-Key | No | Recommended for create requests. The same key and request can be retried safely. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Environment name. It must not be empty after trimming leading and trailing whitespace. |
description | string | No | Description. |
config | Environment config | No | Environment runtime configuration. Defaults to {"type":"cloud"} when omitted. When provided explicitly, it must not be null or an empty object. See schemas for field details. |
metadata | object | No | Environment metadata. Defaults to {} when omitted and must not be null when provided explicitly. |
config subfields (type, packages, and setup_script) and their constraints. A self_hosted Environment accepts only type and an optional setup_script; a cloud Environment can also declare packages.
Example request
Request with packages and a setup script
Example response
HTTP 201 Created
Response fields
The response is an Environment object. config is normalized to its complete shape. For a cloud Environment, config.packages includes empty arrays for every reserved key in Environment packages.
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | name is missing or empty, the request body is not valid JSON, or config / metadata violates the constraints above. |
| 400 | invalid_request_error | If the reserved key created_by is supplied, message is metadata key "created_by" is reserved, identifying the invalid field. |
| 401 | authentication_error | The authentication token is missing or invalid. |
| 403 | permission_error | The caller cannot access this resource. |
| 409 | conflict_error | The Idempotency-Key maps to a different request, or creation is in an intermediate state that requires manual recovery. |
| 413 | invalid_request_error | The request body exceeds the service limit. |
| 429 | rate_limit_error | The caller exceeded the API rate limit. |
| 500/502/503 | api_error | Forward or a dependent service failed. |