Skip to content

Environments API

Environments are project-scoped, named test contexts (for example staging, pre-prod, production) that can be attached to test runs. Each environment has a globally-unique ULID assigned by the server and a human-readable slug that must be unique among live environments within a project.

POST/api/v1/projects/{projectId}/environments

{projectId} is the project code (for example ACME).

FieldRequiredNotes
nameyesNon-empty string, max 120 characters
slugyesLowercase alphanumeric segments joined by single hyphens. No leading, trailing, or doubled hyphens. Examples: staging, pre-prod, pre-prod-v2
descriptionnoFree-text description, max 2000 characters
urlnoValid URL, max 2000 characters
isDefaultnotrue to mark as the project default. Atomically demotes any existing default. Defaults to false

Client-supplied ulid fields are rejected.

201 with the created environment object. See Response fields.

Duplicate live slug within the project returns 409 conflict. Invalid slug format or empty name return 422 validation_failed.

Terminal window
curl -sS -X POST \
-H "Authorization: Bearer $PROBARA_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Staging","slug":"staging","isDefault":true}' \
"https://probara.net/api/v1/projects/ACME/environments"
GET/api/v1/projects/{projectId}/environments

Returns the live (non-deleted) environments for the project, newest first. Page-based pagination.

ParameterNotes
pagePage number (1-based, default 1)
pageSizeItems per page (default 50, max 200)

200 with { items, page, pageSize, total }. Each item follows the response shape.

Terminal window
curl -sS \
-H "Authorization: Bearer $PROBARA_API_TOKEN" \
"https://probara.net/api/v1/projects/ACME/environments"
GET/api/v1/environments/{environmentUlid}

Returns a single live environment scoped to the active organization.

Returns 404 not_found when the environment is outside the active organization or has been deleted.

Terminal window
curl -sS \
-H "Authorization: Bearer $PROBARA_API_TOKEN" \
"https://probara.net/api/v1/environments/01JXXXXXXXXXXXXXXXXXXXXXXXXX"
PATCH/api/v1/environments/{environmentUlid}

Partial update. At least one field must be provided; an empty body returns 422 validation_failed.

FieldRequiredNotes
namenoNon-empty string, max 120 characters
slugnoSame slug format rules as create
descriptionnoMax 2000 characters, or null to clear
urlnoValid URL, or null to clear
isDefaultnotrue to promote this environment as the project default; atomically demotes the current default

Duplicate live slug returns 409 conflict. Returns 404 not_found when the environment is outside the active organization.

Terminal window
curl -sS -X PATCH \
-H "Authorization: Bearer $PROBARA_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Pre-production","isDefault":false}' \
"https://probara.net/api/v1/environments/01JXXXXXXXXXXXXXXXXXXXXXXXXX"
DELETE/api/v1/environments/{environmentUlid}

Soft-deletes the environment. Returns 204 on success. Subsequent GET returns 404 not_found and the environment is excluded from list results.

Returns 404 not_found when the environment is outside the active organization.

Terminal window
curl -sS -X DELETE \
-H "Authorization: Bearer $PROBARA_API_TOKEN" \
"https://probara.net/api/v1/environments/01JXXXXXXXXXXXXXXXXXXXXXXXXX"

All mutating endpoints (POST, PATCH) and GET /api/v1/environments/{environmentUlid} return a single environment object with the following fields.

FieldTypeNotes
ulidstring (ULID)Server-assigned unique identifier
projectUlidstring (ULID)The project this environment belongs to
namestringDisplay name
slugstringURL-safe identifier
descriptionstring | nullOptional description
urlstring | nullOptional URL
isDefaultbooleanWhether this is the project default environment
createdAtnumberUnix epoch milliseconds
updatedAtnumberUnix epoch milliseconds

Environment mutations emit environment.created, environment.updated, and environment.deleted on the organization activity feed. See Audit events.