Skip to main content

API overview

This page describes the conventions shared by the generated OpenAPI contracts. It explains authentication, response structure, and error codes. It also maps the API endpoint groups.

The source specifications generate the field-level contracts:

These pages define request and response schemas. This overview describes shared behavior and points to the relevant endpoint group.

Authentication model​

The broker uses a trusted reverse proxy for pre-authentication. The proxy can be oauth2-proxy, nginx auth_request, or a service mesh. It authenticates the caller and sends the principal in a request header. The broker does not authenticate end users.

  • Principal header — The default is X-Remote-User. It contains a principal email, username, or opaque ID. You can configure the header name. The broker accepts it only from a trusted source.
  • Session cookie — After pre-authentication, the end-user server maintains a session_token cookie. A request can use the session cookie or principal header.
  • Admin privilege — The proxy enforces administrator privilege before a request reaches the admin API.
  • CORS — The end-user server enables CORS for /api/* routes for the browser consent interface.

Public endpoints​

These endpoints require no pre-authentication:

EndpointServer
GET /healthBoth
GET /oauth2/jwks.jsonEnd-user
GET /.well-known/oauth-authorization-serverEnd-user

GET /oauth2/authorize and POST /oauth2/token do not use pre-authentication. They use OAuth2 parameters, such as agent client credentials or client_assertion. They do not use the principal header. See Configure authentication for the proxy trust boundary.

Response envelopes​

Successful and error responses follow a small set of consistent shapes.

ShapeUsed byExample
{"data": <resource-or-array>}Most resource responses{"data": {"principal": "…"}}
Bare JSON arrayAdmin list endpoints GET /api/agents, GET /api/services[{"id": "…"}]
{"items": [ … ]}GET /api/oauth2-server/signing-keys{"items": [{"kid": "…"}]}
{"error": "<code>", "message": "<text>"}Standard errors (end-user and admin){"error": "agent not found", "message": "…"}
{"error": "<code>", "error_description": "…"}OAuth2 endpoints (RFC 6749 / 8693){"error": "access_denied", "error_description": "…"}

The error envelope depends on the API surface. End-user and admin APIs use {error, message}. Both fields are required. OAuth2 endpoints use the RFC {error, error_description} envelope.

Error codes​

The error field contains a machine-readable code. End-user and admin APIs use human-readable strings. OAuth2 endpoints use RFC snake_case tokens.

SurfaceCodes
End-user consent / sessionsession_expired, invalid_permission_set, forbidden, invalid_state, service_id_mismatch, unauthorized, bad request, invalid request, invalid scopes, service not found
Admininvalid request body, validation failed, agent not found, service not found, conflict, last_key, current_key
OAuth2 (/oauth2/token)invalid_request, invalid_client, invalid_grant, invalid_target, access_denied, server_error
OAuth2 authorizeinvalid_client, invalid_redirect_uri

End-user API map (port 8000)​

The full request and response schemas for every endpoint below are in the end-user API reference.

Health​

MethodPathPurpose
GET/healthServer health and lifecycle status (public).

User info​

MethodPathPurpose
GET/api/meThe current authenticated user's profile.
MethodPathPurpose
GET/api/consent/agentsList agents that have active delegations for the user.
GET/api/consent/agents/{agent-id}Agent detail with its requested third-party services.
GET/api/consent/agents/{agent-id}/grantsThe user's grants for an agent.
POST/api/consent/agents/{agent-id}/grantsCreate or update a grant; optionally resume an OAuth2 flow.
DELETE/api/consent/agents/{agent-id}/grantsRevoke all of the agent's permissions.

Third-party sessions​

MethodPathPurpose
GET/api/third-party/sessionsList third-party services and per-user session status.
GET/api/third-party/{serviceId}/oauth2/authorizeStart an authorization-code + PKCE flow to the third party.
GET/api/third-party/{serviceId}/oauth2/callbackHandle the third-party OAuth2 callback.
GET/api/third-party/{serviceId}/sessionSession detail and the agents that depend on it.
DELETE/api/third-party/{serviceId}/sessionTerminate the session and delete its stored tokens.
GET/api/third-party/{serviceId}/session/affected-agentsAgents that lose access when the session ends.

OAuth2 server​

MethodPathPurpose
GET/oauth2/authorizeRFC 6749 authorization endpoint.
POST/oauth2/tokenToken exchange, authorization-code, or client-credentials grant.
GET/oauth2/jwks.jsonAggregated public JWK set (public).
GET/.well-known/oauth-authorization-serverRFC 8414 authorization-server metadata (public).

For the /oauth2/token grant modes and the RFC 8693 field reference, see Token exchange.

Admin API map (port 14000)​

Each admin endpoint requires X-Remote-User. The proxy enforces administrator privilege. GET /health is public. See admin API reference for full schemas.

Agents​

MethodPathPurpose
GET/api/agentsList all agents (bare array).
POST/api/agentsRegister an agent.
GET/api/agents/{agent-id}Get an agent.
PUT/api/agents/{agent-id}Update an agent.
DELETE/api/agents/{agent-id}Delete an agent (irreversible).

Services​

MethodPathPurpose
GET/api/servicesList services (bare array; secrets redacted).
POST/api/servicesRegister a third-party OAuth2 service.
GET/api/services/{service-id}Get a service (secret redacted).
PUT/api/services/{service-id}Update a service.
DELETE/api/services/{service-id}Delete a service (409 conflict if grants reference it).

Permission sets​

MethodPathPurpose
POST/api/permission-setsCreate a permission set.
GET/api/permission-setsList permission sets (optionally filtered by service).
GET/api/permission-sets/{permission-set-id}Get a permission set.
PUT/api/permission-sets/{permission-set-id}Replace a permission set.
DELETE/api/permission-sets/{permission-set-id}Delete a permission set.

Client credentials​

MethodPathPurpose
POST/api/agents/{agent-id}/client-credentialsGenerate or rotate an agent's broker credentials.
GET/api/agents/{agent-id}/client-credentialsCredential metadata (never the secret).
DELETE/api/agents/{agent-id}/client-credentialsRevoke the agent's credentials (irreversible).

Signing keys​

MethodPathPurpose
POST/api/oauth2-server/signing-keysAdd a signing key.
GET/api/oauth2-server/signing-keysList signing keys ({items}, newest first).
PUT/api/oauth2-server/signing-keys/{kid}/currentPromote a key to current.
DELETE/api/oauth2-server/signing-keys/{kid}Soft-delete a key (409 last_key / current_key).