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

# Delete API key

> Permanently delete an API key. This action cannot be undone.



## OpenAPI

````yaml /api-reference/v1/api-keys-v1.yaml delete /api-keys/{api_key_id}
openapi: 3.0.3
info:
  title: Coval API Keys API
  version: 1.0.0
  description: |

    Manage API keys for authenticating with the Coval platform.
  contact:
    name: Coval API Support
    email: support@coval.dev
    url: https://docs.coval.ai
  license:
    name: Proprietary
    url: https://coval.dev/terms
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - ApiKeyAuth: []
tags:
  - name: API Keys
    description: Manage API keys for your organization
paths:
  /api-keys/{api_key_id}:
    delete:
      tags:
        - API Keys
      summary: Delete API key
      description: Permanently delete an API key. This action cannot be undone.
      operationId: deleteApiKey
      parameters:
        - name: api_key_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9A-Z]{26}$
          description: API key resource ID (ULID, 26 characters)
          example: 01HX2ABC3DEF4GHI5JKL6MNO7P
      responses:
        '204':
          description: API key deleted successfully (no content)
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/PermissionDenied'
        '404':
          description: API key not found or belongs to different organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  $ref: '#/components/examples/ApiKeyNotFoundError'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
components:
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHENTICATED
              message: Authentication failed
              details:
                - field: X-API-Key
                  description: Invalid or missing API key
    PermissionDenied:
      description: API key lacks required permission scope
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: PERMISSION_DENIED
              message: Insufficient permissions
              details:
                - field: permissions
                  description: 'API key does not have required permission: api-keys:write'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Internal server error
              details:
                - description: An unexpected error occurred
  schemas:
    ErrorResponse:
      type: object
      description: Standard error response
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              description: Error code enum
              enum:
                - INVALID_ARGUMENT
                - UNAUTHENTICATED
                - PERMISSION_DENIED
                - NOT_FOUND
                - INTERNAL
              example: INVALID_ARGUMENT
            message:
              type: string
              description: Human-readable error message
              example: Invalid request parameter
            details:
              type: array
              description: Detailed error information
              items:
                type: object
                properties:
                  field:
                    type: string
                    nullable: true
                    description: Field name that caused the error
                    example: status
                  description:
                    type: string
                    description: Detailed error description
                    example: Invalid status value
  examples:
    ApiKeyNotFoundError:
      summary: API key not found
      value:
        error:
          code: NOT_FOUND
          message: API key not found
          details:
            - field: api_key_id
              description: API key not found or not accessible by your organization
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````