Platform

HTTP API

Call Spiral services over HTTP: hosts, authentication, shared conventions, and the reference for each service.

Available

Every Spiral service has an HTTP API at https://api.spiraldb.dev that takes JSON and a bearer token, and sign-in happens at https://auth.spiraldb.com. The SDKs and the CLI call these same APIs. Call them directly when you work in a language without an SDK, or when you want to see exactly what a call does. This page lists the hosts, the conventions every service shares, and the reference for each service.

Hosts

HostServes
https://api.spiraldb.devEvery service operation except those of the authorization server.
https://auth.spiraldb.comThe OAuth 2.0 authorization server: sign-in, device authorization, token issue and revocation, consents, and its discovery documents.

Authenticate a request

Send an access token in the Authorization header of each request:

curl https://api.spiraldb.dev/v1/projects \
  -H "Authorization: Bearer $SPIRAL_TOKEN"

The discovery documents and the public signing keys need no token, and an operation's reference says when it is anonymous. See Authentication to get a token.

Requests and responses

  • Send request bodies as JSON with Content-Type: application/json. The OAuth token endpoints are the exception: they take form-encoded bodies, as the OAuth 2.0 specification requires.
  • Read response bodies as JSON. Some read operations stream other media, and their reference names the media type.
  • Field names are camelCase on /api routes. Other routes use camelCase or snake_case, so check the operation's reference for the exact names.
  • On /api routes, 64-bit integers are decimal strings, so that JavaScript clients keep their precision. The server also accepts JSON numbers within the exact range of a double.

Route families

Routes on api.spiraldb.dev come in two families, and some conventions depend on the family:

  • /api routes are the Catalog (/api/catalog/...) and Applications (/api/apps/...). They share one error envelope, one pagination style and strict field rules, which the pages in this section describe exactly.
  • Service routes are all the others. Each service follows its own conventions for errors and pagination, and the pages in this section say which service does what.

Service routes use one of three path forms:

FormExampleUsed by
/v1/...GET /v1/projectsOrganizations, Projects, Storage, Workloads, and Authorization grants
Resource rootPOST /locationsTables and Enrichments (the Tables API at /arbor), Locations, Connections, and Vector Indexes. The request body or the resource ID selects the Project.
Project-scopedGET /projects/{project_id}/tasksTasks and Worker Pools

OAuth and discovery endpoints use the paths their specifications define, such as /oauth/token and /.well-known/openid-configuration.

Unknown fields

/api routes apply one rule in each direction:

  • Requests. The server rejects unknown fields, unknown enum values, unknown union variants and repeated JSON keys with Contract:InvalidRequest.
  • Responses. Clients ignore fields they do not know, and keep enum values and union variants they do not know.

That is what lets a service add response fields without breaking your client. Write your own client the same way: send only the fields the reference lists, and ignore new ones in responses.

Service routes differ. Some request types reject unknown fields, for example Task creation and Location versions, and others ignore them. Send only the fields the reference lists.

Conventions

Service reference

Each service documents every public operation, with its path, request, response and errors, in its own HTTP reference:

ServiceReferenceHost
OrganizationsOrganizations APIapi.spiraldb.dev
ProjectsProjects APIapi.spiraldb.dev
AuthenticationAuthentication APIapi.spiraldb.dev, auth.spiraldb.com
AuthorizationAuthorization APIapi.spiraldb.dev
WorkloadsWorkloads APIapi.spiraldb.dev
ApplicationsApplications APIapi.spiraldb.dev
CatalogCatalog APIapi.spiraldb.dev
TablesTables APIapi.spiraldb.dev
EnrichmentsEnrichments APIapi.spiraldb.dev
Vector IndexesVector Indexes APIapi.spiraldb.dev
LocationsLocations APIapi.spiraldb.dev
ConnectionsConnections APIapi.spiraldb.dev
StorageStorage APIapi.spiraldb.dev
TasksTasks APIapi.spiraldb.dev
Worker PoolsWorker Pools APIapi.spiraldb.dev

The OAuth endpoints of the Authentication service follow the OAuth 2.0 RFCs, and the Authentication API reference names the RFC for each one. Operations that are internal, or that a newer operation replaces, are not part of the public reference.

Permissions lists the permissions each service checks and the OAuth scope that delegates each one. Resource addresses defines the path@ref form that the SDKs accept.

Found a problem? Edit this page or report an issue.

On this page