> ## 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.

# List API Keys

> Returns all API keys for the current account. Keys are returned with
masked values (keyPrefix and keyHint only). The full key is never
returned after creation.
Requires `api_keys:view` permission.




## OpenAPI

````yaml GET /api/api-keys
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:
    get:
      tags:
        - API Keys
      summary: List API keys
      description: |
        Returns all API keys for the current account. Keys are returned with
        masked values (keyPrefix and keyHint only). The full key is never
        returned after creation.
        Requires `api_keys:view` permission.
      operationId: listApiKeys
      responses:
        '200':
          description: List of API keys
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiKey'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ApiKey:
      type: object
      properties:
        _id:
          type: string
          description: Unique key identifier
        accountId:
          type: string
          description: Account this key belongs to
        name:
          type: string
          description: Human-readable key name
        keyPrefix:
          type: string
          description: Key prefix (e.g. nl_live_ or nl_test_)
        keyHint:
          type: string
          description: Last 4 characters of the key for identification
        scopes:
          type: array
          items:
            type: string
          description: RBAC permissions granted to this key
        environment:
          type: string
          enum:
            - live
            - test
        status:
          type: string
          enum:
            - active
            - revoked
            - expired
        expiresAt:
          type: string
          format: date-time
          nullable: true
        lastUsedAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
      required:
        - _id
        - name
        - keyPrefix
        - keyHint
        - scopes
        - environment
        - status
        - createdAt
    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_*)

````