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
| Name | Type | Required | Notes |
|---|---|---|---|
Idempotency-Key | string | no | Any 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
| Field | Type | Required | Notes |
|---|---|---|---|
indexPath | string | no | The page to serve at "/" when it is not index.html. |
spaFallback | boolean | no | Serve the index page for unknown paths (single-page apps). |
uploadId | string (uuid) | yes | |
environmentId | string (uuid) | no | The environment to create the site in. Omitted, it lands in the workspace's static-sites project. |
name | string | no |
Returns
201withV1StaticSite.
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
| Field | Type | Required | Notes |
|---|---|---|---|
filename | string | yes | e.g. "site.zip" or "index.html". |
contentType | string | yes | e.g. "application/zip" or "text/html". |
sizeBytes | number | yes |
Returns
201withV1StaticUpload.
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
| Name | Type | Required | Notes |
|---|---|---|---|
serviceId | string | yes | The service's id. |
Headers
| Name | Type | Required | Notes |
|---|---|---|---|
Idempotency-Key | string | no | Any 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
| Field | Type | Required | Notes |
|---|---|---|---|
indexPath | string | no | The page to serve at "/" when it is not index.html. |
spaFallback | boolean | no | Serve the index page for unknown paths (single-page apps). |
uploadId | string (uuid) | yes |
Returns
200withV1Deploy.
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
| Field | Type | Notes |
|---|---|---|
id | string (uuid) | |
serviceId | string (uuid) | |
status | QUEUED, BUILDING, TESTING, DEPLOYING, RUNNING, FAILED, CANCELLED, REPLACED, SUPERSEDED | |
trigger | PUSH, MANUAL, ROLLBACK, FIRST_DEPLOY, SYSTEM, or null | What started it: a push, a person, a rollback, … |
branch | string, or null | |
commitSha | string, or null | |
commitMessage | string, or null | |
authorName | string, or null | |
buildCommand | string, or null | |
startCommand | string, or null | |
error | string, or null | Why it failed, written for you. |
errorCode | MISSING_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 | |
durationMs | number, or null | From the start of work (not queueing) to the end, in ms. |
createdAt | string (date-time) | |
startedAt | string (date-time), or null | |
finishedAt | string (date-time), or null |
V1Region
| Field | Type | Notes |
|---|---|---|
key | string | e.g. eu-west |
label | string | e.g. Europe |
V1Service
| Field | Type | Notes |
|---|---|---|
id | string (uuid) | |
environmentId | string (uuid) | |
name | string | e.g. api |
type | WEB, STATIC, CRON, POSTGRES, MYSQL, MARIADB, MONGODB, REDIS, VALKEY | |
status | PROVISIONING, ACTIVE, ERROR | |
tier | FREE, PRO, STANDARD, STARTER, or null | |
url | string, or null | The platform URL. Null for databases and before placement. e.g. https://api-shop.naijacloud.app |
region | V1Region, or null | |
runtime | string, or null | e.g. node |
framework | string, or null | e.g. nextjs |
isStatic | boolean | |
port | number, or null | |
healthCheckPath | string, or null | |
memoryMb | number | |
cpuMillicores | number | |
storageLimitMb | number, or null | |
source | V1ServiceSource | |
build | V1ServiceBuild | |
cron | V1ServiceCron, or null | Set for CRON services only. |
suspension | NONE, USER, BILLING, ABUSE | Why nothing is running, if anything: NONE, USER (suspended by a person), BILLING or ABUSE. |
health | HEALTHY, CRASH_LOOPING, STOPPED, MISSING, UNKNOWN | |
lastDeployedAt | string (date-time), or null | |
createdAt | string (date-time) | |
updatedAt | string (date-time) |
V1ServiceBuild
| Field | Type | Notes |
|---|---|---|
buildCommand | string, or null | |
startCommand | string, or null | |
runtimeVersion | string, or null | e.g. 22 |
staticOutputDir | string, or null | |
staticSpa | boolean | |
monorepoStrategy | ISOLATED, WORKSPACE, or null | |
watchPaths | array of string, or null |
V1ServiceCron
| Field | Type | Notes |
|---|---|---|
schedule | string, or null | e.g. */15 * * * * |
command | string, or null | |
suspended | boolean | Scheduled runs are paused. |
V1ServiceSource
| Field | Type | Notes |
|---|---|---|
type | GITHUB_APP, PUBLIC_GIT, DOCKER_IMAGE, or null | |
repoFullName | string, or null | e.g. acme/shop |
gitUrl | string, or null | |
branch | string, or null | |
rootDir | string, or null | |
image | string, or null | The public image a DOCKER_IMAGE service runs. |
imageCommand | string, or null |
V1StaticSite
V1StaticUpload
| Field | Type | Notes |
|---|---|---|
uploadId | string (uuid) | |
url | string | A presigned URL; it expires. |
method | string | e.g. PUT |
headers | array of V1UploadHeader | |
maxBytes | number | |
expiresInSeconds | number |
V1UploadHeader
| Field | Type | Notes |
|---|---|---|
name | string | |
value | string |