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

# List leads



## OpenAPI

````yaml https://megastream25-api.closebot.com/swagger/v1/swagger.json get /lead
openapi: 3.0.1
info:
  title: CloseBot API
  version: v1
servers:
  - url: https://api.closebot.com
    description: CloseBot API Endpoint
security:
  - Key: []
paths:
  /lead:
    get:
      tags:
        - Lead
      summary: List leads
      parameters:
        - name: page
          in: query
          description: The page number.
          style: form
          schema:
            type: integer
            format: int32
            default: 0
        - name: pageSize
          in: query
          description: The page size.
          style: form
          schema:
            type: integer
            format: int32
            default: 20
        - name: sourceId
          in: query
          description: The source ID.
          style: form
          schema:
            type: string
        - name: leadId
          in: query
          description: The lead ID.
          style: form
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/LeadDtoPaginated'
            application/json:
              schema:
                $ref: '#/components/schemas/LeadDtoPaginated'
            text/json:
              schema:
                $ref: '#/components/schemas/LeadDtoPaginated'
components:
  schemas:
    LeadDtoPaginated:
      type: object
      properties:
        total:
          type: integer
          format: int32
        results:
          type: array
          items:
            $ref: '#/components/schemas/LeadDto'
          nullable: true
        page:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
      additionalProperties: false
    LeadDto:
      type: object
      properties:
        id:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        contactId:
          type: string
          nullable: true
        lastMessageTime:
          type: string
          format: date-time
          nullable: true
        lastMessage:
          type: string
          nullable: true
        lastMessageDirection:
          type: string
          nullable: true
        lastMessageBotId:
          type: string
          nullable: true
        mostRecentFailureReason:
          type: string
          nullable: true
        mimicSourceId:
          type: string
          nullable: true
        starred:
          type: boolean
        unread:
          type: boolean
        source:
          $ref: '#/components/schemas/LeadSourceDto'
        wontRespondUntil:
          type: string
          format: date-time
          nullable: true
        tags:
          type: array
          items:
            type: string
          nullable: true
        fields:
          type: array
          items:
            $ref: '#/components/schemas/LeadFieldDto'
          nullable: true
        instances:
          type: array
          items:
            $ref: '#/components/schemas/BotInstanceDto'
          nullable: true
      additionalProperties: false
    LeadSourceDto:
      type: object
      properties:
        name:
          type: string
          nullable: true
        id:
          type: string
          nullable: true
      additionalProperties: false
    LeadFieldDto:
      type: object
      properties:
        field:
          type: string
          nullable: true
        name:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
        aiProduced:
          type: boolean
      additionalProperties: false
    BotInstanceDto:
      type: object
      properties:
        botId:
          type: string
          nullable: true
        botVersion:
          type: string
          nullable: true
        followUpTimezoneKind:
          type: string
          nullable: true
        followUpTimezone:
          type: string
          nullable: true
        followUpTime:
          type: string
          format: date-time
          nullable: true
        isSmartFollowUpTime:
          type: boolean
        scheduleRespondTime:
          type: string
          format: date-time
          nullable: true
      additionalProperties: false
  securitySchemes:
    Key:
      type: apiKey
      description: CloseBot API Key Authorization
      name: X-CB-KEY
      in: header

````