Skip to content

Services API

Services.

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

GET/environments/{environmentId}/services

List an environment's services

ParameterInTypeDescription
environmentIdrequiredpathstring
cursorquerystringOpaque cursor from a previous page's nextCursor
limitqueryinteger (int64)Page size (default 50, max 200)
Response 200 · OK · application/json
PageServiceView
  • ServiceView[] | nullrequired
  • nextCursorstring
    Present when more items exist
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

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

POST/environments/{environmentId}/services

Create a service

Creating a service stages its configuration; nothing runs until it is deployed. Managed databases are created with POST /environments/{environmentId}/databases. A Compose stack is kind: stack, sourceType: compose with config.stack.compose; the server derives config.stack.components. 422 invalid_compose (details.violations) when the compose file does not parse, uses something stacks do not support, or breaks the safe allow-list while the service's server does not have Unrestricted Compose.

ParameterInTypeDescription
Idempotency-KeyheaderstringClient-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours.
environmentIdrequiredpathstring
Request body · application/json · required
CreateServiceInputBody
  • ConfigInput
  • gitTokenstring
    Write-only access token for private HTTPS repositories
  • kindenum: app | worker | database | stack
  • namestringrequired
  • RegistryAuthInput
  • serverIdstring
  • sourceTypeenum: image | git | compose
Response 201 · Created · application/json
ServiceView
  • appliedGenerationinteger (int64)required
  • Configrequired
  • createdAtstring (date-time)required
  • currentDeploymentIdstringrequired
  • ReleaseRefrequired
  • desiredStateenum: running | stoppedrequired
  • DomainView[] | nullrequired
  • environmentIdstringrequired
  • generationinteger (int64)required
  • GitRefrequired
  • gitTokenSetbooleanrequired
  • hasStagedChangesbooleanrequired
  • idstringrequired
  • kindenum: app | worker | database | route | stackrequired
  • DeploymentRefrequired
  • MaintenanceViewrequired
  • namestringrequired
  • NetworkRef[] | nullrequired
  • ObservedViewrequired
  • observedAtstring (date-time) | nullrequired
  • PendingChangeCountsrequired
  • privateHoststringrequired
  • projectIdstringrequired
  • registryAuthSetbooleanrequired
  • ScalingViewrequired
  • ServerRefrequired
  • serverIdstringrequired
  • slugstringrequired
  • sourceTypeenum: image | git | external | composerequired
  • stagedKindstring | nullrequired
    new | edited | null
  • stalebooleanrequired
  • TailnetViewrequired
  • updatedAtstring (date-time)required
  • VolumeRef[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Unprocessable Entityinvalid_compose
  • 500Internal Server Error

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

GET/instance/docker-options

Get the Docker option catalog

What the Docker options accept: capability lists, the curated sysctls, reserved label prefixes, stop signals and which options work only on an unrestricted server.

Response 200 · OK · application/json
DockerOptionsCatalog
  • allowedSysctlsstring[] | nullrequired
    Container sysctls (IPC and network namespaced) a service may set
  • gpuCapabilitiesstring[] | nullrequired
  • hostSysctlKeysstring[] | nullrequired
    Host kernel parameters a service may declare as requirements (hostSysctls)
  • knownCapabilitiesstring[] | nullrequired
    Capability names capDrop accepts besides ALL
  • reservedLabelsstring[] | nullrequired
    Label prefixes services cannot set
  • safeCapabilitiesstring[] | nullrequired
  • stopSignalsstring[] | nullrequired
  • unrestrictedCapabilitiesstring[] | nullrequired
    Capabilities that need an unrestricted server
  • unrestrictedFieldsstring[] | nullrequired
    Options that work only on an unrestricted server
  • warnCapabilitiesstring[] | nullrequired
    Safe-listed capabilities the UI warns about
Errors
  • 401Unauthorized
  • 403Forbidden
  • 500Internal Server Error

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

GET/services/{serviceId}

Get a service

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 200 · OK · application/json
ServiceView
  • appliedGenerationinteger (int64)required
  • Configrequired
  • createdAtstring (date-time)required
  • currentDeploymentIdstringrequired
  • ReleaseRefrequired
  • desiredStateenum: running | stoppedrequired
  • DomainView[] | nullrequired
  • environmentIdstringrequired
  • generationinteger (int64)required
  • GitRefrequired
  • gitTokenSetbooleanrequired
  • hasStagedChangesbooleanrequired
  • idstringrequired
  • kindenum: app | worker | database | route | stackrequired
  • DeploymentRefrequired
  • MaintenanceViewrequired
  • namestringrequired
  • NetworkRef[] | nullrequired
  • ObservedViewrequired
  • observedAtstring (date-time) | nullrequired
  • PendingChangeCountsrequired
  • privateHoststringrequired
  • projectIdstringrequired
  • registryAuthSetbooleanrequired
  • ScalingViewrequired
  • ServerRefrequired
  • serverIdstringrequired
  • slugstringrequired
  • sourceTypeenum: image | git | external | composerequired
  • stagedKindstring | nullrequired
    new | edited | null
  • stalebooleanrequired
  • TailnetViewrequired
  • updatedAtstring (date-time)required
  • VolumeRef[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

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

PATCH/services/{serviceId}

Update a service's configuration (staged until deployed)

Requires If-Match: "<generation>". A stale value returns 412 generation_conflict. Every effective change increments the generation; the change takes effect on the next deployment.

ParameterInTypeDescription
serviceIdrequiredpathstring
If-MatchheaderstringThe ETag (generation) from the last GET, e.g. "3". Required.
Request body · application/json · required
UpdateServiceInputBody
  • ConfigInput
  • gitTokenstring
    Write-only; an empty string clears the token
  • namestring
  • RegistryAuthInput
  • serverIdstring
Response 200 · OK · application/json
ServiceView
  • appliedGenerationinteger (int64)required
  • Configrequired
  • createdAtstring (date-time)required
  • currentDeploymentIdstringrequired
  • ReleaseRefrequired
  • desiredStateenum: running | stoppedrequired
  • DomainView[] | nullrequired
  • environmentIdstringrequired
  • generationinteger (int64)required
  • GitRefrequired
  • gitTokenSetbooleanrequired
  • hasStagedChangesbooleanrequired
  • idstringrequired
  • kindenum: app | worker | database | route | stackrequired
  • DeploymentRefrequired
  • MaintenanceViewrequired
  • namestringrequired
  • NetworkRef[] | nullrequired
  • ObservedViewrequired
  • observedAtstring (date-time) | nullrequired
  • PendingChangeCountsrequired
  • privateHoststringrequired
  • projectIdstringrequired
  • registryAuthSetbooleanrequired
  • ScalingViewrequired
  • ServerRefrequired
  • serverIdstringrequired
  • slugstringrequired
  • sourceTypeenum: image | git | external | composerequired
  • stagedKindstring | nullrequired
    new | edited | null
  • stalebooleanrequired
  • TailnetViewrequired
  • updatedAtstring (date-time)required
  • VolumeRef[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 412Precondition Failedgeneration_conflict
  • 422Unprocessable Entity
  • 428Precondition Required
  • 500Internal Server Error

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

DELETE/services/{serviceId}

Delete a service

Requires confirm=<slug>. A deployed service's container is removed from its server; volumes are kept unless deleteVolumes=true.

ParameterInTypeDescription
serviceIdrequiredpathstring
confirmquerystringMust equal the service slug
deleteVolumesquerybooleanAlso remove the service's Docker volumes (data is lost)
Response 204 · No Content

No body.

Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Unprocessable Entity
  • 500Internal Server Error

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

POST/services/{serviceId}/clone

Clone a service

Creates a staged copy of a service in the same or another environment of the team; nothing runs until it is deployed. The clone gets the source's configuration (Docker options included), variables, volume definitions and, in the same environment, its outgoing links. Secrets are copied sealed and generated values are generated again. Volumes are new and empty (the data is not copied). A managed database is created new and empty with new credentials: restore a dump into it. Domains are dropped (default) or cloned with a suffix; 409 domain_conflict when a suffixed hostname is taken. Needs write access to the source and the target environment. Route services, Compose stacks and read replicas are not cloned (422 not_applicable). dryRun returns the plan and changes nothing; the response lists variable references that do not resolve in the target environment.

ParameterInTypeDescription
Idempotency-KeyheaderstringClient-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours.
serviceIdrequiredpathstring
Request body · application/json · required
CloneServiceInputBody
  • domainSuffixstring
    Default: -copy in the same environment, -<environment slug> in another one
  • domainsenum: drop | suffix
    drop (default) clones no domain; suffix clones each public domain with domainSuffix added to its first label
  • dryRunboolean
    Report what the clone would do and change nothing
  • environmentIdstring
    Environment of the clone (default: the source's environment)
  • namestring
    Name of the clone (default: the source's name plus ' copy' in the same environment)
  • serverIdstring
    Server of the clone (default: the source's server)
Response 200 · OK · application/json
CloneResult
  • CloneDomainOutcome[] | nullrequired
  • dryRunbooleanrequired
  • CloneEnvironmentRef
  • linksinteger (int64)required
  • ReferenceFinding[] | nullrequired
  • ServiceView
  • ClonedService[] | nullrequired
  • sharedVariablesinteger (int64)required
  • CloneSkipped[] | nullrequired
  • warningsstring[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflictdomain_conflict
  • 422Unprocessable Entitynot_applicable
  • 500Internal Server Error

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

GET/services/{serviceId}/deploy-hook

Get a service's deploy hook

Whether the hook is on, when its secret was created, and what the last call did. The secret and the URL are never returned here; urlPattern shows the URL with a placeholder.

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 200 · OK · application/json
DeployHookView
  • enabledbooleanrequired
  • imagestringrequired
  • isProductionbooleanrequired
  • lastCalledAtstring (date-time) | nullrequired
  • lastOutcomeenum: | deploying | queued | ignoredrequired
  • queuedbooleanrequired
  • rateLimitstringrequired
  • secretSetAtstring (date-time) | nullrequired
  • serviceIdstringrequired
  • urlstring
    The complete hook URL, shown once when the hook is enabled or rotated; never returned again
  • urlPatternstringrequired
    The hook URL with <secret> in place of the secret
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

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

PUT/services/{serviceId}/deploy-hook

Turn a service's deploy hook on or off

Turning the hook on creates a secret (at least 256 bits, stored only as a hash) and returns the complete url once; POST /hooks/deploy/<serviceId>/<secret> then deploys the service like a manual deploy, with trigger deploy_hook. Turning it off deletes the secret, so enabling again gives a new URL. Needs deployments:write.

ParameterInTypeDescription
serviceIdrequiredpathstring
Request body · application/json · required
DeployHookSetting
  • enabledbooleanrequired
    true turns the hook on (new secret, URL returned once); false turns it off and deletes the secret
Response 200 · OK · application/json
DeployHookView
  • enabledbooleanrequired
  • imagestringrequired
  • isProductionbooleanrequired
  • lastCalledAtstring (date-time) | nullrequired
  • lastOutcomeenum: | deploying | queued | ignoredrequired
  • queuedbooleanrequired
  • rateLimitstringrequired
  • secretSetAtstring (date-time) | nullrequired
  • serviceIdstringrequired
  • urlstring
    The complete hook URL, shown once when the hook is enabled or rotated; never returned again
  • urlPatternstringrequired
    The hook URL with <secret> in place of the secret
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

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

POST/services/{serviceId}/deploy-hook/rotate

Rotate a service's deploy hook secret

Replaces the secret of an enabled hook; the old URL stops working at once. The new url is returned once. 409 deploy_hook_disabled when the hook is off. Needs deployments:write.

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 200 · OK · application/json
DeployHookView
  • enabledbooleanrequired
  • imagestringrequired
  • isProductionbooleanrequired
  • lastCalledAtstring (date-time) | nullrequired
  • lastOutcomeenum: | deploying | queued | ignoredrequired
  • queuedbooleanrequired
  • rateLimitstringrequired
  • secretSetAtstring (date-time) | nullrequired
  • serviceIdstringrequired
  • urlstring
    The complete hook URL, shown once when the hook is enabled or rotated; never returned again
  • urlPatternstringrequired
    The hook URL with <secret> in place of the secret
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflictdeploy_hook_disabled
  • 422Unprocessable Entity
  • 500Internal Server Error

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

GET/services/{serviceId}/git

Get a service's repository link

linked: false when the service has no link.

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 200 · OK · application/json
GitLinkView
  • autoDeploybooleanrequired
  • branchstringrequired
  • connectionIdstringrequired
  • connectionNamestringrequired
  • linkedbooleanrequired
  • providerenum: github | gitlab | gitea | forgejo | bitbucket
  • queuedCommitstringrequired
  • repostringrequired
  • repoUrlstringrequired
  • watchPathsstring[] | nullrequired
  • HookStatusViewrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

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

PUT/services/{serviceId}/git

Link a service to a repository and set auto-deploy

Points the service's clone URL and branch at the repository (a staged change when they differ) and stores the auto-deploy settings, which are operational: they are applied immediately, never staged and never rolled back. A push to the branch deploys the service (trigger git_push) when a changed file matches the watch paths; a push during a running deployment is queued and the newest one deploys next. Webhooks are registered for GitLab, Gitea and Forgejo; GitHub uses the App's webhook and Bitbucket a webhook you create (see the connection). The webhook field reports the state.

ParameterInTypeDescription
serviceIdrequiredpathstring
Request body · application/json · required
LinkInputBody
  • autoDeployboolean
    Deploy on every push to the branch (default: keep the current setting, true for a new link)
  • branchstring
    Defaults to the service's branch for the same repository, else the repository's default branch
  • connectionIdstringrequired
  • repostringrequired
    owner/name (or a clone URL)
  • watchPathsstring[]
    Monorepo watch paths: globs relative to the repository root ('apps/api/**', 'packages/*/src', '!**/*.md'); a push only deploys when a changed file matches. Empty watches everything.
Response 200 · OK · application/json
GitLinkView
  • autoDeploybooleanrequired
  • branchstringrequired
  • connectionIdstringrequired
  • connectionNamestringrequired
  • linkedbooleanrequired
  • providerenum: github | gitlab | gitea | forgejo | bitbucket
  • queuedCommitstringrequired
  • repostringrequired
  • repoUrlstringrequired
  • watchPathsstring[] | nullrequired
  • HookStatusViewrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 412Precondition Failed
  • 422Unprocessable Entity
  • 500Internal Server Error
  • 502Bad Gateway

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

DELETE/services/{serviceId}/git

Unlink a service from its repository

Stops auto-deploy. The clone URL and branch stay in the service's config.

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 204 · No Content

No body.

Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

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

GET/services/{serviceId}/incidents

List a service's health incidents

Stretches of time in which the service crashed, was unhealthy or restart-looped, newest first. An open incident has no resolvedAt.

ParameterInTypeDescription
serviceIdrequiredpathstring
limitqueryinteger (int64)Default 50.
Response 200 · OK · application/json
ListIncidentsOutputBody
  • IncidentView[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 422Unprocessable Entity
  • 500Internal Server Error

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

PUT/services/{serviceId}/maintenance

Switch a service's maintenance mode

While enabled, the proxy answers every domain of the service with HTTP 503, a Retry-After header and the maintenance page (the same animated page as the automatic error pages), instead of reaching the service. It takes effect immediately, without a deployment, and keeps working through deployments of the service. It is an operational setting: never staged and never rolled back. A deployed service's server is sent the new route table; an undeployed service applies the setting with its first deployment. Idempotent: repeating the same request changes nothing. Switching off keeps the stored text for the next time. tcp/udp route services cannot be put into maintenance (422 maintenance_unsupported).

ParameterInTypeDescription
Idempotency-KeyheaderstringClient-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours.
serviceIdrequiredpathstring
Request body · application/json · required
SetMaintenanceInputBody
  • enabledbooleanrequired
    true puts the service into maintenance, false takes it out
  • etastring (date-time)
    When the service is expected back (future). Shown on the page and sent as Retry-After. Only used when enabling.
  • messagestring
    Page message (plain text); empty shows the default copy. Only used when enabling.
  • titlestring
    Page title; empty shows 'Down for maintenance'. Only used when enabling.
Response 200 · OK · application/json
ServiceView
  • appliedGenerationinteger (int64)required
  • Configrequired
  • createdAtstring (date-time)required
  • currentDeploymentIdstringrequired
  • ReleaseRefrequired
  • desiredStateenum: running | stoppedrequired
  • DomainView[] | nullrequired
  • environmentIdstringrequired
  • generationinteger (int64)required
  • GitRefrequired
  • gitTokenSetbooleanrequired
  • hasStagedChangesbooleanrequired
  • idstringrequired
  • kindenum: app | worker | database | route | stackrequired
  • DeploymentRefrequired
  • MaintenanceViewrequired
  • namestringrequired
  • NetworkRef[] | nullrequired
  • ObservedViewrequired
  • observedAtstring (date-time) | nullrequired
  • PendingChangeCountsrequired
  • privateHoststringrequired
  • projectIdstringrequired
  • registryAuthSetbooleanrequired
  • ScalingViewrequired
  • ServerRefrequired
  • serverIdstringrequired
  • slugstringrequired
  • sourceTypeenum: image | git | external | composerequired
  • stagedKindstring | nullrequired
    new | edited | null
  • stalebooleanrequired
  • TailnetViewrequired
  • updatedAtstring (date-time)required
  • VolumeRef[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entitymaintenance_unsupported
  • 500Internal Server Error

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

GET/services/{serviceId}/maintenance/preview

Preview a service's maintenance page

Returns the self-contained HTML page exactly as the proxy serves it (status 200 here; the proxy answers 503). Optional query parameters preview unsaved text.

ParameterInTypeDescription
serviceIdrequiredpathstring
draftquerybooleanPreview the title, message and eta below instead of the stored ones (empty values show the defaults)
titlequerystring
messagequerystring
etaquerystringRFC 3339 time
Response 200 · The maintenance page · text/html
string
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

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

POST/services/{serviceId}/move

Move a service to another environment

Stages a move of the service to another environment (of any project of the team): it keeps running where it is until its next deployment, which joins the new environment's network and resolves its variables there. Domains, volumes and data stay with the service. References are checked first: variables of the service that point at services staying behind, and variables of other services that point at the moved one, break. The move is refused with 409 move_blocked (details.plan) unless force is set; links on the canvas are removed, and the services that referenced the moved one are marked as having staged changes. A service in a replica group or with a cross-server link cannot be moved (409 move_blocked); route services and Compose stacks are not movable (422 not_applicable). dryRun returns the plan and changes nothing. Moving a service out of or into a production environment needs approval for guarded clients.

ParameterInTypeDescription
serviceIdrequiredpathstring
Request body · application/json · required
MoveServiceInputBody
  • dryRunboolean
    Report the plan (references, links, slug) and change nothing
  • environmentIdstringrequired
    The environment to move the service to
  • forceboolean
    Move even though references from or to the service break
Response 200 · OK · application/json
MoveResult
  • appliedbooleanrequired
  • blockedbooleanrequired
  • dryRunbooleanrequired
  • CloneEnvironmentRefrequired
  • MoveIncomingRef[] | nullrequired
  • linksstring[] | nullrequired
  • ReferenceFinding[] | nullrequired
  • ServiceView
  • slugstringrequired
  • slugChangedbooleanrequired
  • CloneEnvironmentRefrequired
  • warningsstring[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflictmove_blockedmove_blocked
  • 422Unprocessable Entitynot_applicable
  • 500Internal Server Error

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

GET/services/{serviceId}/pending-changes

Staged changes not yet deployed

Field-level differences between the service's configuration and its current release. Secret values are masked.

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

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

DELETE/services/{serviceId}/pending-changes/{field}

Discard one staged change

Reverts a single field listed by pending-changes (config.<path>, server, variables.<KEY>, domains.<host>, volumes.<name>) to the state of the current release and advances the generation. 404 when the field is not pending. Returns the updated service.

ParameterInTypeDescription
serviceIdrequiredpathstring
fieldrequiredpathstringA pending-changes field: config.<path>, server, variables.<KEY>, domains.<host> or volumes.<name>
Response 200 · OK · application/json
ServiceView
  • appliedGenerationinteger (int64)required
  • Configrequired
  • createdAtstring (date-time)required
  • currentDeploymentIdstringrequired
  • ReleaseRefrequired
  • desiredStateenum: running | stoppedrequired
  • DomainView[] | nullrequired
  • environmentIdstringrequired
  • generationinteger (int64)required
  • GitRefrequired
  • gitTokenSetbooleanrequired
  • hasStagedChangesbooleanrequired
  • idstringrequired
  • kindenum: app | worker | database | route | stackrequired
  • DeploymentRefrequired
  • MaintenanceViewrequired
  • namestringrequired
  • NetworkRef[] | nullrequired
  • ObservedViewrequired
  • observedAtstring (date-time) | nullrequired
  • PendingChangeCountsrequired
  • privateHoststringrequired
  • projectIdstringrequired
  • registryAuthSetbooleanrequired
  • ScalingViewrequired
  • ServerRefrequired
  • serverIdstringrequired
  • slugstringrequired
  • sourceTypeenum: image | git | external | composerequired
  • stagedKindstring | nullrequired
    new | edited | null
  • stalebooleanrequired
  • TailnetViewrequired
  • updatedAtstring (date-time)required
  • VolumeRef[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Unprocessable Entity
  • 500Internal Server Error

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

POST/services/{serviceId}/restart

Restart the running container

Queues a restart on the service's server. It completes when the agent acknowledges it.

ParameterInTypeDescription
Idempotency-KeyheaderstringClient-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours.
serviceIdrequiredpathstring
Response 202 · Accepted · application/json
ActionResult
  • commandIdstringrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Unprocessable Entity
  • 500Internal Server Error

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

PUT/services/{serviceId}/scaling

Set a service's replica count and autoscaling

Runs the service on N replicas on its server (1-10) and/or turns CPU autoscaling on. Only stateless services qualify: no volumes, an HTTP port and kind other than database (422 replicas_require_stateless). A manual replicas value while autoscaling is enabled returns 409 autoscaling_enabled. The change applies immediately, without a deployment and without rebuilding: a deployed service is scaled through the agent, an undeployed one only stores the setting. It is never a staged change.

ParameterInTypeDescription
Idempotency-KeyheaderstringClient-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours.
serviceIdrequiredpathstring
Request body · application/json · required
SetScalingInputBody
  • AutoscalingPatch
  • replicasinteger (int64)
    Desired replica count, 1-10. Not allowed while autoscaling is enabled.
Response 200 · OK · application/json
ServiceView
  • appliedGenerationinteger (int64)required
  • Configrequired
  • createdAtstring (date-time)required
  • currentDeploymentIdstringrequired
  • ReleaseRefrequired
  • desiredStateenum: running | stoppedrequired
  • DomainView[] | nullrequired
  • environmentIdstringrequired
  • generationinteger (int64)required
  • GitRefrequired
  • gitTokenSetbooleanrequired
  • hasStagedChangesbooleanrequired
  • idstringrequired
  • kindenum: app | worker | database | route | stackrequired
  • DeploymentRefrequired
  • MaintenanceViewrequired
  • namestringrequired
  • NetworkRef[] | nullrequired
  • ObservedViewrequired
  • observedAtstring (date-time) | nullrequired
  • PendingChangeCountsrequired
  • privateHoststringrequired
  • projectIdstringrequired
  • registryAuthSetbooleanrequired
  • ScalingViewrequired
  • ServerRefrequired
  • serverIdstringrequired
  • slugstringrequired
  • sourceTypeenum: image | git | external | composerequired
  • stagedKindstring | nullrequired
    new | edited | null
  • stalebooleanrequired
  • TailnetViewrequired
  • updatedAtstring (date-time)required
  • VolumeRef[] | nullrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflictautoscaling_enabled
  • 422Unprocessable Entityreplicas_require_stateless
  • 500Internal Server Error

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

POST/services/{serviceId}/stop

Stop the running container

ParameterInTypeDescription
serviceIdrequiredpathstring
Response 202 · Accepted · application/json
ActionResult
  • commandIdstringrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Unprocessable Entity
  • 500Internal Server Error

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

POST/services/{serviceId}/tailnet/reprovision

Re-provision the service's tailnet node

Deletes the service's device from the tailnet and re-creates it with a fresh single-use key and a fresh state volume. Use it when the node needs attention (the device was removed in the admin console or its key was rejected). The device gets a new tailnet IP.

ParameterInTypeDescription
Idempotency-KeyheaderstringClient-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours.
serviceIdrequiredpathstring
Response 202 · Accepted · application/json
ReprovisionResult
  • commandIdstringrequired
Errors
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Unprocessable Entity
  • 500Internal Server Error

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