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

# List all Leads

> Retrieves all leads data for the given campaign.



## OpenAPI

````yaml /openapi.yml get /api/v1/leads/
openapi: 3.1.1
info:
  title: DeliverymanAI API
  version: 1.0.0
  description: >-
    API documentation for DeliverymanAI, a Cold Email Management and Automation
    platform. This API provides endpoints for managing campaigns, contacts,
    email sequences, and related services.
servers:
  - url: https://api.deliveryman.ai
    description: Deliveryman API Server
security: []
paths:
  /api/v1/leads/:
    get:
      tags:
        - Leads
      summary: List all Leads
      description: Retrieves all leads data for the given campaign.
      operationId: leads_retrieve
      parameters:
        - in: query
          name: campaign_uid
          schema:
            title: Campaign Uid
            type: string
          description: UID of campaign to fetch leads from.
          required: true
        - in: query
          name: limit
          schema:
            maximum: 100
            minimum: 1
            title: Limit
            type: integer
          description: >-
            Maximum number of records to fetch in the current page. Must be
            between 1 and 100.
          required: true
        - in: query
          name: offset
          schema:
            minimum: 0
            title: Offset
            type: integer
          description: >-
            Number of records to skip before fetching the results.For example,
            an offset of 0 starts at the beginning, while an offset of 50
            fetches records starting from the 51st. If offset is greater than
            number of records available, results will be empty.
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllLeadsResponse'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleMessageResponse'
          description: Not Found
        '500':
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GetAllLeadsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/GetAllLeadsAPI'
        total:
          type: integer
          minimum: 0
          description: Total number of leads in this campaign.
      required:
        - data
        - total
    SimpleMessageResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    GetAllLeadsAPI:
      type: object
      properties:
        uid:
          type: string
          maxLength: 255
        sender_email_address:
          type:
            - string
            - 'null'
          maxLength: 1000
        sender_name:
          type:
            - string
            - 'null'
          maxLength: 500
        contact:
          $ref: '#/components/schemas/Contact'
        schedules:
          type: array
          items:
            $ref: '#/components/schemas/LeadsSchedules'
          readOnly: true
      required:
        - contact
        - schedules
        - uid
    Contact:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        email_id:
          type: string
          maxLength: 500
        bounced:
          type: boolean
        unsubscribed:
          type: boolean
      required:
        - email_id
        - id
    LeadsSchedules:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        email_data:
          allOf:
            - $ref: '#/components/schemas/LeadsEmailMessage'
          readOnly: true
        status:
          $ref: '#/components/schemas/LeadsSchedulesStatusEnum'
        schedule_datetime:
          type:
            - string
            - 'null'
          format: date-time
        sent_on:
          type:
            - string
            - 'null'
          format: date-time
        reply_received:
          type: boolean
        email_opened:
          type: boolean
        email_opened_on:
          type:
            - string
            - 'null'
          format: date-time
        email_open_count:
          type: integer
          maximum: 2147483647
          minimum: 0
        link_click_events:
          type: array
          items:
            $ref: '#/components/schemas/LeadsClickEvent'
          readOnly: true
        replies:
          type: array
          items:
            $ref: '#/components/schemas/LeadsReplies'
          readOnly: true
      required:
        - email_data
        - id
        - link_click_events
        - replies
    LeadsEmailMessage:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        subject:
          type: string
        body:
          type: string
        email_content_type:
          $ref: '#/components/schemas/EmailContentTypeD42Enum'
      required:
        - body
        - id
        - subject
    LeadsSchedulesStatusEnum:
      enum:
        - created
        - scheduled
        - sent
        - failed
        - replied
        - cancelled_reply_received
        - cancelled_unsubscribed
        - cancelled_bad_email
        - cancelled_campaign_stopped
      type: string
      description: |-
        * `created` - Created
        * `scheduled` - Scheduled
        * `sent` - Sent
        * `failed` - Failed
        * `replied` - Replied
        * `cancelled_reply_received` - Cancelled - Reply Received
        * `cancelled_unsubscribed` - Cancelled - Unsubscribed
        * `cancelled_bad_email` - Cancelled - Bad Email
        * `cancelled_campaign_stopped` - Cancelled - Campaign Stopped
    LeadsClickEvent:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        link:
          type: string
        clicked_on:
          type: string
          format: date-time
      required:
        - clicked_on
        - id
        - link
    LeadsReplies:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        body_plain_text:
          type: string
          readOnly: true
        body_html:
          type: string
          readOnly: true
        reply_classification:
          oneOf:
            - $ref: '#/components/schemas/ReplyClassificationEnum'
            - $ref: '#/components/schemas/NullEnum'
        received_on:
          type: string
          format: date-time
          readOnly: true
      required:
        - body_html
        - body_plain_text
        - id
        - received_on
    EmailContentTypeD42Enum:
      enum:
        - text/plain
        - text/html
        - text/rich
      type: string
      description: |-
        * `text/plain` - Plain Text
        * `text/html` - HTML
        * `text/rich` - Rich Text
    ReplyClassificationEnum:
      enum:
        - positive
        - neutral
        - negative
      type: string
      description: |-
        * `positive` - Positive
        * `neutral` - Neutral
        * `negative` - Negative
    NullEnum:
      type: 'null'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 'Enter your API key in the format: X-Api-Key <your_key>'

````