Reference
View as MarkdownFleet API
6 operations. Every call needs a session cookie or an Authorization: Bearer nct_… token unless marked Public. Conventions, errors and scopes
/fleetCapacity and placement of every server
Per server: resource usage, the memory promised through service limits (committed), whether that exceeds the host, and the services placed on it (limited to the caller's projects).
Response 200 · OK · application/json
- FleetServer[] | nullrequired
- FleetTotalsrequired
401Unauthorized403Forbidden500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/servers/{serverId}/drainProgress of a server's drain
| Parameter | In | Type | Description |
|---|---|---|---|
serverIdrequired | path | string |
Response 200 · OK · application/json
- DrainViewrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/servers/{serverId}/drainDrain a server
Marks the server as draining (nothing new is placed on it) and moves its services one at a time: each move changes the placement and deploys the service to the target; the old container is removed once the new one is live. The first failed move stops the drain and leaves the remaining services untouched. Scopes: servers:write, deployments:write, projects:write.
| 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. |
serverIdrequired | path | string |
Request body · application/json · required
- confirmStatefulbooleanRequired when a moved service has volumes or is a database: their data is not copied
- MoveBody[] | nullrequiredWhere every service on the server goes; each service must appear exactly once
Response 202 · Accepted · application/json
- actorLabelstringrequired
- cancelRequestedbooleanrequired
- createdAtstring (date-time)required
- finishedAtstring (date-time) | nullrequired
- idstringrequired
- messagestringrequired
- Move[] | nullrequired
- serverIdstringrequired
- stateenum: running | completed | failed | canceledrequired
401Unauthorized403Forbidden404Not Found409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/servers/{serverId}/drain/cancelStop a drain after the move in flight
The drain ends after the current move. The server returns to none when nothing was moved yet, otherwise it becomes failed with "Canceled after N of M moves".
| Parameter | In | Type | Description |
|---|---|---|---|
serverIdrequired | path | string |
Response 200 · OK · application/json
- actorLabelstringrequired
- cancelRequestedbooleanrequired
- createdAtstring (date-time)required
- finishedAtstring (date-time) | nullrequired
- idstringrequired
- messagestringrequired
- Move[] | nullrequired
- serverIdstringrequired
- stateenum: running | completed | failed | canceledrequired
401Unauthorized403Forbidden404Not Found409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/servers/{serverId}/drain/planPlan evacuating a server
Dry run: proposes a target for every service on the server, flags stateful services (volumes are not copied), and checks that the targets have the memory. Requires a token that is not restricted to projects.
| Parameter | In | Type | Description |
|---|---|---|---|
serverIdrequired | path | string |
Request body · application/json · required
- targetServerIdstringSend every service to this server; omit to pick the online server with the most free memory per service
Response 200 · OK · application/json
- Capacityrequired
- PlanMove[] | nullrequired
401Unauthorized403Forbidden404Not Found422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.
/servers/{serverId}/undrainMake a drained server schedulable again
Clears the drain state of a drained or failed-drain server. Services that were moved stay where they are.
| Parameter | In | Type | Description |
|---|---|---|---|
serverIdrequired | path | string |
Response 200 · OK · application/json
- acceptWorkloadsbooleanrequiredWhether services may be scheduled on this server. Turning it off keeps what already runs here and refuses new placements and moves.
- acmeEmailstring | nullrequired
- agentVersionstring | nullrequired
- baseDomainstring | nullrequired
- buildAllowEmulationbooleanrequiredAllow building for another CPU architecture through emulation (slow); needs the agent to report emulation for the platform
- buildAllowPreviewsbooleanrequiredAllow pull request previews (untrusted code) to build here; off by default
- buildEnabledbooleanrequiredThe server builds images for other servers and pushes them to a registry (the Builds or Both role). Independent of acceptWorkloads.
- buildMaxConcurrentinteger (int64)requiredBuilds that run at the same time; more queue on the control plane
- composeVersionstringrequiredDocker Compose plugin version the agent reported, empty when it has none
- controlPlanebooleanrequiredThe host the installer put the control plane on; its proxy serves the dashboard
- createdAtstring (date-time)required
- diskAlertbooleanrequiredTrue while the root filesystem is at or above the threshold
- diskAlertThresholdPercentinteger (int64)requiredRoot filesystem usage that raises the disk alert (50-99)
- drainMessagestringrequiredWhy the last drain failed or was canceled, empty otherwise
- drainStartedAtstring (date-time) | nullrequired
- drainStateenum: none | draining | drained | failedrequiredEvacuation state; draining and drained servers accept no new services
- Factsrequired
- geoEnabledbooleanrequiredCount where requests come from (country, and city at the city level) from the client IP; IPs are never stored
- geoLevelenum: country | cityrequiredcountry needs a ~8 MB database on the server, city ~130 MB
- geoRefreshDaysinteger (int64)requiredCheck for a newer database every N days (1-90)
- geoSourceenum: dbip | maxmindrequireddbip = DB-IP Lite (CC BY 4.0, no key); maxmind = MaxMind GeoLite2 with the team's account
- idstringrequired
- lastSeenAtstring (date-time) | nullrequired
- Latestrequired
- metricsRetentionDaysinteger (int64)requiredHow long resource metric history is kept (1-90)
- namestringrequired
- ServerPatchSummaryrequired
- protocolVersioninteger (int32) | nullrequired
- Proxyrequired
- publicIpstring | nullrequired
- serviceCountinteger (int64)required
- statusenum: pending | online | offline | revokedrequired
- trafficAnalyticsEnabledbooleanrequiredAggregate Traefik access logs into traffic analytics
- trafficDailyRetentionDaysinteger (int64)requiredDaily traffic history (7-365 days)
- trafficHourlyRetentionDaysinteger (int64)requiredHourly traffic history (2-90 days)
- ServerTunnelSummaryrequired
- unrestrictedbooleanrequiredAn instance admin made this server unrestricted: stacks and services on it may use privileged mode, host networking, devices, GPUs, a runtime, the host PID namespace, unconfined seccomp or AppArmor, NET_ADMIN, SYS_ADMIN, the Docker socket and host bind mounts
401Unauthorized403Forbidden404Not Found409Conflict422Unprocessable Entity500Internal Server Error
Errors are RFC 9457 application/problem+json with a stable code field.