v1

latestOpenAPI 3.1.02026-08-04151221521.2 KB
Environments

Create Environment

Create a new environment for an agent.

Environments define deployment targets with branch matching rules.
The is_prod flag cannot be set via API - production environment is protected.

**Branch Rules:**
- Exact match: ["main"] or ["develop"]
- Wildcard: ["feature/*"] matches feature/foo, feature/bar
- Catch-all: ["*"] matches any branch
post/agents/{namespace_slug}/{agent_name}/environments

Path parameters

namespace_slugstring required
agent_namestring required

Request body

branch_rulesstring[] required

Branch patterns for matching (e.g., ['feature/*'], ['develop'])

namestring required

Environment name (lowercase alphanumeric and hyphens only)

Response

Successful Response

agent_idstring required

Parent agent ID

branch_rulesstring[] required

Branch patterns for matching (e.g., ['main'], ['feature/*'])

created_atstring date-time nullable

Creation timestamp

idstring required

Unique identifier

is_prodboolean required

Whether this is the production environment (protected)

namestring required

Environment name (e.g., 'production', 'staging')

updated_atstring date-time nullable

Last update timestamp