api-keys

Create a new API key. Plaintext returned exactly once.

Issue a new API key for the authenticated tenant.

The plaintext key is returned in this response EXACTLY ONCE (AC #1). After this call the plaintext is irrecoverable — the database stores only the bcrypt hash (STRIDE I1/I3).

Scopes default to ["read", "write"] when not supplied — parity with the onboarding key (AC #3). Pass scopes=["read"] explicitly for a read-only key.

Raises 412 when the tenant's tier is empty or unknown (ADR-083 amendment 1; fail closed, no key is created). Raises 422 api_key_limit_reached when the tenant's active key count reaches the tier limit (AC #10).

post/v1/api-keys

Request

  • Base URL: https://api.andish.ru (the document declares no server; this is the origin it was published from)
  • URL: https://api.andish.ru/v1/api-keys
  • Auth: none declared

Request body

scopesstring[]

Permission scopes for the new key. Allowed values: read, write. Defaults to [read, write] — parity with the onboarding key. Pass [read] explicitly for a read-only key.

namestring nullable

Optional human-readable label for the key (≤ 64 chars after trimming). ASCII control characters are stripped. Empty string or whitespace-only is treated as no label (None).

Response

Successful Response

idstring uuid required
prefixstring required
scopesstring[] required
created_atstring date-time required
api_keystring required

Plaintext API key — shown ONCE on creation. Copy it now; it cannot be retrieved again.

Changes

No recorded changes to this operation across all 1 revision of this API.