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

# Update a Lead with Phone / Email Match

> Updates a lead a using the phone number and the email to find a matching lead.



## OpenAPI

````yaml /Sela_API.yaml put /api/leads/update/
openapi: 3.0.3
info:
  title: Sela API
  version: 1.0.2
  description: Voice AI agents with superhuman conversion rates
servers:
  - url: https://api.trysela.com/
    description: Production API
security: []
paths:
  /api/leads/update/:
    put:
      tags:
        - Leads
      summary: Update a Lead with Phone / Email Match
      description: >-
        Updates a lead a using the phone number and the email to find a matching
        lead.
      operationId: leads_update_update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLeadRequestRequest'
            examples:
              CancelMatchedLead:
                value:
                  external_id: id_in_your_crm_123
                  phone_number: '+18042221111'
                  email: first_name@trysela.com
                  status: CANCELLED
                summary: Cancel matched lead
                description: Mark a matched lead as cancelled.
              CloseMatchedLead:
                value:
                  external_id: id_in_your_crm_123
                  phone_number: '+18042221111'
                  email: first_name@trysela.com
                  status: CLOSED
                summary: Close matched lead
                description: Mark a matched lead as closed.
              MarkMatchedLeadLostWithCallDNC:
                value:
                  external_id: id_in_your_crm_123
                  phone_number: '+18042221111'
                  email: first_name@trysela.com
                  status: LOST
                  call_dnc: true
                summary: Mark matched lead lost with call DNC
                description: Mark a matched lead as lost and do not contact for calls.
              MarkMatchedLeadLost:
                value:
                  external_id: id_in_your_crm_123
                  phone_number: '+18042221111'
                  email: first_name@trysela.com
                  status: LOST
                summary: Mark matched lead lost
                description: Mark a matched lead as lost without changing DNC settings.
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateLeadRequestRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UpdateLeadRequestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartialLead'
              examples:
                LeadUpdated:
                  value:
                    id: 28013
                    email: first_name@trysela.com
                    phone_number: '+18042221111'
                    metadata:
                      phone_number: '+18042221111'
                      email: first_name@trysela.com
                      first_name: First
                      last_name: Name
                      timezone: America/Los_Angeles
                      created_at: 02/28/2025 15:09
                      property_address: 123 Main St
                      property_city: San Francisco
                      property_state: California
                      property_zip: '94101'
                      address: 456 2nd St
                      city: Los Angeles
                      state: California
                      zip: '90001'
                      lead_source: USDALoans.com
                      external_id: id_in_your_crm_123
                    modified_time: '2025-02-28T15:09:03.139554-08:00'
                    created_time: '2025-02-28T15:09:03.122515-08:00'
                    status: OPEN
                    status_reason: null
                    lead_source: USDALoans.com
                    lead_type: 123
                    representative: 456
                    next_call_time: 025-02-28T15:09:03.122515-08:00
                    next_call_time_reason: FIRST_CALL
                    external_id: id_in_your_crm_123
                    us_state: CA
                    received_time: '2025-02-28T15:09:03.122515-08:00'
                    reengagements_count: 0
                    last_reengagement_time: null
                    call_schedule_start_time: null
                    sms_dnc: false
                    call_dnc: false
                  summary: Lead updated
          description: Lead updated successfully.
      security:
        - tokenAuth: []
      x-codeSamples:
        - lang: curl
          label: CancelMatchedLead
          source: |-
            curl --request PUT \
              --url https://api.trysela.com/api/leads/update/ \
              --header 'Authorization: Token <api-key>' \
              --header 'Content-Type: application/json' \
              --data '{
                "external_id": "id_in_your_crm_123",
                "phone_number": "+18042221111",
                "email": "first_name@trysela.com",
                "status": "CANCELLED"
              }'
        - lang: curl
          label: CloseMatchedLead
          source: |-
            curl --request PUT \
              --url https://api.trysela.com/api/leads/update/ \
              --header 'Authorization: Token <api-key>' \
              --header 'Content-Type: application/json' \
              --data '{
                "external_id": "id_in_your_crm_123",
                "phone_number": "+18042221111",
                "email": "first_name@trysela.com",
                "status": "CLOSED"
              }'
        - lang: curl
          label: MarkMatchedLeadLostWithCallDNC
          source: |-
            curl --request PUT \
              --url https://api.trysela.com/api/leads/update/ \
              --header 'Authorization: Token <api-key>' \
              --header 'Content-Type: application/json' \
              --data '{
                "external_id": "id_in_your_crm_123",
                "phone_number": "+18042221111",
                "email": "first_name@trysela.com",
                "status": "LOST",
                "call_dnc": true
              }'
        - lang: curl
          label: MarkMatchedLeadLost
          source: |-
            curl --request PUT \
              --url https://api.trysela.com/api/leads/update/ \
              --header 'Authorization: Token <api-key>' \
              --header 'Content-Type: application/json' \
              --data '{
                "external_id": "id_in_your_crm_123",
                "phone_number": "+18042221111",
                "email": "first_name@trysela.com",
                "status": "LOST"
              }'
components:
  schemas:
    UpdateLeadRequestRequest:
      type: object
      properties:
        email:
          type: string
          format: email
          nullable: true
          description: The email address of the lead.
        phone_number:
          type: string
          minLength: 1
          description: >-
            The phone number of the lead. Either E.164 or US format. Must have a
            valid area code.
        metadata:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            Any additional information associated with the lead as json
            metadata. Any of the values supplied here can be used by the agent
            in the talk track. Any additional payload fields that are not part
            of the standard lead fields will be automatically stored in the
            metadata upon lead creation or update, so lead metadata can also be
            sent as additional keys in the payload. Common fields to include in
            the metadata are `first_name` and `last_name`.
        status:
          allOf:
            - $ref: '#/components/schemas/StatusEnum'
          description: |-
            The status of the lead. This is updated automatically.

            * `UNKNOWN` - Unknown
            * `NEW` - New
            * `OPEN` - Open
            * `CALLBACK_TO_TRANSFER` - Callback to transfer
            * `CLOSED` - Closed
            * `CLOSED_INCOMPLETE` - Closed incomplete
            * `LOST` - Lost
            * `SCHEDULE_COMPLETED` - Schedule completed
            * `OUT_OF_TERRITORY` - Out of territory
            * `BAD_NUMBER` - Bad number
            * `CANCELLED` - Cancelled
        status_detail:
          nullable: true
          description: >-
            Sub-type of the status outcome (e.g. blind_transfer, warm_transfer,
            appointment_booked). This is updated automatically.


            * `blind_transfer` - Blind transfer

            * `warm_transfer` - Warm transfer

            * `appointment_booked` - Appointment booked

            * `live_handoff_unavailable` - Live handoff unavailable

            * `escalation` - Escalation

            * `has_call_dnc` - Has call DNC

            * `tcpa_litigator` - TCPA litigator

            * `LEAD_ASSIGNED` - Lead assigned
          oneOf:
            - $ref: '#/components/schemas/StatusDetailEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        lead_type:
          type: integer
          nullable: true
          description: The id of the campaign this lead is a part of.
        representative:
          type: integer
          nullable: true
          description: The id of the representative assigned to this lead.
        external_id:
          type: string
          nullable: true
          description: The external id of the lead. This can be your CRM id.
          maxLength: 255
        us_state:
          nullable: true
          description: >-
            The US state of the lead. This is used to determine the timezone of
            the lead, as well as for compliance with telemarketing regulations.


            * `AL` - Alabama

            * `AK` - Alaska

            * `AS` - American Samoa

            * `AZ` - Arizona

            * `AR` - Arkansas

            * `AA` - Armed Forces Americas

            * `AE` - Armed Forces Europe

            * `AP` - Armed Forces Pacific

            * `CA` - California

            * `CO` - Colorado

            * `CT` - Connecticut

            * `DE` - Delaware

            * `DC` - District of Columbia

            * `FL` - Florida

            * `GA` - Georgia

            * `GU` - Guam

            * `HI` - Hawaii

            * `ID` - Idaho

            * `IL` - Illinois

            * `IN` - Indiana

            * `IA` - Iowa

            * `KS` - Kansas

            * `KY` - Kentucky

            * `LA` - Louisiana

            * `ME` - Maine

            * `MD` - Maryland

            * `MA` - Massachusetts

            * `MI` - Michigan

            * `MN` - Minnesota

            * `MS` - Mississippi

            * `MO` - Missouri

            * `MT` - Montana

            * `NE` - Nebraska

            * `NV` - Nevada

            * `NH` - New Hampshire

            * `NJ` - New Jersey

            * `NM` - New Mexico

            * `NY` - New York

            * `NC` - North Carolina

            * `ND` - North Dakota

            * `MP` - Northern Mariana Islands

            * `OH` - Ohio

            * `OK` - Oklahoma

            * `OR` - Oregon

            * `PA` - Pennsylvania

            * `PR` - Puerto Rico

            * `RI` - Rhode Island

            * `SC` - South Carolina

            * `SD` - South Dakota

            * `TN` - Tennessee

            * `TX` - Texas

            * `UT` - Utah

            * `VT` - Vermont

            * `VI` - Virgin Islands

            * `VA` - Virginia

            * `WA` - Washington

            * `WV` - West Virginia

            * `WI` - Wisconsin

            * `WY` - Wyoming
          oneOf:
            - $ref: '#/components/schemas/UsStateEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        lead_source:
          type: string
          nullable: true
          description: The source of the lead. This can be used to track the lead provider.
          maxLength: 255
        call_schedule_start_time:
          type: string
          format: date-time
          nullable: true
        sms_dnc:
          type: boolean
          description: >-
            Set whether the lead is marked as do not contact for the SMS
            channel.
        call_dnc:
          type: boolean
          description: >-
            Set whether the lead is marked as do not contact for the call
            channel.
      required:
        - phone_number
    PartialLead:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        email:
          type: string
          format: email
          nullable: true
          description: The email address of the lead.
        phone_number:
          type: string
          description: >-
            The phone number of the lead. Either E.164 or US format. Must have a
            valid area code.
        metadata:
          type: object
          additionalProperties: true
          nullable: true
          description: >-
            Any additional information associated with the lead as json
            metadata. Any of the values supplied here can be used by the agent
            in the talk track. Any additional payload fields that are not part
            of the standard lead fields will be automatically stored in the
            metadata upon lead creation or update, so lead metadata can also be
            sent as additional keys in the payload. Common fields to include in
            the metadata are `first_name` and `last_name`.
        modified_time:
          type: string
          format: date-time
          readOnly: true
          description: The last time this lead was modified.
        created_time:
          type: string
          format: date-time
          readOnly: true
          description: The time this lead was created.
        status:
          allOf:
            - $ref: '#/components/schemas/StatusEnum'
          description: |-
            The status of the lead. This is updated automatically.

            * `UNKNOWN` - Unknown
            * `NEW` - New
            * `OPEN` - Open
            * `CALLBACK_TO_TRANSFER` - Callback to transfer
            * `CLOSED` - Closed
            * `CLOSED_INCOMPLETE` - Closed incomplete
            * `LOST` - Lost
            * `SCHEDULE_COMPLETED` - Schedule completed
            * `OUT_OF_TERRITORY` - Out of territory
            * `BAD_NUMBER` - Bad number
            * `CANCELLED` - Cancelled
        status_detail:
          nullable: true
          description: >-
            Sub-type of the status outcome (e.g. blind_transfer, warm_transfer,
            appointment_booked). This is updated automatically.


            * `blind_transfer` - Blind transfer

            * `warm_transfer` - Warm transfer

            * `appointment_booked` - Appointment booked

            * `live_handoff_unavailable` - Live handoff unavailable

            * `escalation` - Escalation

            * `has_call_dnc` - Has call DNC

            * `tcpa_litigator` - TCPA litigator

            * `LEAD_ASSIGNED` - Lead assigned
          oneOf:
            - $ref: '#/components/schemas/StatusDetailEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        status_reason:
          nullable: true
          description: >-
            The reason for the current status of the lead. This is updated
            automatically.


            * `UNKNOWN` - Unknown

            * `WEBHOOK` - Webhook

            * `MANUAL` - Manual

            * `CHAT` - Chat

            * `REENGAGEMENT` - Reengagement
          oneOf:
            - $ref: '#/components/schemas/StatusReasonEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        lead_type:
          type: integer
          nullable: true
          description: The id of the campaign this lead is a part of.
        representative:
          type: integer
          nullable: true
          description: The id of the representative assigned to this lead.
        next_call_time:
          type: string
          nullable: true
          readOnly: true
          description: The time of the next call scheduled for this lead.
        next_call_time_reason:
          type: string
          nullable: true
          readOnly: true
          description: The reasons for the next call scheduled time for this lead.
        external_id:
          type: string
          nullable: true
          description: The external id of the lead. This can be your CRM id.
          maxLength: 255
        us_state:
          nullable: true
          description: >-
            The US state of the lead. This is used to determine the timezone of
            the lead, as well as for compliance with telemarketing regulations.


            * `AL` - Alabama

            * `AK` - Alaska

            * `AS` - American Samoa

            * `AZ` - Arizona

            * `AR` - Arkansas

            * `AA` - Armed Forces Americas

            * `AE` - Armed Forces Europe

            * `AP` - Armed Forces Pacific

            * `CA` - California

            * `CO` - Colorado

            * `CT` - Connecticut

            * `DE` - Delaware

            * `DC` - District of Columbia

            * `FL` - Florida

            * `GA` - Georgia

            * `GU` - Guam

            * `HI` - Hawaii

            * `ID` - Idaho

            * `IL` - Illinois

            * `IN` - Indiana

            * `IA` - Iowa

            * `KS` - Kansas

            * `KY` - Kentucky

            * `LA` - Louisiana

            * `ME` - Maine

            * `MD` - Maryland

            * `MA` - Massachusetts

            * `MI` - Michigan

            * `MN` - Minnesota

            * `MS` - Mississippi

            * `MO` - Missouri

            * `MT` - Montana

            * `NE` - Nebraska

            * `NV` - Nevada

            * `NH` - New Hampshire

            * `NJ` - New Jersey

            * `NM` - New Mexico

            * `NY` - New York

            * `NC` - North Carolina

            * `ND` - North Dakota

            * `MP` - Northern Mariana Islands

            * `OH` - Ohio

            * `OK` - Oklahoma

            * `OR` - Oregon

            * `PA` - Pennsylvania

            * `PR` - Puerto Rico

            * `RI` - Rhode Island

            * `SC` - South Carolina

            * `SD` - South Dakota

            * `TN` - Tennessee

            * `TX` - Texas

            * `UT` - Utah

            * `VT` - Vermont

            * `VI` - Virgin Islands

            * `VA` - Virginia

            * `WA` - Washington

            * `WV` - West Virginia

            * `WI` - Wisconsin

            * `WY` - Wyoming
          oneOf:
            - $ref: '#/components/schemas/UsStateEnum'
            - $ref: '#/components/schemas/BlankEnum'
            - $ref: '#/components/schemas/NullEnum'
        lead_source:
          type: string
          nullable: true
          description: The source of the lead. This can be used to track the lead provider.
          maxLength: 255
        received_time:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: The time this lead was received by an API call.
        reengagements_count:
          type: integer
          description: The total number of times this lead has been reengaged.
          readOnly: true
        last_reengagement_time:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: The time this lead was last reengaged.
        call_schedule_start_time:
          type: string
          format: date-time
          nullable: true
        sms_dnc:
          type: boolean
          description: >-
            If True, the lead has been marked as do not contact for the SMS
            channel (DNC).
          readOnly: true
        call_dnc:
          type: boolean
          description: >-
            If True, the lead has been marked as do not contact for the call
            channel (DNC).
          readOnly: true
      required:
        - call_dnc
        - created_time
        - id
        - last_reengagement_time
        - modified_time
        - next_call_time
        - next_call_time_reason
        - phone_number
        - received_time
        - reengagements_count
        - sms_dnc
    StatusEnum:
      enum:
        - UNKNOWN
        - NEW
        - OPEN
        - CALLBACK_TO_TRANSFER
        - CLOSED
        - CLOSED_INCOMPLETE
        - LOST
        - SCHEDULE_COMPLETED
        - OUT_OF_TERRITORY
        - BAD_NUMBER
        - CANCELLED
      type: string
      description: |-
        * `UNKNOWN` - Unknown
        * `NEW` - New
        * `OPEN` - Open
        * `CALLBACK_TO_TRANSFER` - Callback to transfer
        * `CLOSED` - Closed
        * `CLOSED_INCOMPLETE` - Closed incomplete
        * `LOST` - Lost
        * `SCHEDULE_COMPLETED` - Schedule completed
        * `OUT_OF_TERRITORY` - Out of territory
        * `BAD_NUMBER` - Bad number
        * `CANCELLED` - Cancelled
    StatusDetailEnum:
      enum:
        - blind_transfer
        - warm_transfer
        - appointment_booked
        - live_handoff_unavailable
        - escalation
        - has_call_dnc
        - tcpa_litigator
        - LEAD_ASSIGNED
      type: string
      description: |-
        * `blind_transfer` - Blind transfer
        * `warm_transfer` - Warm transfer
        * `appointment_booked` - Appointment booked
        * `live_handoff_unavailable` - Live handoff unavailable
        * `escalation` - Escalation
        * `has_call_dnc` - Has call DNC
        * `tcpa_litigator` - TCPA litigator
        * `LEAD_ASSIGNED` - Lead assigned
    BlankEnum:
      enum:
        - ''
    NullEnum:
      enum:
        - null
    UsStateEnum:
      enum:
        - AL
        - AK
        - AS
        - AZ
        - AR
        - AA
        - AE
        - AP
        - CA
        - CO
        - CT
        - DE
        - DC
        - FL
        - GA
        - GU
        - HI
        - ID
        - IL
        - IN
        - IA
        - KS
        - KY
        - LA
        - ME
        - MD
        - MA
        - MI
        - MN
        - MS
        - MO
        - MT
        - NE
        - NV
        - NH
        - NJ
        - NM
        - NY
        - NC
        - ND
        - MP
        - OH
        - OK
        - OR
        - PA
        - PR
        - RI
        - SC
        - SD
        - TN
        - TX
        - UT
        - VT
        - VI
        - VA
        - WA
        - WV
        - WI
        - WY
      type: string
      description: |-
        * `AL` - Alabama
        * `AK` - Alaska
        * `AS` - American Samoa
        * `AZ` - Arizona
        * `AR` - Arkansas
        * `AA` - Armed Forces Americas
        * `AE` - Armed Forces Europe
        * `AP` - Armed Forces Pacific
        * `CA` - California
        * `CO` - Colorado
        * `CT` - Connecticut
        * `DE` - Delaware
        * `DC` - District of Columbia
        * `FL` - Florida
        * `GA` - Georgia
        * `GU` - Guam
        * `HI` - Hawaii
        * `ID` - Idaho
        * `IL` - Illinois
        * `IN` - Indiana
        * `IA` - Iowa
        * `KS` - Kansas
        * `KY` - Kentucky
        * `LA` - Louisiana
        * `ME` - Maine
        * `MD` - Maryland
        * `MA` - Massachusetts
        * `MI` - Michigan
        * `MN` - Minnesota
        * `MS` - Mississippi
        * `MO` - Missouri
        * `MT` - Montana
        * `NE` - Nebraska
        * `NV` - Nevada
        * `NH` - New Hampshire
        * `NJ` - New Jersey
        * `NM` - New Mexico
        * `NY` - New York
        * `NC` - North Carolina
        * `ND` - North Dakota
        * `MP` - Northern Mariana Islands
        * `OH` - Ohio
        * `OK` - Oklahoma
        * `OR` - Oregon
        * `PA` - Pennsylvania
        * `PR` - Puerto Rico
        * `RI` - Rhode Island
        * `SC` - South Carolina
        * `SD` - South Dakota
        * `TN` - Tennessee
        * `TX` - Texas
        * `UT` - Utah
        * `VT` - Vermont
        * `VI` - Virgin Islands
        * `VA` - Virginia
        * `WA` - Washington
        * `WV` - West Virginia
        * `WI` - Wisconsin
        * `WY` - Wyoming
    StatusReasonEnum:
      enum:
        - UNKNOWN
        - WEBHOOK
        - MANUAL
        - CHAT
        - REENGAGEMENT
      type: string
      description: |-
        * `UNKNOWN` - Unknown
        * `WEBHOOK` - Webhook
        * `MANUAL` - Manual
        * `CHAT` - Chat
        * `REENGAGEMENT` - Reengagement
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````