Skip to content

Previews API

4 operations. Every call needs a session cookie or an Authorization: Bearer nct_… token unless marked Public. Conventions, errors and scopes

DELETE/previews/{previewId}

Delete a pull-request preview

Removes the preview's services, containers, volumes and domains, then its environment. Runs asynchronously.

ParameterInTypeDescription
previewIdrequiredpathstring
Response 202 · Accepted · application/json
PreviewView
  • createdAtstring (date-time)required
  • environmentIdstringrequired
  • environmentSlugstringrequired
  • fromForkbooleanrequired
  • headBranchstringrequired
  • headShastringrequired
  • idstringrequired
  • lastPushAtstring (date-time)required
  • pausedAtstring (date-time) | nullrequired
  • prAuthorstringrequired
  • prNumberinteger (int64)required
  • prTitlestringrequired
  • prUrlstringrequired
  • projectIdstringrequired
  • providerstringrequired
  • repostringrequired
  • statusenum: creating | deploying | seeding | ready | failed | paused | deletingrequired
  • statusMessagestringrequired
  • urlsstring[]required
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/projects/{projectId}/previews

List a project's pull-request previews

ParameterInTypeDescription
projectIdrequiredpathstring
Response 200 · OK · application/json
ListOutputBody2
  • PreviewView[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

GET/projects/{projectId}/previews/settings

Get a project's pull-request preview settings

ParameterInTypeDescription
projectIdrequiredpathstring
Response 200 · OK · application/json
PreviewSettings
  • baseEnvironmentIdstring | nullrequired
  • enabledbooleanrequired
  • excludedServicesstring[] | nullrequired
  • forkPrsbooleanrequired
  • idleDaysinteger (int64)required
  • maxConcurrentinteger (int64)required
  • projectIdstringrequired
  • PreviewSeedCommand[] | nullrequired
  • updatedAtstring (date-time) | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.

PUT/projects/{projectId}/previews/settings

Update a project's pull-request preview settings

Previews clone the base environment for every open pull request of a connected repository. Fork pull requests are off by default; a fork preview never receives secrets.

ParameterInTypeDescription
projectIdrequiredpathstring
Request body · application/json · required
PutSettingsInputBody1
  • baseEnvironmentIdstring
  • enabledboolean
  • excludedServicesstring[] | null
  • forkPrsboolean
  • idleDaysinteger (int64)
  • maxConcurrentinteger (int64)
  • PreviewSeedCommand[] | null
Response 200 · OK · application/json
PreviewSettings
  • baseEnvironmentIdstring | nullrequired
  • enabledbooleanrequired
  • excludedServicesstring[] | nullrequired
  • forkPrsbooleanrequired
  • idleDaysinteger (int64)required
  • maxConcurrentinteger (int64)required
  • projectIdstringrequired
  • PreviewSeedCommand[] | nullrequired
  • updatedAtstring (date-time) | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

Errors are RFC 9457 application/problem+json with a stable code field.