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

# Search Leads

> Retrieves the leads associated with a specific outbound



## OpenAPI

````yaml post /v1/Outbound/{outboundId}/Leads
openapi: 3.0.1
info:
  title: NLPearl Client API
  description: A sample API that demonstrates features in the OpenAPI specification
  version: v1
servers:
  - url: https://api.nlpearl.ai
    description: Production Environement
security:
  - bearer_auth: []
paths:
  /v1/Outbound/{outboundId}/Leads:
    post:
      tags:
        - Outbound
      summary: Search Leads
      description: Retrieves the leads associated with a specific outbound
      parameters:
        - name: outboundId
          in: path
          description: The unique identifier of the outbound.
          required: true
          schema:
            type: string
      requestBody:
        description: Search criteria for the leads.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/LeadSearch'
              description: >-
                Extends TableSearch to include specific search criteria for
                leads.
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/LeadSearch'
              description: >-
                Extends TableSearch to include specific search criteria for
                leads.
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/LeadSearch'
              description: >-
                Extends TableSearch to include specific search criteria for
                leads.
      responses:
        '200':
          description: List of leads for the outbound.
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/LeadListApiViewTableSearchResult'
            application/json:
              schema:
                $ref: '#/components/schemas/LeadListApiViewTableSearchResult'
            text/json:
              schema:
                $ref: '#/components/schemas/LeadListApiViewTableSearchResult'
        '400':
          description: Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
components:
  schemas:
    LeadSearch:
      type: object
      properties:
        skip:
          type: integer
          description: Number of entries to skip for pagination.
          format: int32
        limit:
          type: integer
          description: Limit on the number of entries to return.
          format: int32
        sortProp:
          type: string
          description: Property name to sort by.
          nullable: true
        isAscending:
          type: boolean
          description: Whether the sort order is ascending.
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/eLeadStatusInputView'
          description: >+
            Optional filters for the status of the leads. Only leads with this
            status will be included in the results.

          nullable: true
        searchInput:
          type: string
          description: Text to filter by.
          nullable: true
      additionalProperties: false
      description: Extends TableSearch to include specific search criteria for leads.
    LeadListApiViewTableSearchResult:
      type: object
      properties:
        count:
          type: integer
          description: The total number of items matching the search criteria.
          format: int64
        results:
          type: array
          items:
            $ref: '#/components/schemas/LeadListApiView'
          description: >-
            The list of results for the current page, based on the search
            criteria.
          nullable: true
      additionalProperties: false
    ValidationProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          nullable: true
      additionalProperties: {}
    eLeadStatusInputView:
      type: integer
      description: |+
        `1 - New`

        `10 - NeedRetry`

        `20 - InCallQueue`

        `30 - WrongCountryCode`

        `40 - OnCall`

        `70 - VoiceMailLeft`

        `100 - Success`

        `110 - NotSuccessful`

        `130 - Completed`

        `150 - Unreachable`

        `200 - Deleted`

        `220 - Blacklisted`

        `500 - Error`

      format: int32
    LeadListApiView:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the lead.
          nullable: true
        externalId:
          type: string
          description: >-
            The external ID of the lead, typically from a CRM request or another
            external source.
          nullable: true
        phoneNumber:
          type: string
          description: The phone number of the lead.
          nullable: true
        timeZoneId:
          type: string
          description: The time zone of the lead.
          nullable: true
        status:
          allOf:
            - $ref: '#/components/schemas/eLeadStatusView'
          description: >+
            The Status of the lead is the status of the last conversation.


            To determine the definition of 'Success' or 'Not Successful,' please
            refer to the [Create a Pearl](/pages/create_pearl#pearl-name) page
            at step 4.


            `1 - New`


            `10 - NeedRetry`


            `20 - InCallQueue`


            `30 - WrongCountryCode`


            `40 - OnCall`


            `70 - VoiceMailLeft`


            `100 - Success`


            `110 - NotSuccessful`


            `130 - Completed`


            `150 - Unreachable`


            `220 - Blacklisted`


            `300 - QueueAbandon`


            `500 - Error`

        created:
          type: string
          description: The date and time when the lead was created.
          format: date-time
        callData:
          type: object
          additionalProperties:
            type: string
          description: "A dictionary containing additional information about the call.\r\nIt is used as variables that you can use in \"Opening Sentence\" or \"Flow Script\" when you create a Pearl on the platform.\r\nThe keys represent the field names, and the values contain the corresponding data.\r\nThis information can be used to personalize the conversation or manage lead-specific details.\r\nThis parameter is optional.\r\nsee [Variables](/pages/variables) for more information.\r\nHere is an example of the json to send:\r\n`{ \"email\" : \"joe@gmail.com\", \"address\": \"3 Abbey Road UK\" , \"carLicense\" : \"90-929-82\" }`"
          nullable: true
      additionalProperties: false
    eLeadStatusView:
      type: integer
      description: >+
        The Status of the lead is the status of the last conversation.


        To determine the definition of 'Success' or 'Not Successful,' please
        refer to the [Create a Pearl](/pages/create_pearl#pearl-name) page at
        step 4.


        `1 - New`


        `10 - NeedRetry`


        `20 - InCallQueue`


        `30 - WrongCountryCode`


        `40 - OnCall`


        `70 - VoiceMailLeft`


        `100 - Success`


        `110 - NotSuccessful`


        `130 - Completed`


        `150 - Unreachable`


        `220 - Blacklisted`


        `300 - QueueAbandon`


        `500 - Error`

      format: int32
  securitySchemes:
    bearer_auth:
      type: http
      description: >-
        Specify the authorization token.


        For more information, check out the [Authorization
        Guide](/api-reference/authorization).
      scheme: bearer

````