> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ionicfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke an API key

> Permanently revokes the key, immediately disabling authentication for any
request that presents it. A revoked key cannot be re-activated. If you need
continued access during a transition, rotate the key instead of revoking it.




## OpenAPI

````yaml /openapi/api_keys.yaml delete /keys/{id}
openapi: 3.0.3
info:
  title: Ionic API Keys API
  version: '2026-05-01'
  description: >
    API keys — the authentication credentials for the Ionic API.


    A standard secret key (`sk_…`) is a server-side-only credential whose

    data-plane permissions follow Ionic's current standard policy. A restricted

    secret (`rk_…`) carries only the explicit permission snapshot selected at

    creation. Neither belongs in client-side code.

    A publishable key (`pk_…`) is safe for client-side contexts; it is
    restricted

    to payment-method tokenization operations.


    The full key value is returned exactly once: in the create response and in
    the

    rotate response. It is not included in retrieve, list, or revoke responses.

    Store it securely; it is not retrievable afterwards.


    Each key is scoped to a mode (`test` or `live`). A test-mode key can only
    see

    and mutate test-mode data; a live-mode key operates on production data. The

    `mode` field on every key reflects which scope applies.


    Timestamps are Unix epoch seconds. Identifiers are opaque, prefixed strings.

    Secret key identifiers begin with `sk_`; publishable key identifiers begin

    with `pk_`.


    Authentication uses a merchant standard (`sk_…`) or restricted (`rk_…`)

    secret key as a bearer token. Read endpoints require the `api_keys:read`

    permission; write endpoints require `api_keys:write`. Create, revoke, and

    rotate additionally require a secret key; list and retrieve accept any key

    type with the `api_keys:read` permission.


    Errors are returned as `{ "error": { "code": "...", "message": "..." } }`.
servers:
  - url: '{baseUrl}/v1'
    variables:
      baseUrl:
        default: https://api.ionicfi.com
        description: API base URL for your environment.
security:
  - secretKey: []
tags:
  - name: API Keys
    description: Create, list, retrieve, revoke, and rotate API keys.
paths:
  /keys/{id}:
    parameters:
      - $ref: '#/components/parameters/APIKeyId'
    delete:
      tags:
        - API Keys
      summary: Revoke an API key
      description: >
        Permanently revokes the key, immediately disabling authentication for
        any

        request that presents it. A revoked key cannot be re-activated. If you
        need

        continued access during a transition, rotate the key instead of revoking
        it.
      operationId: api_keys_revoke
      responses:
        '200':
          description: >-
            The revoked key with `status` set to `revoked`. The full key value
            is not included.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIKey'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/APIKeyNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - secretKey:
            - api_keys:write
components:
  parameters:
    APIKeyId:
      name: id
      in: path
      required: true
      description: >-
        The API key identifier (`sk_…` for secret keys, `pk_…` for publishable
        keys).
      schema:
        type: string
  schemas:
    APIKey:
      type: object
      description: >
        Standard read view of an API key. Does not include the full
        authenticatable

        token — only the `key_prefix` for identification.
      required:
        - created_at
        - id
        - key_prefix
        - key_type
        - mode
        - owner_id
        - owner_type
        - permissions
        - status
        - updated_at
      properties:
        id:
          type: string
          description: >-
            Unique resource identifier. `sk_…` for secret keys; `pk_…` for
            publishable keys.
        key_prefix:
          type: string
          description: >-
            First 19 characters of the full key. Used to identify the key
            without exposing the secret.
        key_type:
          type: string
          enum:
            - secret
            - publishable
          description: '`secret` for server-side keys; `publishable` for client-side keys.'
        mode:
          type: string
          enum:
            - test
            - live
          description: Environment scope this key operates in.
        access_profile:
          type: string
          enum:
            - standard
            - restricted
          description: |
            Authorization policy for secret keys. Omitted for publishable keys
            and for temporarily unclassified legacy rows during rollout.
        status:
          type: string
          enum:
            - active
            - revoked
          description: >-
            `active` means the key can authenticate requests. `revoked` means it
            has been permanently disabled.
        name:
          type: string
          nullable: true
          description: Display name, if set.
        description:
          type: string
          nullable: true
          description: Notes, if set.
        owner_type:
          type: string
          enum:
            - merchant
            - platform
          description: Whether this key belongs to a merchant or a platform.
        owner_id:
          type: string
          description: Identifier of the owning merchant or platform.
        permissions:
          type: array
          items:
            type: string
          description: Permission scopes granted to this key.
        expires_at:
          type: integer
          nullable: true
          description: >-
            Unix epoch seconds when the key expires. Null if the key does not
            expire.
        created_at:
          type: integer
          description: Unix epoch seconds when the key was created.
        updated_at:
          type: integer
          description: Unix epoch seconds when the key was last updated.
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A stable, machine-readable error code.
            message:
              type: string
  responses:
    BadRequest:
      description: The request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_REQUEST
              message: mode must be test or live
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The key lacks the required permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    APIKeyNotFound:
      description: No key with that identifier is visible to this request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: API_KEY_NOT_FOUND
              message: API key not found
    RateLimited:
      description: Too many requests. Honour the `Retry-After` header before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: |
        The API could not return a successful response. For a mutating request,
        retrieve the resource before retrying because the operation may have
        completed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >-
        A merchant standard (`sk_…`) or restricted (`rk_…`) secret key sent as
        `Authorization: Bearer <key>`.

````