Environments
An environment is a place products run, such as staging or production. Every product in the workspace can deploy to it, and its class decides whether production rules apply.
The Environment object
A place products run, shared by every product in the workspace.
Attributes
idstringRequiredUnique ID of the environment.
slugstringRequiredLowercase letters, digits and hyphens, unique in the workspace, such as staging.
namestringRequiredThe environment's display name.
classstringRequiredProduction holds real customer data; everything else is non-production.
productionnon-productiondescriptionnullable stringRequiredA short description, or null.
emojinullable stringRequiredOne emoji shown beside the environment's name, or null.
archivedAtnullable stringRequiredWhen it was archived, as an ISO 8601 timestamp; null while active.
createdAtstringRequiredWhen it was created, as an ISO 8601 timestamp.
updatedAtstringRequiredWhen it last changed, as an ISO 8601 timestamp.
Deployments whose product is active.
{ "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "description": "Where each merge to main lands before production.", "emoji": "🧪", "archivedAt": null, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z", "deployments": [ { "id": "Dp3FkR8wNv2T", "product": { "id": "Pr4GtY9sLm3B", "slug": "storefront", "name": "Storefront", "type": "website", "archived": false }, "environment": { "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "emoji": "🧪", "archived": false }, "baseUrl": "https://staging.acme.dev", "fixtureUrl": "https://staging.acme.dev/fixtures", "version": "9f2c41e", "versionUpdatedAt": "2026-10-14T09:05:12.000Z", "active": true, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z" } ]}List environments
GET/Returns the workspace's environments with the deployments of active products.
Path parameters
slugstringRequiredThe workspace's slug or ID, such as acme.
Query parameters
archivedstringWhich archived objects to return: exclude (the default), include or only archived ones.
excludeincludeonlyReturns
Returns an object with these fields. Status 200.
The environments, sorted by name.
Errors
- 400
InvalidInputThe request is malformed, or a value is not allowed.- 401
UnauthorizedThe request has no valid API key.- 403
ForbiddenThe key's user or role may not do this.- 404
NotFoundThe workspace or object does not exist, or the caller cannot see it.- 409
ConflictThe change conflicts with current data, such as a slug that is already in use.- 500
InternalClanker Ship failed to handle the request. Retry, or report the response's x-request-id.
curl https://api.qa.clankership.net/v1/workspaces/acme/environments \ -H "Authorization: Bearer $CLANKER_API_KEY"{ "environments": [ { "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "description": "Where each merge to main lands before production.", "emoji": "🧪", "archivedAt": null, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z", "deployments": [ { "id": "Dp3FkR8wNv2T", "product": { "id": "Pr4GtY9sLm3B", "slug": "storefront", "name": "Storefront", "type": "website", "archived": false }, "environment": { "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "emoji": "🧪", "archived": false }, "baseUrl": "https://staging.acme.dev", "fixtureUrl": "https://staging.acme.dev/fixtures", "version": "9f2c41e", "versionUpdatedAt": "2026-10-14T09:05:12.000Z", "active": true, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z" } ] } ]}Create an environment
POST/Adds an environment every product in the workspace can deploy to. Viewers cannot create environments.
Path parameters
slugstringRequiredThe workspace's slug or ID, such as acme.
Body parameters
slugstringRequiredLowercase letters, digits and hyphens, unique in the workspace, such as staging.
namestringRequiredThe environment's display name.
classstringRequiredProduction holds real customer data. It cannot change once set.
productionnon-productiondescriptionnullable stringA short description.
emojinullable stringOne emoji shown beside the name.
Returns
Returns the Environment object. Status 201.
Errors
- 400
InvalidInputThe request is malformed, or a value is not allowed.- 401
UnauthorizedThe request has no valid API key.- 403
ForbiddenThe key's user or role may not do this.- 404
NotFoundThe workspace or object does not exist, or the caller cannot see it.- 409
ConflictThe change conflicts with current data, such as a slug that is already in use.- 500
InternalClanker Ship failed to handle the request. Retry, or report the response's x-request-id.
curl -X POST https://api.qa.clankership.net/v1/workspaces/acme/environments \ -H "Authorization: Bearer $CLANKER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "slug": "staging", "name": "Staging", "class": "non-production", "emoji": "🧪" }'{ "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "description": "Where each merge to main lands before production.", "emoji": "🧪", "archivedAt": null, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z", "deployments": [ { "id": "Dp3FkR8wNv2T", "product": { "id": "Pr4GtY9sLm3B", "slug": "storefront", "name": "Storefront", "type": "website", "archived": false }, "environment": { "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "emoji": "🧪", "archived": false }, "baseUrl": "https://staging.acme.dev", "fixtureUrl": "https://staging.acme.dev/fixtures", "version": "9f2c41e", "versionUpdatedAt": "2026-10-14T09:05:12.000Z", "active": true, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z" } ]}Get an environment
GET/Returns one environment, archived or not, with the deployments of active products.
Path parameters
slugstringRequiredThe workspace's slug or ID, such as acme.
environmentstringRequiredThe environment's slug or ID, such as staging.
Returns
Returns the Environment object. Status 200.
Errors
- 400
InvalidInputThe request is malformed, or a value is not allowed.- 401
UnauthorizedThe request has no valid API key.- 403
ForbiddenThe key's user or role may not do this.- 404
NotFoundThe workspace or object does not exist, or the caller cannot see it.- 409
ConflictThe change conflicts with current data, such as a slug that is already in use.- 500
InternalClanker Ship failed to handle the request. Retry, or report the response's x-request-id.
curl https://api.qa.clankership.net/v1/workspaces/acme/environments/{environment} \ -H "Authorization: Bearer $CLANKER_API_KEY"{ "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "description": "Where each merge to main lands before production.", "emoji": "🧪", "archivedAt": null, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z", "deployments": [ { "id": "Dp3FkR8wNv2T", "product": { "id": "Pr4GtY9sLm3B", "slug": "storefront", "name": "Storefront", "type": "website", "archived": false }, "environment": { "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "emoji": "🧪", "archived": false }, "baseUrl": "https://staging.acme.dev", "fixtureUrl": "https://staging.acme.dev/fixtures", "version": "9f2c41e", "versionUpdatedAt": "2026-10-14T09:05:12.000Z", "active": true, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z" } ]}Update an environment
PATCH/Changes only the fields sent. The class cannot change; sending it fails with InvalidInput.
Path parameters
slugstringRequiredThe workspace's slug or ID, such as acme.
environmentstringRequiredThe environment's slug or ID, such as staging.
Body parameters
slugstringLowercase letters, digits and hyphens, unique in the workspace, such as staging.
namestringThe environment's display name.
descriptionnullable stringA short description. null clears it.
emojinullable stringOne emoji shown beside the name. null clears it.
classstringAlways rejected: an environment's class cannot change.
productionnon-productionReturns
Returns the Environment object. Status 200.
Errors
- 400
InvalidInputThe request is malformed, or a value is not allowed.- 401
UnauthorizedThe request has no valid API key.- 403
ForbiddenThe key's user or role may not do this.- 404
NotFoundThe workspace or object does not exist, or the caller cannot see it.- 409
ConflictThe change conflicts with current data, such as a slug that is already in use.- 500
InternalClanker Ship failed to handle the request. Retry, or report the response's x-request-id.
curl -X PATCH https://api.qa.clankership.net/v1/workspaces/acme/environments/{environment} \ -H "Authorization: Bearer $CLANKER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Staging (EU)", "emoji": "🇪🇺" }'{ "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "description": "Where each merge to main lands before production.", "emoji": "🧪", "archivedAt": null, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z", "deployments": [ { "id": "Dp3FkR8wNv2T", "product": { "id": "Pr4GtY9sLm3B", "slug": "storefront", "name": "Storefront", "type": "website", "archived": false }, "environment": { "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "emoji": "🧪", "archived": false }, "baseUrl": "https://staging.acme.dev", "fixtureUrl": "https://staging.acme.dev/fixtures", "version": "9f2c41e", "versionUpdatedAt": "2026-10-14T09:05:12.000Z", "active": true, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z" } ]}Archive an environment
POST/Hides the environment and refuses vault pulls for its deployments until it is restored. Archiving an archived environment changes nothing.
Path parameters
slugstringRequiredThe workspace's slug or ID, such as acme.
environmentstringRequiredThe environment's slug or ID, such as staging.
Returns
Returns the Environment object. Status 200.
Errors
- 400
InvalidInputThe request is malformed, or a value is not allowed.- 401
UnauthorizedThe request has no valid API key.- 403
ForbiddenThe key's user or role may not do this.- 404
NotFoundThe workspace or object does not exist, or the caller cannot see it.- 409
ConflictThe change conflicts with current data, such as a slug that is already in use.- 500
InternalClanker Ship failed to handle the request. Retry, or report the response's x-request-id.
curl -X POST https://api.qa.clankership.net/v1/workspaces/acme/environments/{environment}/archive \ -H "Authorization: Bearer $CLANKER_API_KEY"{ "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "description": "Where each merge to main lands before production.", "emoji": "🧪", "archivedAt": null, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z", "deployments": [ { "id": "Dp3FkR8wNv2T", "product": { "id": "Pr4GtY9sLm3B", "slug": "storefront", "name": "Storefront", "type": "website", "archived": false }, "environment": { "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "emoji": "🧪", "archived": false }, "baseUrl": "https://staging.acme.dev", "fixtureUrl": "https://staging.acme.dev/fixtures", "version": "9f2c41e", "versionUpdatedAt": "2026-10-14T09:05:12.000Z", "active": true, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z" } ]}Restore an environment
POST/Brings an archived environment back with its deployments. Restoring an active environment changes nothing.
Path parameters
slugstringRequiredThe workspace's slug or ID, such as acme.
environmentstringRequiredThe environment's slug or ID, such as staging.
Returns
Returns the Environment object. Status 200.
Errors
- 400
InvalidInputThe request is malformed, or a value is not allowed.- 401
UnauthorizedThe request has no valid API key.- 403
ForbiddenThe key's user or role may not do this.- 404
NotFoundThe workspace or object does not exist, or the caller cannot see it.- 409
ConflictThe change conflicts with current data, such as a slug that is already in use.- 500
InternalClanker Ship failed to handle the request. Retry, or report the response's x-request-id.
curl -X POST https://api.qa.clankership.net/v1/workspaces/acme/environments/{environment}/restore \ -H "Authorization: Bearer $CLANKER_API_KEY"{ "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "description": "Where each merge to main lands before production.", "emoji": "🧪", "archivedAt": null, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z", "deployments": [ { "id": "Dp3FkR8wNv2T", "product": { "id": "Pr4GtY9sLm3B", "slug": "storefront", "name": "Storefront", "type": "website", "archived": false }, "environment": { "id": "En8RqZ2vKp5D", "slug": "staging", "name": "Staging", "class": "non-production", "emoji": "🧪", "archived": false }, "baseUrl": "https://staging.acme.dev", "fixtureUrl": "https://staging.acme.dev/fixtures", "version": "9f2c41e", "versionUpdatedAt": "2026-10-14T09:05:12.000Z", "active": true, "createdAt": "2026-10-01T16:20:00.000Z", "updatedAt": "2026-10-14T09:05:12.000Z" } ]}