Naijacloud
Docs

Static sites

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

Publish an uploaded artifact as a new static site

POST /v1/static-sites

Key scopes: WRITE and PLATFORM_API.

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
indexPathstringnoThe page to serve at "/" when it is not index.html.
spaFallbackbooleannoServe the index page for unknown paths (single-page apps).
uploadIdstring (uuid)yes
environmentIdstring (uuid)noThe environment to create the site in. Omitted, it lands in the workspace's static-sites project.
namestringno

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/static-sites" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"uploadId":"…"}'

Reserve an upload for a .zip or .html artifact

POST /v1/static-uploads

Key scopes: WRITE and PLATFORM_API.

Body

FieldTypeRequiredNotes
filenamestringyese.g. "site.zip" or "index.html".
contentTypestringyese.g. "application/zip" or "text/html".
sizeBytesnumberyes

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/static-uploads" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"filename":"…","contentType":"…","sizeBytes":1}'

Replace a static site's content from a fresh upload

POST /v1/services/{serviceId}/static-deploys

In place, on the same URL. Returns the new deploy.

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service'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
indexPathstringnoThe page to serve at "/" when it is not index.html.
spaFallbackbooleannoServe the index page for unknown paths (single-page apps).
uploadIdstring (uuid)yes

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/services/$SERVICE_ID/static-deploys" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"uploadId":"…"}'

Types

V1Deploy

FieldTypeNotes
idstring (uuid)
serviceIdstring (uuid)
statusQUEUED, BUILDING, TESTING, DEPLOYING, RUNNING, FAILED, CANCELLED, REPLACED, SUPERSEDED
triggerPUSH, MANUAL, ROLLBACK, FIRST_DEPLOY, SYSTEM, or nullWhat started it: a push, a person, a rollback, …
branchstring, or null
commitShastring, or null
commitMessagestring, or null
authorNamestring, or null
buildCommandstring, or null
startCommandstring, or null
errorstring, or nullWhy it failed, written for you.
errorCodeMISSING_SCRIPT, COMMAND_NOT_FOUND, MODULE_NOT_FOUND, BUILD_FAILED, CRASH, OOM, PORT_NOT_LISTENING, HEALTH_TIMEOUT, IMAGE_REJECTED, BUILD_OOM, NODE_BUSY, NODE_LOW_DISK, DATA_SERVICE_ON_OTHER_NODE, UNKNOWN, or null
durationMsnumber, or nullFrom the start of work (not queueing) to the end, in ms.
createdAtstring (date-time)
startedAtstring (date-time), or null
finishedAtstring (date-time), or null

V1Region

FieldTypeNotes
keystringe.g. eu-west
labelstringe.g. Europe

V1Service

FieldTypeNotes
idstring (uuid)
environmentIdstring (uuid)
namestringe.g. api
typeWEB, STATIC, CRON, POSTGRES, MYSQL, MARIADB, MONGODB, REDIS, VALKEY
statusPROVISIONING, ACTIVE, ERROR
tierFREE, PRO, STANDARD, STARTER, or null
urlstring, or nullThe platform URL. Null for databases and before placement. e.g. https://api-shop.naijacloud.app
regionV1Region, or null
runtimestring, or nulle.g. node
frameworkstring, or nulle.g. nextjs
isStaticboolean
portnumber, or null
healthCheckPathstring, or null
memoryMbnumber
cpuMillicoresnumber
storageLimitMbnumber, or null
sourceV1ServiceSource
buildV1ServiceBuild
cronV1ServiceCron, or nullSet for CRON services only.
suspensionNONE, USER, BILLING, ABUSEWhy nothing is running, if anything: NONE, USER (suspended by a person), BILLING or ABUSE.
healthHEALTHY, CRASH_LOOPING, STOPPED, MISSING, UNKNOWN
lastDeployedAtstring (date-time), or null
createdAtstring (date-time)
updatedAtstring (date-time)

V1ServiceBuild

FieldTypeNotes
buildCommandstring, or null
startCommandstring, or null
runtimeVersionstring, or nulle.g. 22
staticOutputDirstring, or null
staticSpaboolean
monorepoStrategyISOLATED, WORKSPACE, or null
watchPathsarray of string, or null

V1ServiceCron

FieldTypeNotes
schedulestring, or nulle.g. */15 * * * *
commandstring, or null
suspendedbooleanScheduled runs are paused.

V1ServiceSource

FieldTypeNotes
typeGITHUB_APP, PUBLIC_GIT, DOCKER_IMAGE, or null
repoFullNamestring, or nulle.g. acme/shop
gitUrlstring, or null
branchstring, or null
rootDirstring, or null
imagestring, or nullThe public image a DOCKER_IMAGE service runs.
imageCommandstring, or null

V1StaticSite

FieldTypeNotes
siteV1Service
deployV1Deploy

V1StaticUpload

FieldTypeNotes
uploadIdstring (uuid)
urlstringA presigned URL; it expires.
methodstringe.g. PUT
headersarray of V1UploadHeader
maxBytesnumber
expiresInSecondsnumber

V1UploadHeader

FieldTypeNotes
namestring
valuestring