Account

Disconnect an OAuth-connected identity and revoke its dedicated key

Self-service revocation of an OAuth connection created at consent time (for example a Claude connector the account owner approved on /oauth/consent). One atomic server-side transaction soft-revokes the (issuer, subject) mapping (a revoked_at stamp; the row is never deleted, so the forensic record survives) AND revokes the dedicated 'MCP OAuth connection' API key that was minted for that identity. From that moment every OAuth token for the identity fails closed with 401 OAUTH_SUBJECT_UNMAPPED, and a later reconnect on the consent page mints a brand-new mapping and key (a revoked mapping never resurrects). Session-cookie auth: the account OWNER acts from the dashboard; ownership is proven server-side against the session-resolved consumer before anything changes. The 404 response deliberately collapses three cases - wrong owner, already revoked, id doesn't exist - so a caller cannot probe the mapping space across tenants (IDOR defense). Idempotent: a repeat converges to the stable 404 with no second state change. Inline rate-limit 30/hour per consumer, fail-CLOSED.

delete/api/v1/account/oauth/{id}

Request

  • Base URL: https://www.apier.no
  • URL: https://www.apier.no/api/v1/account/oauth/{id}
  • Auth: API key in cookie sb-access-token

Path parameters

idstring uuid required

OAuth connection (mapping) id (UUID), as shown in the dashboard's Connected AI assistants panel. 400 if not a valid UUID - the boundary Zod parse rejects before any DB call.

Response

Connection disconnected: the mapping is revoked and its dedicated key is revoked with it.

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.