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

# Revoke an API key

> Revocation is immediate: the cached identity is dropped in the same call, so the key stops working at once rather than when a cache entry expires.



## OpenAPI

````yaml /api-reference/auth.json delete /api/auth/keys/{id}
openapi: 3.1.0
info:
  title: truscan auth
  version: 1.0.0
  description: >-
    Identity: accounts, sessions, password resets and API keys.


    This is the only service that verifies a credential, because it is the
    service that issues them. Every other service decodes the identity the edge
    already verified.


    Protected routes accept either credential, a dashboard session JWT or an
    `tru_` API key, on the same path. There is no key-only variant of any route.
servers:
  - url: https://api.truscan.co
    description: Production
security: []
tags:
  - name: session
    description: Sign up, sign in, password reset
  - name: keys
    description: API key management
paths:
  /api/auth/keys/{id}:
    delete:
      tags:
        - keys
      summary: Revoke an API key
      description: >-
        Revocation is immediate: the cached identity is dropped in the same
        call, so the key stops working at once rather than when a cache entry
        expires.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: No such key for this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Failure'
      security:
        - session: []
        - apiKey: []
components:
  schemas:
    Envelope:
      type: object
      required:
        - success
        - result
        - message
      properties:
        success:
          type: boolean
        result: {}
        message:
          type: string
    Failure:
      type: object
      required:
        - success
        - result
        - message
      properties:
        success:
          type: boolean
          const: false
        result:
          type: object
          properties:
            code:
              type: string
        message:
          type: string
          description: Written for a person. Safe to show as-is.
  responses:
    Unauthorized:
      description: No valid credential was presented.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Failure'
  securitySchemes:
    session:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: A dashboard session, verified at the edge.
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An `tru_` API key, resolved at the edge. Accepted on every route a
        session is.

````