Home / Docs / API Reference

API Reference

Premium

REST API for config sync and team management. Available on the Solo and Teams plans. A hosted AI endpoint is on the roadmap — see below.

Base URL

All API endpoints are served from https://api.servonaut.dev/v1

Authentication

Servonaut uses OAuth 2.0 Device Flow for authentication. This flow is designed for CLI tools and devices that cannot open a browser.

Device flow steps

  1. Your CLI requests a device code from the /oauth/device/code endpoint.
  2. The user opens the verification URL in their browser and enters the user code.
  3. The CLI polls /oauth/token until the user approves.
  4. On approval, the CLI receives a long-lived access token.
Step 1: Request device code
$ curl -X POST https://api.servonaut.dev/v1/oauth/device/code \ -H "Content-Type: application/json" \ -d '{"client_id": "servonaut-cli"}' { "device_code": "Ag_EE...j5gM", "user_code": "XKCD-1234", "verification_uri": "https://servonaut.dev/api/oauth/verify", "expires_in": 900, "interval": 5 }
Step 3: Poll for token
$ curl -X POST https://api.servonaut.dev/v1/oauth/token \ -H "Content-Type: application/json" \ -d '{"device_code": "Ag_EE...j5gM", "grant_type": "urn:ietf:params:oauth:grant-type:device_code"}' # On approval: { "access_token": "snaut_live_...", "token_type": "Bearer", "expires_in": 31536000 }

Using the access token

Include the token in all API requests as a Bearer token in the Authorization header.

bash
$ curl https://api.servonaut.dev/v1/config \ -H "Authorization: Bearer snaut_live_..."

Config Sync

Store and retrieve configuration snapshots from the Servonaut cloud.

Endpoints

MethodPathDescription
GET /v1/config Get the current active config snapshot
GET /v1/config/snapshots List all stored snapshots (paginated)
POST /v1/config Push a new config snapshot
POST /v1/config/restore/{id} Restore a specific snapshot
Push a config snapshot
$ curl -X POST https://api.servonaut.dev/v1/config \ -H "Authorization: Bearer snaut_live_..." \ -H "Content-Type: application/json" \ -d '{"config": {...}, "label": "before-migration"}' { "id": "snap_01JQ...", "created_at": "2026-03-23T12:00:00Z", "label": "before-migration" }

Servonaut AI Coming soon

A hosted AI endpoint — log analysis, security review, cost review, and incident triage through a single POST /v1/ai/chat — is the next major addition. Quota, model routing, and tool-use via the CLI relay are all planned. Endpoints will be documented here once they ship.

Teams

Team management endpoints are available on the Teams plan only.

MethodPathDescription
GET /v1/team Get your team details and members list
POST /v1/team/members/invite Invite a new member by email
POST /v1/team/members/{id}/role Update a member's role (admin, member, viewer)
DELETE /v1/team/members/{id} Remove a team member
GET /v1/team/audit-log Retrieve the team audit trail (paginated)

Rate limits and quotas

PlanAPI requestsConfig snapshots
Free
Solo1,000/hour30
Teams5,000/hour per seatUnlimited

Servonaut AI quotas will be published here when the hosted AI endpoint ships.

Rate limit headers are returned on every response:

Response headers
X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 987 X-RateLimit-Reset: 1742731200

Error codes

HTTP statusError codeDescription
400invalid_requestMalformed request body or missing required fields
401unauthorizedMissing or invalid access token
403forbiddenToken does not have permission for this action
404not_foundResource does not exist
429rate_limitedRate limit exceeded. Retry after X-RateLimit-Reset
500internal_errorServer error. Report to support
Documentation