Naijacloud
Docs

Environments

Every /v1 route for environments. This page is generated from the API's OpenAPI contract, so it always matches what the API accepts and returns.

Authentication, pagination, errors and idempotency work the same on every route. They are described once, in the API overview.

Get an environment, with its project and tier

GET /v1/environments/{environmentId}

The same membership and project-scope check as listing the project. kind is DEV, UAT or PROD when the name is exactly that tier.

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
environmentIdstringyesThe environment's id.

Returns

bash
curl "https://api.naijacloud.com/v1/environments/$ENVIRONMENT_ID" \ -H "Authorization: Bearer $NC_API_KEY"

Delete an environment and everything in it

DELETE /v1/environments/{environmentId}

Irreversible: tears down every service in it, data included. Requires ADMIN.

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
environmentIdstringyesThe environment's id.

Returns

  • 204 with no body.
bash
curl -X DELETE "https://api.naijacloud.com/v1/environments/$ENVIRONMENT_ID" \ -H "Authorization: Bearer $NC_API_KEY"

Create an environment in a project

POST /v1/projects/{projectId}/environments

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
projectIdstringyesThe project's id.

Headers

NameTypeRequiredNotes
Idempotency-KeystringnoAny unique string (1–255 printable characters). A retry with the same key and body returns the first response instead of acting twice, for 24 hours.

Body

FieldTypeRequiredNotes
namestringyese.g. staging

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/projects/$PROJECT_ID/environments" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"name":"staging"}'

Types

V1Environment

FieldTypeNotes
idstring (uuid)
projectIdstring (uuid)
namestringe.g. production
isPreviewbooleanTrue for a pull-request preview environment.
pausedbooleanTrue while this environment is paused on its own. A paused project stops it too without setting this.
pausedAtstring (date-time), or null
createdAtstring (date-time)
updatedAtstring (date-time)

V1EnvironmentDetail

FieldTypeNotes
idstring (uuid)
projectIdstring (uuid)
namestringe.g. production
isPreviewbooleanTrue for a pull-request preview environment.
pausedbooleanTrue while this environment is paused on its own. A paused project stops it too without setting this.
pausedAtstring (date-time), or null
createdAtstring (date-time)
updatedAtstring (date-time)
kindDEV, UAT, PROD, or nullDEV, UAT or PROD when the name is exactly that tier (any case); null for a custom name such as "staging". The tier decides which scoped variables apply.
projectV1EnvironmentProject

V1EnvironmentProject

FieldTypeNotes
idstring (uuid)
workspaceIdstring (uuid)
namestring