Skip to content

Admin API ​

The admin API lives under /api/v1/* and is consumed by the web UI. You can also call it programmatically — either with a session cookie (after logging in) or with an API token that holds the right capability.

This page is a high-level map. For the consumer-facing read endpoint, see Consuming data.

Authentication ​

Two options:

  • Session cookie — set automatically after you log in to the UI. Authorized by the user's capabilities and path patterns.
  • Bearer token — Authorization: Bearer pika_.... Authorized by the token's path scopes and their operations.

A request carrying a Bearer token is authorized as that token even if it also carries a session cookie, so a narrow token never inherits a wider browser session. A request with no credentials is redirected to the login UI; a request with a rejected token gets 401.

Tokens reach configurations only

A token's scopes map onto files.read / files.write and stop there. Every endpoint below gated on settings.manage, tokens.manage, users.manage, permissions.manage or external.* returns 403 for a token, whatever its scopes. See Tokens on the admin API.

Discovery ​

MethodPathCapabilityPurpose
GET/healthz(public)Liveness probe. Returns OK.
GET/api/v1/info(public)Server metadata, version, current user identity, effective capabilities, encryption-config warning flag.
GET/api/v1/key/status(public)Server-key state (initialized / locked / unlocked). Allowed while the server is locked.

/api/v1/info is the discovery endpoint — the UI calls it on every load to decide which sections to render, and scripts can use it to feature-detect.

Configuration data plane ​

These operate on the persisted config tree.

MethodPathCapabilityPurpose
GET/api/v1/folder, /folder/*files.readList folders / contents.
POST/api/v1/folder/*files.writeCreate a folder.
DELETE/api/v1/folder/*files.writeDelete a folder.
GET/api/v1/file/*files.readRead a config file. Supports ?variant= and ?version=.
POST/api/v1/file/*files.writeCreate or update a config file (creates a new version).
DELETE/api/v1/file/*files.writeDelete a config file.
GET/api/v1/versions/*files.readList versions of a file.
PATCH/api/v1/versions/*files.writeSet / clear the semver tag on a specific version.
GET/api/v1/variants/*files.readList the variants of a file.
POST/api/v1/render/*files.readResolve a file (inheritance + variant + version) and return the merged document.
POST/api/v1/convertfiles.readConvert content between JSON / YAML / TOML.
GET/api/v1/search?q=...files.readFull-text search across configs (Server-Sent Events stream).

Consumer endpoints ​

Reachable on the same admin port. To expose configuration data on a separate port (no Bearer required, custom shape, optional request-rule pre-stage), configure an Endpoint instead.

MethodPathCapabilityPurpose
GET/data/*files.read (scope-gated)Resolved config — see Consuming data.

External resources ​

Browse and operate on configured external backends (Vault, Consul, etcd, AWS, Azure, GCP, Kubernetes, HTTP). All endpoints are gated on external.* because exposing them returns or mutates third-party secrets.

MethodPathCapabilityPurpose
GET/api/v1/external/resourcesexternal.readList configured external resources.
GET/api/v1/external/{name}/pathsexternal.readBrowse the namespace of one resource.
POST/api/v1/external/{name}/testexternal.readProbe connectivity / credentials for one resource.
POST/api/v1/external/{name}/readexternal.readRead one entry by path (body carries the path; * wildcard not viable in middle-segment routing).
POST/api/v1/external/{name}/writeexternal.writeCreate / update one entry.
POST/api/v1/external/{name}/deleteexternal.writeDelete one entry.
POST/api/v1/external/{name}/versionsexternal.readList historical versions (KV backends that support it).
POST/api/v1/external/{name}/versionexternal.readRead a specific version of an entry.
GET/api/v1/external/{name}/searchexternal.readSearch within the resource.
GET/api/v1/external/{name}/exportsettings.manageDownload the whole resource as a zip archive (Consul / Vault only). Optional prefix and limit query params.

Bulk export is the one exception to the external.* gating above: a single read exposes one secret, an export hands the caller every secret the backend holds in one file, so it requires settings.manage and is surfaced only in Settings → External Resources. Archive layout mirrors the key space — myapp/db/password becomes a file at that path (raw value for Consul, <path>.json for Vault secret maps). Unreadable paths and truncation (limit, default 20000 keys) are reported in _errors.txt inside the archive.

MCP ​

MethodPathCapabilityPurpose
POST/api/v1/mcptoken scopes or files.* / external.*Model Context Protocol endpoint (streamable HTTP) for AI agents — see MCP server.

Like /data/*, this endpoint authenticates itself and accepts either credential: an API token (authorized by its path scopes and operations) or a UI session (authorized by capabilities and path patterns). Bearer takes precedence over a cookie. The tool list an agent receives is filtered to what the caller may actually do, so a read-only token gets a read-only tool set and a token — which holds no capabilities — never sees the external-resource tools.

Users, permissions, tokens ​

MethodPathCapabilityPurpose
GET,POST,PATCH,DELETE/api/v1/users[/*]users.manageUser CRUD.
POST/api/v1/users-kick/*users.manageForce-logout a user (invalidates their sessions).
DELETE/api/v1/users-totp/*users.manageAdmin reset of a user's TOTP enrolment.
GET,POST,PATCH,DELETE/api/v1/permissions[/*]permissions.managePermission bundle CRUD.
GET,PUT/api/v1/user-permissions/*permissions.manageRead / replace a user's bundle assignments.
GET,POST,DELETE,PATCH/api/v1/tokens[/*]tokens.manageAPI token CRUD. See Listing tokens.

Listing tokens ​

GET /api/v1/tokens without query parameters returns a plain JSON array of every token (the original shape). Adding any paging or filter parameter switches the response to { "tokens": [...], "total": N }:

ParameterExampleMeaning
_limit_limit=20Page size (default 50 when paging).
_offset_offset=40Page offset.
_sort_sort=-last_used_atSort field; prefix - for descending. name, created_at, expires_at and last_used_at are supported.
namename=ciCase-insensitive substring match.
activeactive=trueFilter by enabled state.

Each token carries last_used_at, the last time it authenticated. It is written in batches about once a minute, so it can lag slightly; in a cluster only the leader persists it.

Server administration ​

MethodPathCapabilityPurpose
GET,POST/api/v1/settingssettings.manageRead / patch the entire settings document.
POST/api/v1/key/initializesettings.manageOpt in to at-rest encryption (first-time setup).
POST/api/v1/key/unlocksettings.manageUnlock the server after a restart by supplying the master key.
POST/api/v1/key/locksettings.manageManually re-lock the server without restarting.
POST/api/v1/key/rotatesettings.manageRotate the server encryption key (current → new).
GET/api/v1/tls/statussettings.manageInspect active HTTPS policy and certificate expiry.
POST/api/v1/tls/self-signedsettings.manageGenerate and activate a managed self-signed certificate.
PUT/api/v1/tls/manualsettings.manageUpload and activate a PEM certificate / key pair.
POST/api/v1/tls-generatesettings.manageGenerate a TLS certificate / key pair without activating it.
POST/api/v1/ssh-keygensettings.manageGenerate an SSH key pair (used by external resources that require key-based auth, e.g. Git over SSH).
GET/api/v1/cluster/statussettings.manageRuntime cluster role, quorum, leader, visible alan peers.
GET/api/v1/public-endpoints/statussettings.manageRuntime state of each configured Endpoint listener.
POST/api/v1/public-endpoints/test-rulessettings.manageDry-run draft Endpoint request rules and return a trace.
POST/api/v1/public-endpoints/{id}/testsettings.manageSynthetic probe against a saved Endpoint.
GET,POST/api/v1/backup[/info]settings.manageExport / inspect / import a full backup archive.
GET/api/v1/auditsettings.manageList the audit log. See Audit log.

Audit log ​

Every state-changing request on the admin API (any method other than GET/HEAD/OPTIONS) and every password login or registration attempt is recorded with its time, actor (alice or token:<name>), action (POST /api/v1/file/*, login.failed, …), target path, HTTP status, client IP and request ID. Request and response bodies are never stored.

GET /api/v1/audit returns { "entries": [...], "total": N }, newest first. It accepts _limit (default 50), _offset, _sort (time or -time), and filters such as actor=alice or action=login.failed.

Entries are kept for audit.retention (default 2160h, 90 days; 0 keeps them forever). The UI view is Settings → Audit Log, where the retention can also be overridden at runtime; the override is stored in settings (POST /api/v1/settings with {"action":"set","audit":{"retention":"720h"}}) and wins over the config value. Send an empty retention to fall back to the config value. The minimum is 1h.

GET /api/v1/audit/retention returns the retention in effect: { "retention": "720h0m0s", "source": "settings", "config_retention": "2160h0m0s" }.

Per-user endpoints ​

Reserved under /api/v1/me/*. Every authenticated user can read and modify their own resources; no extra capability is required.

GroupRoutes
PreferencesGET / PUT / DELETE /api/v1/me/preferences
PasskeysPOST /me/passkeys/begin, /finish; GET /me/passkeys; PATCH / DELETE /me/passkeys/*
TOTPGET /me/totp; POST /me/totp/begin, /finish, /recovery-codes; DELETE /me/totp
Personal vaultGET /me/vault/status, /account; POST /me/vault/setup, /unlock-check, /rotate-password, /recovery-kit; PUT /me/vault/session-lock; DELETE /me/vault
Vault itemsGET / POST /me/vault/items; GET / PUT / DELETE /me/vault/items/*; POST /me/vault/items-restore/*, /items-use/*; GET /me/vault/items-versions/*
Vault filesGET /me/vault/files; POST /me/vault/files-folder; PUT /me/vault/files-upload; GET / PUT /me/vault/files-content/*; PATCH / DELETE /me/vault/files/*

Authentication endpoints ​

Provided by the ada auth manager — paths are stable but the strategies behind them are configured at runtime under Settings → Authentication.

PathPurpose
GET /login/infoPublic — discover enabled strategies and login UI metadata. Allowed while locked.
GET /login/meCurrent session — username, capabilities, MFA state. Returns 401 when not signed in.
POST /login/pass/{strategy}Password-style strategies such as local. Rate-limited by login_guard.
GET /login/{strategy}OAuth2 / OIDC redirect start.
POST /login/register/{strategy}Self-registration (when enabled by the strategy).
POST /logoutInvalidates the current session.

Conventions ​

  • All write endpoints accept JSON request bodies and return JSON responses.
  • Error responses include a { "message": "..." } body. 5xx responses also carry request_id; the same id is in the server's error log line and the X-Request-Id response header.
  • Request bodies are capped by server.limits.request_body_mb (backup uploads by server.limits.backup_body_mb); larger requests get 413.
  • Long-running operations (search, backup export) stream over Server-Sent Events.
  • When the server is locked, all endpoints except the discovery group and /login/* / /api/v1/key/{status,unlock} return 503 Service Unavailable with X-Pika-Locked: true. See Encryption.

Released under the MIT License.