API Keys
Admin

Issue a cloud-bookkeeping service key

Changed on

Requires a human bearer JWT whose user id is present in the immutable server-owned SUPER_ADMIN_USER_IDS allowlist. The server binds the key to the configured non-human service principal and fixed accountant:* scope. The plaintext key is returned once and is never stored.

post/admin/service-keys

Request

  • Base URL
    https://api.medianfi.com/api/v1
  • Auth
    HTTP bearer

Request body

CreateServiceApiKeyInput required
name, string required

Registered writer name from the closed writer list (#4884 / GB-116), optionally with a ":<tag>" ASCII suffix (cloud-bookkeeping, hermes-daily-bookkeeping, manual-cli for principal: "bookkeeping"; penny-agent for principal: "agent"). Unregistered names or principal mismatches return 422. The resolved writer name is copied onto every audit row.

expiresInDays, integer

Requested lifetime in days, at most 7 (#1147). The server also caps it at its configured service-key default.

principal, 'bookkeeping' | 'agent'

Which machine principal owns the key. agent returns 503 unless the deployment enables the bookkeeping agent.

Response

Service key created; copy the plaintext key now

CreatedServiceApiKeyResponse required
success, true required
data, CreatedServiceApiKey required

Changes