Environments
Deployment environments, their protection rules and deployment history.
Every path is under /api/v1; see the API for authenticating, errors and rate
limits, and the schemas for the bodies.
The project's environments, by name (project:read)
GET /api/v1/projects/{project}/environments
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
environments |
array of Environment, required |
Errors: 404 (how errors look).
Add an environment (environment:write); at most 50 per project
POST /api/v1/projects/{project}/environments
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Body (application/json): any.
Answers:
201: Created, Environment
Errors: 400, 403, 404, 409, 422 (how errors look).
An environment with its rules (project:read)
GET /api/v1/environments/{environment}
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Answers:
200: OK, Environment
Errors: 404 (how errors look).
Change an environment's name, description, URL or rules (environment:write)
PATCH /api/v1/environments/{environment}
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Body (application/json): EnvironmentInput.
Answers:
200: OK, Environment
Errors: 400, 403, 404, 409, 422 (how errors look).
Delete an environment with its variables and secrets (environment:write; with secrets, secret:write too, else 422)
DELETE /api/v1/environments/{environment}
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Answers:
204: Deleted
Errors: 403, 404, 422 (how errors look).
The environment's deployments, newest first, with its current one on the first page (run:read; the last 500 are kept)
GET /api/v1/environments/{environment}/deployments
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
limit |
query | integer |
cursor |
query | string: next_cursor of the previous page |
Answers:
200: OK, DeploymentPage
Errors: 400, 403, 404 (how errors look).