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

# Get Campaign Leads

> Returns all leads for a campaign based on the ID supplied



## OpenAPI

````yaml openapi-campaigns GET /campaigns/{campaign_id}/leads
openapi: 3.0.1
info:
  title: Puretalk AI
  description: Api Documentation for Puretalk AI
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.puretalk.ai/api
security:
  - ApiKeyAuth: []
paths:
  /campaigns/{campaign_id}/leads:
    get:
      description: Returns all leads for a campaign based on the ID supplied
      parameters:
        - name: campaign_id
          in: path
          description: ID of campaign to return leads
          required: true
          schema:
            type: string
            format: uuid
        - name: page
          in: query
          description: The page number to return
          schema:
            type: integer
            format: int32
        - name: limit
          in: query
          description: The maximum number of results to return
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: Campaign leads response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
                    description: Total number of leads
                    example: 100
                  next:
                    type: string
                    nullable: true
                    format: uri
                    description: Next page URL
                    example: >-
                      https://api.puretalk.ai/api/campaigns/123e4567-e89b-12d3-a456-426614174000/leads?page=2
                  previous:
                    type: string
                    nullable: true
                    format: uri
                    description: Previous page URL
                    example: >-
                      https://api.puretalk.ai/api/campaigns/123e4567-e89b-12d3-a456-426614174000/leads?page=1
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/CampaignTask'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CampaignTask:
      type: object
      properties:
        to_number:
          type: string
          description: Phone number of the lead
          example: '+1234567890'
        is_completed:
          type: boolean
          description: Indicates if the task is completed
          example: false
        variables:
          type: array
          nullable: true
          items:
            type: object
            properties:
              var_name:
                type: string
                description: Name of the variable
                example: name
              var_value:
                type: string
                description: Value of the variable
                example: John Doe
        call_id:
          type: string
          nullable: true
        completed_at:
          type: string
          nullable: true
          format: date-time
          description: Completed at date of the task
          example: '2021-01-01'
    Error:
      type: object
      properties:
        err:
          type: boolean
          description: Indicates if the response is an error
          example: false
        msg:
          type: string
          description: Message from the API
          example: Error message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Authorization header containing API key. You can find your API key in
        the dashboard under 'API Keys'.

````