Skip to content
API reference · v1.3.0

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.

read

GET requests: members, services, lookups, history, events

write

POST, PUT, PATCH, DELETE on services and heartbeats

admin

/v1/admin routes; holds every scope

servers
export ATLAS=https://atlas-edge.fly.dev   # Public demo cluster
export ATLAS=http://127.0.0.1:8080   # Local node

health

GET/healthzpublic

Check process liveness

  • 200 The node is running.
Example request
curl
curl "$ATLAS/healthz"
GET/readyzpublic

Check node readiness

  • 200 The node is ready.
  • 503 The node is not ready.
Example request
curl
curl "$ATLAS/readyz"

cluster

GET/v1/noderead scope

Get this node's identity and version

  • 200 Node details. · object
  • 401 An error. See Error.code.
Example request
curl
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/node"
GET/v1/membersread scope

List members known to this node

  • 200 Current local membership view. · object
  • 401 An error. See Error.code.
Example request
curl
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/members"
GET/v1/topologyread scope

Measured 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`.

ParameterInTypeDescription
scopequery"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
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/topology"

registry

GET/v1/servicesread scope

List 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.

ParameterInTypeDescription
namequerystring
regionquerystring
healthqueryHealth
versionquerystring
node_idquerystringOwning node
tagquerystring[]Required tag. Repeat for several; a service must carry all of them.
metaquerystring[]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.
limitqueryinteger
cursorquerystringnext_cursor from the previous page
  • 200 One page of matching active instances. · object
  • 400 An error. See Error.code.
Example request
curl
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services"
POST/v1/serviceswrite scope

Register 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.

ParameterInTypeDescription
Idempotency-KeyheaderstringDerives 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
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"}'
GET/v1/services/{id}read scope

Get a service instance

ParameterInTypeDescription
id*pathstring
  • 200 The service instance. The ETag header carries its revision. · Service
  • 404 An error. See Error.code.
Example request
curl
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>"
PUT/v1/services/{id}write scope

Create 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.

ParameterInTypeDescription
id*pathstring
If-MatchheaderstringThe 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
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"}'
PATCH/v1/services/{id}write scope

Change some fields of a service (forwarded to its owner)

Changing address, health_check or ttl_seconds resets health to unknown; other edits keep it.

ParameterInTypeDescription
id*pathstring
If-MatchheaderstringThe 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
curl -X PATCH -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>" \
  -H "Content-Type: application/json" -d '{"draining":true}'
DELETE/v1/services/{id}write scope

Deregister 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`.

ParameterInTypeDescription
id*pathstring
  • 204 Service deleted.
  • 404 An error. See Error.code.
  • 409 An error. See Error.code.
  • 502 An error. See Error.code.
Example request
curl
curl -X DELETE -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>"
POST/v1/services/{id}/heartbeatwrite scope

Refresh 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.

ParameterInTypeDescription
id*pathstring
  • 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
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>/heartbeat"
GET/v1/lookup/{name}read scope

Select 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.

ParameterInTypeDescription
name*pathstring
regionquerystring
keyquerystringStable consistent-hash key
tagquerystring[]
metaquerystring[]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.
stalequery"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.
latencyquery"nearest" | "off"Rank by measured node latency (nearest) or ignore it (off)
tolerancequerystringWith 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
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/lookup/payments"
GET/v1/services/{id}/historyread scope

Recorded 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.

ParameterInTypeDescription
id*pathstring
limitqueryinteger
beforequeryintegernext_before from the previous page
  • 200 One page of history entries, newest first. · object
  • 400 An error. See Error.code.
Example request
curl
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/services/<id>/history"
GET/v1/historyread scope

Recent changes across services, newest first

ParameterInTypeDescription
namequerystringOnly services with this name
limitqueryinteger
beforequeryintegernext_before from the previous page
  • 200 One page of history entries, newest first. · object
  • 400 An error. See Error.code.
Example request
curl
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/history"

events

GET/v1/eventsread scope

Stream 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.

ParameterInTypeDescription
kindsquerystringComma-separated: member, service
servicequerystringOnly service events for this name
last_event_idquerystring
Last-Event-IDheaderstring
  • 200 Event stream. The data line of each frame is an Event. · Event
  • 400 An error. See Error.code.
Example request
curl
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/events"

admin

GET/v1/admin/credentialsadmin scope

List 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
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/credentials"
POST/v1/admin/credentialsadmin scope

Create 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
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/credentials"
DELETE/v1/admin/credentials/{id}admin scope

Revoke a runtime-managed API credential

Revocation is permanent and converges to cluster peers through authenticated anti-entropy. A credential cannot revoke itself.

ParameterInTypeDescription
id*pathstring
  • 204 Revoked.
  • 400 An error. See Error.code.
  • 403 An error. See Error.code.
  • 404 An error. See Error.code.
Example request
curl
curl -X DELETE -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/credentials/<id>"
GET/v1/admin/webhooksadmin scope

List 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
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/webhooks"
POST/v1/admin/webhooksadmin scope

Deliver 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
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/webhooks"
DELETE/v1/admin/webhooks/{id}admin scope

Stop delivering a webhook

ParameterInTypeDescription
id*pathstring
  • 204 Deleted
  • 403 An error. See Error.code.
  • 404 An error. See Error.code.
Example request
curl
curl -X DELETE -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/webhooks/<id>"
POST/v1/admin/webhooks/{id}/testadmin scope

Send a webhook.test event now, without retries

ParameterInTypeDescription
id*pathstring
  • 200 The outcome of the test delivery. · object
  • 403 An error. See Error.code.
  • 404 An error. See Error.code.
Example request
curl
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/webhooks/<id>/test"
GET/v1/admin/auditadmin scope

Read this node's admin audit log

Credential changes, backups, and node evictions are recorded locally and retained for 90 days. Secrets are never included.

ParameterInTypeDescription
beforequeryintegerReturn entries with a lower sequence number
limitqueryinteger
  • 200 Most recent admin audit entries. · object
  • 400 An error. See Error.code.
  • 403 An error. See Error.code.
Example request
curl
curl -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/audit"
POST/v1/admin/backupadmin scope

Download 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
curl -X POST -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/backup"
DELETE/v1/admin/nodes/{id}admin scope

Evict a failed node and delete its services

Only nodes that are not alive can be evicted; a live node would rejoin immediately.

ParameterInTypeDescription
id*pathstring
  • 200 Node evicted. · object
  • 404 An error. See Error.code.
  • 409 An error. See Error.code.
Example request
curl
curl -X DELETE -H "Authorization: Bearer $ATLAS_TOKEN" "$ATLAS/v1/admin/nodes/<id>"

Schemas

Health

unknown | healthy | unhealthy

ServiceSpec

idstringOptional stable ID; random when omitted
name*string
address*stringHost and port, for example 10.0.0.8:8080
versionstring
tagsstring[]
health_checkstring (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_secondsintegerHeartbeat TTL. Not with health_check.
check_interval_secondsintegerCheck interval for this service; ATLAS_HEALTH_CHECK_INTERVAL when omitted. Needs health_check.
unhealthy_thresholdintegerConsecutive failed checks before a healthy service turns unhealthy (default 3). Needs health_check.
healthy_thresholdintegerConsecutive passing checks before an unhealthy service recovers (default 2). Needs health_check.
drainingbooleanKeep the record but send it no traffic: lookups, DNS and client load balancers skip it.
traffic_weightintegerRelative traffic share after health, stale, region and latency filtering.
metadataMetadata

Webhook

idstring
urlstring
kinds"member" | "service"[]
servicestring
descriptionstring
created_atstring (date-time)
statusobjectDelivery 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

namestring
addressstring
versionstring
tagsstring[]
health_checkstring
ttl_secondsinteger
check_interval_secondsinteger
unhealthy_thresholdinteger
healthy_thresholdinteger
drainingboolean
traffic_weightinteger
metadataMetadataReplaces the whole map, like tags; {} removes every entry.

Service

idstring
namestring
node_idstringOwning node
addressstring
regionstring
versionstring
tagsstring[]
health_checkstring
healthHealth
revisionintegerIncreases on every change; use with If-Match
ttl_secondsinteger
check_interval_secondsinteger
unhealthy_thresholdinteger
healthy_thresholdinteger
drainingboolean
traffic_weightinteger
metadataMetadata
updated_atstring (date-time)
checked_atstring (date-time)Last health check (owner node only)
heartbeat_atstring (date-time)Last heartbeat (owner node only)

HistoryEntry

seqintegerOrders entries on the answering node only
service_idstring
namestring
revisioninteger
change"registered" | "updated" | "health" | "deregistered"
atstring (date-time)
serviceService

Member

idstring
addrstring
regionstring
state"alive" | "suspect" | "dead" | "left"
incarnationinteger
sincestring (date-time)
api_addrstringBase URL of the member's HTTP API; used to forward writes to the owner

NodeTopology

nodeMember
locationobject
versionstring
atstring (date-time)
peersobject[]

Event

idstring
typestring
kind"member" | "service"
atstring (date-time)
memberMember
serviceService

Error

error*stringHuman-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_idstringMatches request_id in the node's access log
owner_nodestringFor 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.

invalid_jsonvalidation_failedunauthorizedinsufficient_scopenot_foundroute_not_foundmethod_not_allowednot_ownerowner_aliveowner_unreachablemember_aliveprecondition_failedno_ttlrate_limitedpayload_too_largeno_healthy_instanceunavailableinternal