Account

Mint a one-time key-issuance token for a headless agent

Owner-side half of headless key issuance. The signed-in account OWNER mints a single-use issuance token here, hands it to their AI agent out of band, and the agent redeems it — once, within 24 hours — at POST /api/v1/account/issuance-tokens/redeem for its own ["read:"]-scoped API key. The identity step is deliberately owner-issued, never agent-self-asserted: this surface requires a dashboard session cookie, so no Bearer key (and therefore no agent) can ever reach it. plaintext_token is returned EXACTLY ONCE in the 201 body; the server persists only its SHA-256 hash and cannot re-show it. Takes NO request body — token lifetime (24h) and the redeemed key's scope (["read:"]) are server-fixed, so there is no caller input to validate. At most 3 outstanding (unredeemed, unrevoked, unexpired) tokens may exist per account, enforced atomically under an advisory lock in the mint_key_issuance_token RPC (409 MAX_ISSUANCE_TOKENS_REACHED at the cap). Inline rate limit: 5 mints per hour per consumer, fail-CLOSED — an issuance surface narrows, never widens, on a rate-limit-store outage. Every mint writes an issuance_token.mint audit event.

post/api/v1/account/issuance-tokens

Request

  • Base URL: https://www.apier.no
  • URL: https://www.apier.no/api/v1/account/issuance-tokens
  • Auth: API key in cookie sb-access-token

Response

Token minted. plaintext_token is the ONLY copy anyone will ever see — hand it to the agent out of band and treat it like a password until redeemed. Carries the full no-cache directive set so no CDN / SW / proxy ever caches the plaintext body.

successtrue required

Example response

{
  "_meta": {
    "rulebook_version": "v1.0.0",
    "source": "apier.no",
    "data_source": "Brønnøysund Enhetsregisteret + Apier Universal Rulebook",
    "schema_version": "1.0.0",
    "legal_basis": "NLOD — public registry reuse",
    "response_timestamp": "2026-04-24T12:00:00.000Z",
    "response_hash": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
    "source_snapshot_id": "brreg-2026-04-24T02:00:00.000Z",
    "cost_nok": 0.5,
    "wallet_remaining_nok": 9.5,
    "spend_cap_remaining_nok": 12.5
  }
}

Changes

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