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

# Delete API Key

> Permanently deletes a revoked API key. Only keys with status `revoked`
can be deleted. Active keys must be revoked first.
Requires `api_keys:manage` permission.




## OpenAPI

````yaml DELETE /api/api-keys/{id}
openapi: 3.1.0
info:
  title: Naturalead API Keys API
  version: 1.0.0
  description: >
    API for managing programmatic API keys in the Naturalead platform.

    All endpoints require API key authentication and are scoped to the caller's
    account.
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security:
  - BearerAuth: []
tags:
  - name: API Keys
    description: API key lifecycle management (create, list, revoke, rotate, delete)
paths:
  /api/api-keys/{id}:
    delete:
      tags:
        - API Keys
      summary: Delete API key
      description: |
        Permanently deletes a revoked API key. Only keys with status `revoked`
        can be deleted. Active keys must be revoked first.
        Requires `api_keys:manage` permission.
      operationId: deleteApiKey
      parameters:
        - name: id
          in: path
          required: true
          description: API key ID
          schema:
            type: string
      responses:
        '200':
          description: Key deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
        '404':
          description: API key not found or not in revoked status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
  responses:
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````