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

> Returns all leads for the account. When filter query parameters are
provided, returns a paginated response with a total count. Without
filters, returns a plain array.
Requires `leads:view` permission.




## OpenAPI

````yaml GET /api/leads
openapi: 3.1.0
info:
  title: Naturalead Leads API
  version: 1.0.0
  description: |
    API for managing leads 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:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Leads
    description: Lead CRUD, search, filtering, and bulk operations
paths:
  /api/leads:
    get:
      tags:
        - Leads
      summary: List leads
      description: |
        Returns all leads for the account. When filter query parameters are
        provided, returns a paginated response with a total count. Without
        filters, returns a plain array.
        Requires `leads:view` permission.
      operationId: listLeads
      parameters:
        - name: statuses
          in: query
          required: false
          description: Comma-separated list of statuses to filter by
          schema:
            type: string
            examples:
              - new,contacted
        - name: tags
          in: query
          required: false
          description: Comma-separated list of tags to filter by
          schema:
            type: string
            examples:
              - vip,hot
        - name: channel
          in: query
          required: false
          description: Channel to filter by
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: Maximum number of leads to return
          schema:
            type: integer
            default: 50
            maximum: 100
      responses:
        '200':
          description: |
            Without filters: a plain array of leads.
            With filters: an object containing leads array and total count.
          content:
            application/json:
              schema:
                oneOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Lead'
                  - type: object
                    properties:
                      leads:
                        type: array
                        items:
                          $ref: '#/components/schemas/Lead'
                      total:
                        type: integer
                    required:
                      - leads
                      - total
components:
  schemas:
    Lead:
      type: object
      properties:
        id:
          type: integer
          description: Sequential, account-scoped identifier
        name:
          type: string
        phone:
          type: string
          description: Unique per account
        email:
          type: string
          default: ''
        status:
          $ref: '#/components/schemas/LeadStatus'
        accountId:
          type: string
        source:
          type: string
          default: api
        tags:
          type: array
          items:
            type: string
        assignedAgentId:
          type: string
          description: ObjectId reference to AgentConfig
        abTestId:
          type: string
          description: ObjectId reference to AbTest
        agentAssignedBy:
          type: string
          enum:
            - manual
            - ab_test
            - auto
          default: auto
        customFields:
          type: object
          additionalProperties:
            type: string
          description: Key-value string map of custom fields
        lastContactedAt:
          type: string
          format: date-time
        importBatchId:
          type: string
        externalId:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - phone
        - email
        - status
        - accountId
    LeadStatus:
      type: string
      enum:
        - new
        - contacted
        - qualified
        - disqualified
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key prefixed with `nl_live_` or `nl_test_`
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````