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

# Revoke API Key



## OpenAPI

````yaml /openapi/v2.yaml patch /api-keys/{apiKey}/revoke
openapi: 3.0.0
info:
  title: Qanapi API v2
  version: 2.0.0
  description: Qanapi API version 2
servers:
  - url: https://{subdomain}.qanapi.cloud/api/v2
    description: The Qanapi API server
    variables:
      subdomain:
        default: ''
        description: Customer-specific subdomain.
security:
  - ApiKey: []
    BearerAuth: []
paths:
  /api-keys/{apiKey}/revoke:
    patch:
      summary: Revoke API Key
      parameters:
        - name: apiKey
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: API Key revoked
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  id:
                    type: string
                  revoked_at:
                    type: string
                    format: date-time
        '400':
          description: API key is already revoked
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                example:
                  message: API key is already revoked.
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '422':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  responses:
    UnauthorizedError:
      description: Unauthorized - Invalid API Key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthorized:
              $ref: '#/components/examples/unauthorized'
    ForbiddenError:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            forbidden:
              $ref: '#/components/examples/forbidden'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  examples:
    unauthorized:
      value:
        message: Unauthenticated.
    forbidden:
      value:
        message: This action is unauthorized.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-Qanapi-Authorization
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````