Naijacloud
Docs

Previews

Every /v1 route for previews. 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.

One preview

GET /v1/previews/{previewId}

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
previewIdstringyesThe preview's id.

Returns

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

Tear a preview down now

DELETE /v1/previews/{previewId}

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
previewIdstringyesThe preview's id.

Returns

bash
curl -X DELETE "https://api.naijacloud.com/v1/previews/$PREVIEW_ID" \ -H "Authorization: Bearer $NC_API_KEY"

A service's pull-request previews

GET /v1/services/{serviceId}/previews

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service'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: V1PrPreview[], nextCursor }, where each item is V1PrPreview.
bash
curl "https://api.naijacloud.com/v1/services/$SERVICE_ID/previews" \ -H "Authorization: Bearer $NC_API_KEY"

Turn pull-request previews on or off

PUT /v1/services/{serviceId}/previews-enabled

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Body

FieldTypeRequiredNotes
enabledbooleanyesOpen a preview environment for every pull request.

Returns

  • 204 with no body.
bash
curl -X PUT "https://api.naijacloud.com/v1/services/$SERVICE_ID/previews-enabled" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"enabled":true}'

Types

V1PrPreview

FieldTypeNotes
authorLoginstring, or null
baseRefstring, or null
createdAtstring (date-time)
environmentIdstring, or null
errorstring, or null
headRefstring
headShastring, or null
idstring
lastDeploymentIdstring, or null
prNumberinteger
previewPostgresServiceIdstring, or null
previewWebServiceIdstring, or null
projectIdstring
repoFullNamestring
sourceServiceIdstring
statusACTIVE, CLOSED, CREATING, FAILED, UPDATING
titlestring, or null
updatedAtstring (date-time)
urlstring, or null