Naijacloud
Docs

Projects

Every /v1 route for projects. 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 a project, with its environments

GET /v1/projects/{projectId}

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
projectIdstringyesThe project's id.

Returns

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

Change a project's name, display name or description

PATCH /v1/projects/{projectId}

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
projectIdstringyesThe project's id.

Body

FieldTypeRequiredNotes
namestringno
displayNamestringno
descriptionstringno

Returns

bash
curl -X PATCH "https://api.naijacloud.com/v1/projects/$PROJECT_ID" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"…","displayName":"…"}'

Delete a project and everything in it

DELETE /v1/projects/{projectId}

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

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
projectIdstringyesThe project's id.

Returns

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

List a project's environments

GET /v1/projects/{projectId}/environments

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
projectIdstringyesThe project's id.

Returns

  • 200 with a page: { data: V1Environment[], nextCursor }, where each item is V1Environment.
bash
curl "https://api.naijacloud.com/v1/projects/$PROJECT_ID/environments" \ -H "Authorization: Bearer $NC_API_KEY"

List a workspace's projects, newest first

GET /v1/workspaces/{workspaceId}/projects

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace's id.

Query parameters

NameTypeRequiredNotes
limitintegernoRows per page. Ignored when a cursor is given.
cursorstringnoThe nextCursor of the previous page, unchanged.

Returns

  • 200 with a page: { data: V1Project[], nextCursor }, where each item is V1Project.
bash
curl "https://api.naijacloud.com/v1/workspaces/$WORKSPACE_ID/projects" \ -H "Authorization: Bearer $NC_API_KEY"

Create a project

POST /v1/workspaces/{workspaceId}/projects

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
workspaceIdstringyesThe workspace'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. shop
displayNamestringno
descriptionstringno
regionstringnoRegion key. New services in the project are placed there unless they name another. e.g. af-west

Returns

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

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)

V1Project

FieldTypeNotes
idstring (uuid)
workspaceIdstring (uuid)
namestringe.g. shop
displayNamestring, or null
descriptionstring, or null
defaultRegionstring, or nullRegion new services in this project are placed in, e.g. "af-west".
pausedboolean
pausedAtstring (date-time), or null
environmentsarray of V1EnvironmentIncluded when one project is fetched; omitted from lists.
createdAtstring (date-time)
updatedAtstring (date-time)