Naijacloud
Docs

Services

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

Preview the build settings a repo would get

GET /v1/build-detection

Best effort: fields come back null when the repo cannot be inspected. The same detection runs again when the service is created.

Key scopes: READ and PLATFORM_API.

Query parameters

NameTypeRequiredNotes
gitUrlstringnoA public HTTPS git URL.
repoFullNamestringnoowner/name of a repo our GitHub App can see.
installationIdstringnoThe installation's id.
branchstringno
rootDirstringnoA folder inside the repo, e.g. "apps/api".

Returns

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

Every service across your workspaces

GET /v1/services

A flat list (id, name, project, type), ordered by project. search matches the service and project name.

Key scopes: READ and PLATFORM_API.

Query parameters

NameTypeRequiredNotes
limitintegernoRows per page. Ignored when a cursor is given.
cursorstringnoThe nextCursor of the previous page, unchanged.
searchstringnoOnly rows whose name contains this. Send the same value with every page of one walk.

Returns

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

Find the deployable apps in a repo

GET /v1/build-detection/apps

The members of a monorepo, a frontend next to a backend, or just the root app, each with its proposed build settings.

Key scopes: READ and PLATFORM_API.

Query parameters

NameTypeRequiredNotes
gitUrlstringnoA public HTTPS git URL.
repoFullNamestringnoowner/name of a repo our GitHub App can see.
installationIdstringnoThe installation's id.
branchstringno
rootDirstringnoA folder inside the repo, e.g. "apps/api".

Returns

bash
curl "https://api.naijacloud.com/v1/build-detection/apps" \ -H "Authorization: Bearer $NC_API_KEY"

Get a service

GET /v1/services/{serviceId}

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Returns

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

Rename a service, or change its build settings or source

PATCH /v1/services/{serviceId}

Each part is optional and applied in order: name, build, source. Build and source changes apply on the next deploy unless source.redeploy is true.

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Body

FieldTypeRequiredNotes
namestringnoA label only.
buildV1UpdateServiceBuildno
sourceV1UpdateServiceSourceno

Returns

bash
curl -X PATCH "https://api.naijacloud.com/v1/services/$SERVICE_ID" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"…","build":{"buildCommand":"…","startCommand":"…"}}'

Delete a service

DELETE /v1/services/{serviceId}

Irreversible: removes its containers, volumes, DNS and secrets — a database's data goes with it. Requires ADMIN.

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Returns

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

List the services in an environment

GET /v1/environments/{environmentId}/services

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
environmentIdstringyesThe environment's id.

Returns

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

Create a service and queue its first deploy

POST /v1/environments/{environmentId}/services

A web service, static site, cron job or database. Subject to the compute gate and to your balance for paid sizes.

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
environmentIdstringyesThe environment'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. api
typeWEB, STATIC, CRON, POSTGRES, MYSQL, MARIADB, MONGODB, REDIS, VALKEYyes
regionstringnoe.g. eu-west
tierFREE, PRO, STANDARD, STARTERnoInstance size. FREE uses the workspace free slot.
sourceTypeGITHUB_APP, PUBLIC_GIT, DOCKER_IMAGEnoOptional: inferred from image, gitUrl or repoFullName when omitted.
repoFullNamestringnoe.g. acme/shop
gitUrlstringnoe.g. https://github.com/acme/shop
imagestringnoe.g. ghcr.io/acme/api:1.2.3
imageCommandstringno
installationIdstringno
branchstringnoe.g. main
rootDirstringnoe.g. apps/api
monorepoStrategyISOLATED, WORKSPACEno
watchPathsarray of stringno
portnumberno
healthCheckPathstringnoe.g. /healthz
buildCommandstringno
startCommandstringno
runtimeVersionstringno
staticOutputDirstringnoe.g. dist
staticSpabooleanno
staticUploadIdstringno
staticIndexPathstringno
subdomainstringno
schedulestringnoCRON only: a five-field cron expression, in UTC.
commandstringnoCRON only: the command each run executes.
envVarsarray of V1EnvVarInputno
secretFilesarray of V1SecretFileInputno
dbNamestringno
dbUserstringno
dbPasswordstringno
connectionEnvNamestringno
injectConnectionUrlbooleanno

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/environments/$ENVIRONMENT_ID/services" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"name":"api","type":"WEB"}'

A database's connection details

GET /v1/services/{serviceId}/connection

The password is empty for a read-only role. 404 for a service that is not a database, or not provisioned yet.

Key scopes: READ and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Returns

bash
curl "https://api.naijacloud.com/v1/services/$SERVICE_ID/connection" \ -H "Authorization: Bearer $NC_API_KEY"

List a service's environment variables, by key

GET /v1/services/{serviceId}/env-vars

Values are blanked for a read-only role. Linked values come from a sibling database.

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

Create or replace environment variables

PATCH /v1/services/{serviceId}/env-vars

Upserts by key. Keys not listed are left as they are.

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Body

FieldTypeRequiredNotes
envVarsarray of V1EnvVarInputyesCreated or replaced by key. Keys not listed are kept.

Returns

bash
curl -X PATCH "https://api.naijacloud.com/v1/services/$SERVICE_ID/env-vars" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"envVars":[{"key":"API_URL","value":"…"}]}'

Bring a suspended service back on the same URL

POST /v1/services/{serviceId}/resume

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/services/$SERVICE_ID/resume" \ -H "Authorization: Bearer $NC_API_KEY"

List a service's secret files

GET /v1/services/{serviceId}/secret-files

Contents are blanked for a read-only role.

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

Create or replace one secret file

PUT /v1/services/{serviceId}/secret-files

Mounted into the container on the next deploy.

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Body

FieldTypeRequiredNotes
pathstringyese.g. config/credentials.json
contentstringyes

Returns

bash
curl -X PUT "https://api.naijacloud.com/v1/services/$SERVICE_ID/secret-files" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Content-Type: application/json" \ -d '{"path":"config/credentials.json","content":"…"}'

Remove one secret file by path

DELETE /v1/services/{serviceId}/secret-files

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Query parameters

NameTypeRequiredNotes
pathobjectyes

Returns

bash
curl -X DELETE "https://api.naijacloud.com/v1/services/$SERVICE_ID/secret-files?path=%5Bobject%20Object%5D" \ -H "Authorization: Bearer $NC_API_KEY"

Stop a service, keeping everything else

POST /v1/services/{serviceId}/suspend

Variables, domains, build settings, history and volumes are kept. Compute stops being billed.

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/services/$SERVICE_ID/suspend" \ -H "Authorization: Bearer $NC_API_KEY"

Remove one environment variable

DELETE /v1/services/{serviceId}/env-vars/{key}

Key scopes: WRITE and PLATFORM_API.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.
keystringyes

Returns

bash
curl -X DELETE "https://api.naijacloud.com/v1/services/$SERVICE_ID/env-vars/$KEY" \ -H "Authorization: Bearer $NC_API_KEY"

Types

V1Connection

FieldTypeNotes
schemestringe.g. postgresql
hoststringHost reachable from your other services.
portnumber
databasestring
usernamestring
passwordstringEmpty for a read-only role: it may see where the database is, not log in.
urlstringInternal connection URL.
externalUrlstring, or nullPublic URL, when external access is on.

V1DetectedApp

FieldTypeNotes
rootDirstringThe folder, "." for the repo root.
namestring
deployableboolean
buildV1DetectedBuild

V1DetectedBuild

FieldTypeNotes
runtimestring, or null
runtimeVersionstring, or null
frameworkstring, or null
packageManagerstring, or null
buildCommandstring, or null
startCommandstring, or null
portnumber, or null
staticOutputDirstring, or null
staticSpaboolean, or null
monorepoStrategyISOLATED, WORKSPACE, or null
workspaceNamestring, or null
watchPathsarray of string

V1DetectedRepoApps

FieldTypeNotes
statusOK, RATE_LIMITED, NOT_FOUND, NOT_GITHUB, FAILEDWhy a scan came back empty, when it did.
workspacebooleanWhether the repo is a workspace monorepo.
orchestratorstring, or null
truncatedboolean
appsarray of V1DetectedApp

V1EnvVar

FieldTypeNotes
keystringe.g. DATABASE_URL
valuestringBlanked for read-only roles. Linked values are read-only.
scopeALL, PROD, UAT, DEV
secretboolean
linkedbooleanLinked in from a sibling database's connection string; change it there.

V1EnvVarChange

FieldTypeNotes
envVarsarray of V1EnvVar
needsRedeploybooleanTrue when a redeploy is needed for the change to apply.
warningsarray of string

V1EnvVarInput

FieldTypeNotes
keystringe.g. API_URL
valuestring
scopeALL, PROD, UAT, DEVWhen the variable is available. Defaults to build and runtime.
secretboolean

V1Region

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

V1SecretFile

FieldTypeNotes
pathstringe.g. config/credentials.json
contentstringBlanked for read-only roles.

V1SecretFileChange

FieldTypeNotes
secretFilesarray of V1SecretFile
needsRedeployboolean

V1SecretFileInput

FieldTypeNotes
pathstringe.g. config/credentials.json
contentstring

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

V1ServiceSummary

FieldTypeNotes
idstring (uuid)
namestring
projectNamestring
typeWEB, STATIC, CRON, POSTGRES, MYSQL, MARIADB, MONGODB, REDIS, VALKEY

V1UpdateServiceBuild

FieldTypeNotes
buildCommandstring
startCommandstring
runtimeVersionstring
rootDirstring
portnumber
healthCheckPathstring
monorepoStrategyISOLATED, WORKSPACE
staticOutputDirstring
staticSpaboolean
watchPathsarray of string

V1UpdateServiceSource

FieldTypeNotes
sourceTypeGITHUB_APP, PUBLIC_GIT, DOCKER_IMAGE
repoFullNamestring
installationIdstring
gitUrlstring
branchstring
imagestring
imageCommandstring
redeploybooleanDeploy from the new source straight away.