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

# Update Lead

> Updates the details of an existing lead associated with a specific outbound campaign.



## OpenAPI

````yaml put /v2/Outbound/{pearlId}/Lead/{leadId}
openapi: 3.0.1
info:
  title: NLPearl Client API
  description: A sample API that demonstrates features in the OpenAPI specification
  version: v2
servers:
  - url: https://api.nlpearl.ai
    description: Production Environement
security:
  - bearer_auth: []
paths:
  /v2/Outbound/{pearlId}/Lead/{leadId}:
    put:
      tags:
        - Outbound
      summary: Update Lead
      description: >-
        Updates the details of an existing lead associated with a specific
        outbound campaign.
      parameters:
        - name: pearlId
          in: path
          required: true
          schema:
            type: string
        - name: leadId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/LeadToUpdateApi'
              description: "Represents the data used to update an existing lead in an outbound campaign.\r\nAll fields are optional; only the provided values will be updated."
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/LeadToUpdateApi'
              description: "Represents the data used to update an existing lead in an outbound campaign.\r\nAll fields are optional; only the provided values will be updated."
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/LeadToUpdateApi'
              description: "Represents the data used to update an existing lead in an outbound campaign.\r\nAll fields are optional; only the provided values will be updated."
      responses:
        '200':
          description: The updated lead is returned.
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/LeadApiView'
            application/json:
              schema:
                $ref: '#/components/schemas/LeadApiView'
            text/json:
              schema:
                $ref: '#/components/schemas/LeadApiView'
        '400':
          description: The request is invalid or the data is malformed.
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
components:
  schemas:
    LeadToUpdateApi:
      type: object
      properties:
        phoneNumber:
          type: string
          description: "The updated phone number of the lead.  \r\nIf provided, it will replace the existing phone number."
          nullable: true
        externalId:
          type: string
          description: "An updated external identifier for the lead.  \r\nThis can be used to link the lead with external systems."
          nullable: true
        timeZoneId:
          type: string
          description: "Optional time zone identifier for the lead.  \r\nIf set, this overrides the default time zone configured on the outbound.  \r\nFor accepted values, refer to the [Windows Time Zones list](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11).  \r\nExample: `\"Pacific Standard Time\"`, `\"Türkiye Standard Time\"`."
          nullable: true
        callData:
          type: object
          additionalProperties:
            type: string
          description: "A dictionary containing additional lead information.  \r\nThese values can be used in the Pearl's \"Opening Sentence\" or \"Flow Script\".  \r\nThe `key` is the variable ID and the `value` is its value.  \r\nSee [Variables](/pages/variables) for more details.  \r\nExample: `{ \"email\": \"joe@gmail.com\", \"carLicense\": \"90-929-82\" }`"
          nullable: true
        status:
          allOf:
            - $ref: '#/components/schemas/eLeadStatusInputApi'
          description: >+
            The new status to assign to the lead.


            This can be used to update the lead's progression or interaction
            result.


            For example, if you want the outbound campaign to stop calling this
            lead, you can set the status to `Completed`.

            Or, if the lead already converted successfully in an external CRM,
            you can mark it directly as `Success`.


            `1 - New`


            `10 - NeedRetry`


            `100 - Success`


            `110 - NotSuccessful`


            `130 - Completed`

          nullable: true
      additionalProperties: false
      description: "Represents the data used to update an existing lead in an outbound campaign.\r\nAll fields are optional; only the provided values will be updated."
    LeadApiView:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the lead, represented as an ObjectId.
          nullable: true
        externalId:
          type: string
          description: The identifier for the lead from an external system, such as a CRM.
          nullable: true
        phoneNumber:
          type: string
          description: The phone number of the lead.
          nullable: true
        timeZone:
          type: string
          description: >-
            The time zone of the lead, represented as a float (e.g., -5.0 for
            EST).
          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
        callsId:
          type: array
          items:
            type: string
          description: The list of the ID's of all the calls this lead has received.
          nullable: true
        lastCall:
          allOf:
            - $ref: '#/components/schemas/LeadLastCallApiView'
          nullable: true
        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
        collectedData:
          type: object
          additionalProperties: {}
          description: "A dictionary containing all the information collected about the lead during the call.  \r\nThese values are the result of the conversation and reflect the answers or actions taken by the lead.  \r\nThe `key` represents the ID of the variable configured on the platform,  \r\nand the `value` corresponds to the collected data.  \r\n            \r\nThis information can be used to understand user intent, track specific responses, or power further automation.  \r\nFor more details on how variables work, see [Variables](/pages/variables).\r\n            \r\nHere is an example of the JSON format:\r\n`{ \"confirmBooking\": true, \"dropOffLocation\": \"Orly Airport\", \"rideTime\": \"Friday at 12:00\", \"userIntent\": \"Book a taxi to the airport\" }`"
          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: {}
    eLeadStatusInputApi:
      type: integer
      description: >+
        The new status to assign to the lead.


        This can be used to update the lead's progression or interaction result.


        For example, if you want the outbound campaign to stop calling this
        lead, you can set the status to `Completed`.

        Or, if the lead already converted successfully in an external CRM, you
        can mark it directly as `Success`.


        `1 - New`


        `10 - NeedRetry`


        `100 - Success`


        `110 - NotSuccessful`


        `130 - Completed`

      format: int32
    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
    LeadLastCallApiView:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the call.
          nullable: true
        startTime:
          type: string
          description: The date and time when the call processing started.
          format: date-time
        pearlId:
          type: string
          description: The ID of the Pearl Used in This Call.
          nullable: true
        status:
          allOf:
            - $ref: '#/components/schemas/eCallStatusView'
          description: |+
            Represents the current status of a call.

            `3 - InProgress`

            `4 - Completed`

            `5 - Busy`

            `6 - Failed`

            `7 - NoAnswer`

            `8 - Canceled`

        from:
          type: string
          description: The phone number from which the call was made.
          nullable: true
        name:
          type: string
          description: The name associated with the call, if available.
          nullable: true
        collectedData:
          allOf:
            - $ref: '#/components/schemas/CallCollectedDataApiView'
          description: The object including all the information collected during the call.
          nullable: true
        summary:
          type: string
          description: A summary of the conversation.
          nullable: true
        duration:
          type: integer
          description: The duration of the call in seconds.
          format: int32
        recording:
          type: string
          description: The URL of the recording of the call, if available.
          nullable: true
        tags:
          type: array
          items:
            type: string
          description: The tags or labels triggered during the conversation
          nullable: true
      additionalProperties: false
    eCallStatusView:
      type: integer
      description: |+
        Represents the current status of a call.

        `3 - InProgress`

        `4 - Completed`

        `5 - Busy`

        `6 - Failed`

        `7 - NoAnswer`

        `8 - Canceled`

      format: int32
    CallCollectedDataApiView:
      type: object
      properties:
        transcript:
          type: array
          items:
            $ref: '#/components/schemas/AgentChatMessageApiView'
          description: The transcript of the conversation.
          nullable: true
        collectedInfos:
          type: array
          items:
            $ref: '#/components/schemas/CollectedInfoView'
          description: The information collected during the conversations.
          nullable: true
      additionalProperties: false
    AgentChatMessageApiView:
      type: object
      properties:
        role:
          allOf:
            - $ref: '#/components/schemas/eChatMessageRoleView'
          description: |+
            `2 - Pearl`

            `3 - Client`

        content:
          type: string
          description: The content of the message
          nullable: true
        startTime:
          type: number
          description: The moment the message starts
          format: float
          nullable: true
        endTime:
          type: number
          description: The moment the message ends
          format: float
          nullable: true
      additionalProperties: false
    CollectedInfoView:
      type: object
      properties:
        id:
          type: string
          description: The ID of the variable collected
          nullable: true
        name:
          type: string
          description: The display name of the variable collected.
          nullable: true
        value:
          description: The value of the variable collected.
          nullable: true
      additionalProperties: false
    eChatMessageRoleView:
      type: integer
      description: |+
        `2 - Pearl`

        `3 - Client`

      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

````