Reference
View as MarkdownRoutes API
5 operations. Every call needs a session cookie or an Authorization: Bearer nct_… token unless marked Public. Conventions, errors and scopes
/environments/{environmentId}/routesCreate a route service (staged until deployed)
A route service has no container: it publishes an external upstream (http), or exposes a tcp/udp port of a server (optionally for a managed service). Needs projects:write and proxy:write. The server is required. 422 codes: invalid_config, invalid_listen_port, upstream_denied (the server's upstream policy), invalid_upstream, agent_too_old. 409 port_in_use when another route holds the listen port, domain_conflict for a taken hostname.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Client-chosen key (<=255 chars). A retry with the same key replays the original response for 24 hours. |
environmentIdrequired | path | string |
Request body · application/json · required
- allowCidrsstring[]tcp routes: client networks allowed; UDP cannot be restricted
- denyCidrsstring[]tcp routes: client networks refused first, even when allowCidrs admits them; UDP cannot be restricted
- DomainInput[] | nullHostnames of an http route (staged; refine each with PATCH /domains/{id})
- healthPathstringEnables a proxy health check on this path
- insecureSkipVerifybooleanhttps upstreams: do not verify the upstream certificate
- listenPortinteger (int64)tcp/udp routes: host port on the server (1024-65535)
- namestringrequired
- openToInternetbooleantcp/udp routes: required when allowCidrs is empty
- passHostbooleanfalse rewrites the Host header to the upstream's (default true)
- protocolenum: http | tcp | udprequired
- proxyProtocolenum: 0 | 1 | 2tcp routes: PROXY protocol version sent to the upstream
- schemeenum: http | httpshttp routes: scheme used towards the upstream
- serverIdstringrequiredThe server that publishes the route (required)
- serverNamestringhttps upstreams: TLS server name
- UpstreamInput[]1-20 upstreams
- verifySkipbooleanSkip the post-deploy HTTP verification (upstreams that legitimately answer 5xx)
Response 201 · Created · application/json
- 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 | nullrequirednew | edited | null
- stalebooleanrequired
- TailnetViewrequired
- updatedAtstring (date-time)required
- VolumeRef[] | nullrequired
401Unauthorized403Forbidden404Not Found409Conflictport_in_use422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/routes/{routeId}Get a route service
| Parameter | In | Type | Description |
|---|---|---|---|
routeIdrequired | path | string |
Response 200 · OK · application/json
- 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 | nullrequirednew | edited | null
- stalebooleanrequired
- TailnetViewrequired
- updatedAtstring (date-time)required
- VolumeRef[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/routes/{routeId}Update a route service (staged until deployed)
Requires If-Match: "<generation>". The protocol and server cannot be changed. Same 4xx codes as create; 412 generation_conflict for a stale generation.
| Parameter | In | Type | Description |
|---|---|---|---|
routeIdrequired | path | string | |
If-Match | header | string | The ETag (generation) from the last GET, e.g. "3". Required. |
Request body · application/json · required
- allowCidrsstring[]tcp routes: client networks allowed; UDP cannot be restricted
- denyCidrsstring[]tcp routes: client networks refused first, even when allowCidrs admits them; UDP cannot be restricted
- healthPathstringEnables a proxy health check on this path
- insecureSkipVerifybooleanhttps upstreams: do not verify the upstream certificate
- listenPortinteger (int64)tcp/udp routes: host port on the server (1024-65535)
- namestring
- openToInternetbooleantcp/udp routes: required when allowCidrs is empty
- passHostbooleanfalse rewrites the Host header to the upstream's (default true)
- proxyProtocolenum: 0 | 1 | 2tcp routes: PROXY protocol version sent to the upstream
- schemeenum: http | httpshttp routes: scheme used towards the upstream
- serverNamestringhttps upstreams: TLS server name
- UpstreamInput[]1-20 upstreams
- verifySkipbooleanSkip the post-deploy HTTP verification (upstreams that legitimately answer 5xx)
Response 200 · OK · application/json
- 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 | nullrequirednew | edited | null
- stalebooleanrequired
- TailnetViewrequired
- updatedAtstring (date-time)required
- VolumeRef[] | nullrequired
401Unauthorized403Forbidden404Not Found409Conflict412Precondition Failedgeneration_conflict422Unprocessable Entity428Precondition Required500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/routes/{routeId}Delete a route service
Frees the listen port and removes the route from its server's table (a sync is queued atomically). DELETE /services/{id} does the same.
| Parameter | In | Type | Description |
|---|---|---|---|
routeIdrequired | path | string |
Response 204 · No Content
No body.
401Unauthorized403Forbidden404Not Found409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/servers/{serverId}/portsList the tcp/udp ports route services hold on a server
Includes staged (not yet deployed) routes. Holder names of projects the caller cannot see are omitted.
| Parameter | In | Type | Description |
|---|---|---|---|
serverIdrequired | path | string |
Response 200 · OK · application/json
- PortView[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.