Atlas Node API
Authenticated HTTP API for cluster membership and the replicated service registry. Every node serves the same API, and any node accepts any request. A service is owned by the node that registered it; a write that reaches another node is forwarded to the owner (using the owner's gossiped API address and the caller's own credential) and the owner's answer is returned. Without a reachable owner the response is 409 not_owner or 502 owner_unreachable. Every error response uses the Error schema. Branch on `code`, which is stable; `error` is a human-readable message.
Authentication
Reads need the read scope, registry changes the write scope, and /v1/admin routes the admin scope. Admin credentials hold every scope. Missing or expired credentials receive 401 unauthorized; credentials without the required scope receive 403 insufficient_scope.
GET requests: members, services, lookups, history, events
POST, PUT, PATCH, DELETE on services and heartbeats
/v1/admin routes; holds every scope
export ATLAS=https://atlas-edge.fly.dev # Public demo cluster
export ATLAS=http://127.0.0.1:8080 # Local nodehealth
/healthzpublicCheck process liveness
- 200 The node is running.
Example request
curl "$ATLAS/healthz"/readyzpublicCheck node readiness
- 200 The node is ready.
- 503 The node is not ready.
Example request
curl "$ATLAS/readyz"cluster
/v1/noderead scopeGet this node's identity and version
- 200 Node details. · object
- 401 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/node"/v1/membersread scopeList members known to this node
- 200 Current local membership view. · object
- 401 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/members"/v1/topologyread scopeMeasured latency between nodes
This node's smoothed probe round-trip time to each peer, and its location when ATLAS_LOCATION is set. With scope=cluster the node also asks every live peer for its own view, using the caller's credential, and returns them all; peers that cannot be read carry an `error`.
| Parameter | In | Type | Description |
|---|---|---|---|
| scope | query | "node" | "cluster" |
- 200 scope=node returns a NodeTopology. scope=cluster returns `{nodes: [{id, view?: NodeTopology, error?}], truncated, at}`. · NodeTopology | object
- 400 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/topology"registry
/v1/servicesread scopeList registered service instances, one page at a time
Results are ordered by name, region, node and ID. Follow `next_cursor` until it is absent to read every match.
| Parameter | In | Type | Description |
|---|---|---|---|
| name | query | string | |
| region | query | string | |
| health | query | Health | |
| version | query | string | |
| node_id | query | string | Owning node |
| tag | query | string[] | Required tag. Repeat for several; a service must carry all of them. |
| meta | query | string[] | Required metadata entry as key:value, for example team:payments. Repeat for several (at most 8, one per key); a service must carry all of them with exactly those values. |
| limit | query | integer | |
| cursor | query | string | next_cursor from the previous page |
- 200 One page of matching active instances. · object
- 400 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services"/v1/serviceswrite scopeRegister a service instance on this node
Registration is idempotent when the request carries an `id` or an `Idempotency-Key` header: repeating it returns the existing record (200) instead of creating a duplicate, and changed content updates it. If the ID belongs to a node that has left the cluster, this node adopts it.
| Parameter | In | Type | Description |
|---|---|---|---|
| Idempotency-Key | header | string | Derives a stable ID per credential. Do not combine with a different `id`. |
Request body: ServiceSpec
- 200 The service instance. The ETag header carries its revision. · Service
- 201 The created service instance. · Service
- 400 An error. See Error.code.
- 409 An error. See Error.code.
Example request
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services" \
-H "Content-Type: application/json" \
-d '{"name":"payments","address":"10.0.0.8:8080","health_check":"http://10.0.0.8:8080/healthz"}'/v1/services/{id}read scopeGet a service instance
| Parameter | In | Type | Description |
|---|---|---|---|
| id* | path | string |
- 200 The service instance. The ETag header carries its revision. · Service
- 404 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>"/v1/services/{id}write scopeCreate or fully replace a service with this ID
Without If-Match this is an idempotent create-or-replace. With If-Match the service must exist at that revision.
| Parameter | In | Type | Description |
|---|---|---|---|
| id* | path | string | |
| If-Match | header | string | The ETag (revision) the change is based on, for example "3". |
Request body: ServiceSpec
- 200 The service instance. The ETag header carries its revision. · Service
- 201 The created service instance. · Service
- 400 An error. See Error.code.
- 409 An error. See Error.code.
- 412 An error. See Error.code.
Example request
curl -X PUT -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>" \
-H "Content-Type: application/json" \
-d '{"name":"payments","address":"10.0.0.8:8080","health_check":"http://10.0.0.8:8080/healthz"}'/v1/services/{id}write scopeChange some fields of a service (forwarded to its owner)
Changing address, health_check or ttl_seconds resets health to unknown; other edits keep it.
| Parameter | In | Type | Description |
|---|---|---|---|
| id* | path | string | |
| If-Match | header | string | The ETag (revision) the change is based on, for example "3". |
Request body: ServicePatch
- 200 The service instance. The ETag header carries its revision. · Service
- 400 An error. See Error.code.
- 404 An error. See Error.code.
- 409 An error. See Error.code.
- 412 An error. See Error.code.
- 502 An error. See Error.code.
Example request
curl -X PATCH -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>" \
-H "Content-Type: application/json" -d '{"draining":true}'/v1/services/{id}write scopeDeregister a service
The owning node always accepts this. Any other node accepts it when the owner has left the cluster, or when the credential has the admin scope; otherwise the response is 409 owner_alive with `owner_node`.
| Parameter | In | Type | Description |
|---|---|---|---|
| id* | path | string |
- 204 Service deleted.
- 404 An error. See Error.code.
- 409 An error. See Error.code.
- 502 An error. See Error.code.
Example request
curl -X DELETE -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>"/v1/services/{id}/heartbeatwrite scopeRefresh a TTL service and mark it healthy
Send heartbeats more often than ttl_seconds, for example every third of it. One missed TTL period marks the service unhealthy; three remove it, after which this returns 404 and the client should register again.
| Parameter | In | Type | Description |
|---|---|---|---|
| id* | path | string |
- 200 The service instance. The ETag header carries its revision. · Service
- 404 An error. See Error.code.
- 409 An error. See Error.code.
- 502 An error. See Error.code.
Example request
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>/heartbeat"/v1/lookup/{name}read scopeSelect one healthy service instance
Order of rules: never draining or unhealthy instances; the stale-record policy; healthy before unknown health; the requested region; the latency policy; then weighted rendezvous hashing on `key`, or weighted round-robin. `stale`, `latency` and `tolerance` override the node's ATLAS_ROUTING_* defaults for this request only.
| Parameter | In | Type | Description |
|---|---|---|---|
| name* | path | string | |
| region | query | string | |
| key | query | string | Stable consistent-hash key |
| tag | query | string[] | |
| meta | query | string[] | Required metadata entry as key:value, for example team:payments. Repeat for several (at most 8, one per key); a service must carry all of them with exactly those values. |
| stale | query | "include" | "prefer-live" | "exclude" | Instances whose owning node is not alive: include them like any other, prefer-live (use them only when no live-owner instance exists), or exclude them. |
| latency | query | "nearest" | "off" | Rank by measured node latency (nearest) or ignore it (off) |
| tolerance | query | string | With latency=nearest, nodes within this duration of the nearest count as equal, for example 10ms. Defaults to the node setting (5ms unless configured); 0s means strictly the nearest. |
- 200 The service instance. The ETag header carries its revision. · Service
- 400 An error. See Error.code.
- 503 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/lookup/payments"/v1/services/{id}/historyread scopeRecorded changes to one service, newest first
This node's record of every committed change to the service, its own and those learned from peers, kept after deregistration. Up to 100 entries per service, for ATLAS_HISTORY_RETENTION (7 days by default). A replica that merged several revisions at once records only the latest.
| Parameter | In | Type | Description |
|---|---|---|---|
| id* | path | string | |
| limit | query | integer | |
| before | query | integer | next_before from the previous page |
- 200 One page of history entries, newest first. · object
- 400 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>/history"/v1/historyread scopeRecent changes across services, newest first
| Parameter | In | Type | Description |
|---|---|---|---|
| name | query | string | Only services with this name |
| limit | query | integer | |
| before | query | integer | next_before from the previous page |
- 200 One page of history entries, newest first. · object
- 400 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/history"events
/v1/eventsread scopeStream membership and registry events
Server-Sent Events. Each event has an `id:` line; reconnect with the Last-Event-ID header (or `last_event_id` query parameter) to receive what was missed. An `event: reset` frame means the gap could not be replayed and the client should re-read current state. Event types: join, update, reap, service.registered, service.updated, service.health, service.deregistered.
| Parameter | In | Type | Description |
|---|---|---|---|
| kinds | query | string | Comma-separated: member, service |
| service | query | string | Only service events for this name |
| last_event_id | query | string | |
| Last-Event-ID | header | string |
- 200 Event stream. The data line of each frame is an Event. · Event
- 400 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/events"admin
/v1/admin/credentialsadmin scopeList configured and runtime-managed API credentials without secrets
- 200 Credentials by fingerprint. `id` matches token_id in access logs. · object
- 403 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/credentials"/v1/admin/credentialsadmin scopeCreate a runtime-managed API credential
Creates a cluster-wide credential. The bearer token is returned once; only its SHA-256 digest is stored and replicated over authenticated gossip. All cluster nodes must run a version that supports managed credentials. Peer replication is asynchronous. Expiry must be within one year.
Request body: object
- 201 Created. The token is returned only in this response. · object
- 400 An error. See Error.code.
- 403 An error. See Error.code.
Example request
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/credentials"/v1/admin/credentials/{id}admin scopeRevoke a runtime-managed API credential
Revocation is permanent and converges to cluster peers through authenticated anti-entropy. A credential cannot revoke itself.
| Parameter | In | Type | Description |
|---|---|---|---|
| id* | path | string |
- 204 Revoked.
- 400 An error. See Error.code.
- 403 An error. See Error.code.
- 404 An error. See Error.code.
Example request
curl -X DELETE -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/credentials/<id>"/v1/admin/webhooksadmin scopeList this node's webhooks and their delivery counters
A webhook belongs to the node it was created on, and only that node delivers it. Signing secrets are never returned here.
- 200 The node's webhooks. · object
- 403 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/webhooks"/v1/admin/webhooksadmin scopeDeliver events to an HTTP endpoint
Each matching event is POSTed as JSON, the same shape as /v1/events, with headers X-Atlas-Event, X-Atlas-Delivery, X-Atlas-Timestamp and X-Atlas-Signature: sha256= followed by the hex HMAC-SHA256, keyed with the returned secret, of the timestamp, a dot and the raw body. Failures (network errors, 5xx, 408, 429) are retried with exponential backoff; other responses are not. Redirects are not followed, and link-local addresses such as cloud metadata endpoints are refused. At most 32 per node.
Request body: object
- 201 Created. The secret is shown only in this response. · object
- 400 An error. See Error.code.
- 403 An error. See Error.code.
- 409 An error. See Error.code.
Example request
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/webhooks"/v1/admin/webhooks/{id}admin scopeStop delivering a webhook
| Parameter | In | Type | Description |
|---|---|---|---|
| id* | path | string |
- 204 Deleted
- 403 An error. See Error.code.
- 404 An error. See Error.code.
Example request
curl -X DELETE -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/webhooks/<id>"/v1/admin/webhooks/{id}/testadmin scopeSend a webhook.test event now, without retries
| Parameter | In | Type | Description |
|---|---|---|---|
| id* | path | string |
- 200 The outcome of the test delivery. · object
- 403 An error. See Error.code.
- 404 An error. See Error.code.
Example request
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/webhooks/<id>/test"/v1/admin/auditadmin scopeRead this node's admin audit log
Credential changes, backups, and node evictions are recorded locally and retained for 90 days. Secrets are never included.
| Parameter | In | Type | Description |
|---|---|---|---|
| before | query | integer | Return entries with a lower sequence number |
| limit | query | integer |
- 200 Most recent admin audit entries. · object
- 400 An error. See Error.code.
- 403 An error. See Error.code.
Example request
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/audit"/v1/admin/backupadmin scopeDownload a consistent SQLite snapshot of this node's registry
- 200 SQLite database file. Restore it with `atlas-cli db-restore`. · string (binary)
- 403 An error. See Error.code.
Example request
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/backup"/v1/admin/nodes/{id}admin scopeEvict a failed node and delete its services
Only nodes that are not alive can be evicted; a live node would rejoin immediately.
| Parameter | In | Type | Description |
|---|---|---|---|
| id* | path | string |
- 200 Node evicted. · object
- 404 An error. See Error.code.
- 409 An error. See Error.code.
Example request
curl -X DELETE -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/nodes/<id>"Schemas
Health
unknown | healthy | unhealthy
ServiceSpec
| id | string | Optional stable ID; random when omitted |
| name* | string | |
| address* | string | Host and port, for example 10.0.0.8:8080 |
| version | string | |
| tags | string[] | |
| health_check | string (uri) | Check on the service address, chosen by scheme: http:// or https:// (2xx passes), tcp:// (a connection passes) or grpc:// / grpcs:// (grpc.health.v1 SERVING passes; an optional path names the gRPC service). Not with ttl_seconds. |
| ttl_seconds | integer | Heartbeat TTL. Not with health_check. |
| check_interval_seconds | integer | Check interval for this service; ATLAS_HEALTH_CHECK_INTERVAL when omitted. Needs health_check. |
| unhealthy_threshold | integer | Consecutive failed checks before a healthy service turns unhealthy (default 3). Needs health_check. |
| healthy_threshold | integer | Consecutive passing checks before an unhealthy service recovers (default 2). Needs health_check. |
| draining | boolean | Keep the record but send it no traffic: lookups, DNS and client load balancers skip it. |
| traffic_weight | integer | Relative traffic share after health, stale, region and latency filtering. |
| metadata | Metadata |
Webhook
| id | string | |
| url | string | |
| kinds | "member" | "service"[] | |
| service | string | |
| description | string | |
| created_at | string (date-time) | |
| status | object | Delivery counters since the node started. |
Metadata
Key/value labels such as team, protocol or git commit; filter on them with meta=key:value. At most 16 entries whose keys and values total 512 bytes.
ServicePatch
| name | string | |
| address | string | |
| version | string | |
| tags | string[] | |
| health_check | string | |
| ttl_seconds | integer | |
| check_interval_seconds | integer | |
| unhealthy_threshold | integer | |
| healthy_threshold | integer | |
| draining | boolean | |
| traffic_weight | integer | |
| metadata | Metadata | Replaces the whole map, like tags; {} removes every entry. |
Service
| id | string | |
| name | string | |
| node_id | string | Owning node |
| address | string | |
| region | string | |
| version | string | |
| tags | string[] | |
| health_check | string | |
| health | Health | |
| revision | integer | Increases on every change; use with If-Match |
| ttl_seconds | integer | |
| check_interval_seconds | integer | |
| unhealthy_threshold | integer | |
| healthy_threshold | integer | |
| draining | boolean | |
| traffic_weight | integer | |
| metadata | Metadata | |
| updated_at | string (date-time) | |
| checked_at | string (date-time) | Last health check (owner node only) |
| heartbeat_at | string (date-time) | Last heartbeat (owner node only) |
HistoryEntry
| seq | integer | Orders entries on the answering node only |
| service_id | string | |
| name | string | |
| revision | integer | |
| change | "registered" | "updated" | "health" | "deregistered" | |
| at | string (date-time) | |
| service | Service |
Member
| id | string | |
| addr | string | |
| region | string | |
| state | "alive" | "suspect" | "dead" | "left" | |
| incarnation | integer | |
| since | string (date-time) | |
| api_addr | string | Base URL of the member's HTTP API; used to forward writes to the owner |
NodeTopology
| node | Member | |
| location | object | |
| version | string | |
| at | string (date-time) | |
| peers | object[] |
Event
| id | string | |
| type | string | |
| kind | "member" | "service" | |
| at | string (date-time) | |
| member | Member | |
| service | Service |
Error
| error* | string | Human-readable message |
| code* | "invalid_json" | "validation_failed" | "unauthorized" | "insufficient_scope" | "not_found" | "route_not_found" | "method_not_allowed" | "not_owner" | "owner_alive" | "owner_unreachable" | "member_alive" | "precondition_failed" | "no_ttl" | "rate_limited" | "payload_too_large" | "no_healthy_instance" | "unavailable" | "internal" | Stable machine-readable code. |
| request_id | string | Matches request_id in the node's access log |
| owner_node | string | For not_owner, owner_alive and owner_unreachable: the node that owns the service |
Error codes
Every error response is JSON with a stable code, a readable error and a request_id that matches the node's access log. Branch on the code, never on the message.