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

# Bulk Update Leads

> Updates multiple leads in one request. Each item must include an `id` and may include the same fields as `PATCH /api/leads/{id}/`. Results preserve request order and report whether each item was queued or failed request-level validation. Queued items are processed asynchronously in bounded Celery batches.



## OpenAPI

````yaml /Sela_API.yaml patch /api/leads/bulk-update/
openapi: 3.0.3
info:
  title: Sela API
  version: 1.0.2
  description: >-
    Create and manage leads, configure outbound webhook subscriptions, and use
    customer-specific lead ingestion workflows. Unless an endpoint says
    otherwise, authenticate with `Authorization: Token <api-key>`.
servers:
  - url: https://api.trysela.com/
    description: Production API
security: []
tags:
  - name: Leads
    description: Create, retrieve, update, and schedule customer leads.
  - name: Call Control
    description: Pause or resume outbound calling for an API user.
  - name: Lead Types
    description: >-
      Discover lead categories and the public metadata fields accepted for each
      one.
  - name: Webhooks
    description: >-
      Manage subscriptions that deliver lead and call events to customer
      systems.
  - name: Lead Ingestion
    description: >-
      Submit provider-specific lead payloads through ingestion URLs configured
      by Sela.
  - name: File Ingestion
    description: Request temporary upload URLs for configured CSV ingestion sources.
paths:
  /api/leads/bulk-update/:
    patch:
      tags:
        - Leads
      summary: Bulk Update Leads
      description: >-
        Updates multiple leads in one request. Each item must include an `id`
        and may include the same fields as `PATCH /api/leads/{id}/`. Results
        preserve request order and report whether each item was queued or failed
        request-level validation. Queued items are processed asynchronously in
        bounded Celery batches.
      operationId: leads_bulk_update_partial_update
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - leads
              properties:
                leads:
                  type: array
                  minItems: 1
                  items:
                    allOf:
                      - $ref: '#/components/schemas/PatchedUpdateLeadRequestRequest'
                      - type: object
                        required:
                          - id
                        properties:
                          id:
                            type: integer
            examples:
              BulkUpdateLeads:
                value:
                  leads:
                    - id: 123
                      call_dnc: true
                      status: LOST
                    - id: 456
                      status: CANCELLED
                summary: Bulk update leads
                description: Update multiple leads with a single request.
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkUpdateLeadResponse'
              examples:
                BulkUpdateResult:
                  value:
                    results:
                      - id: 123
                        action: queued
                        task_id: bulk-update-batch-task-id
                      - id: 456
                        action: queued
                        task_id: bulk-update-batch-task-id
                  summary: Bulk update result
          description: Per-lead bulk update results.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                MissingLeadsList:
                  value:
                    leads:
                      - Request body must contain a 'leads' list.
                  summary: Missing leads list
          description: Request body is missing a leads list or exceeds the bulk limit.
      security:
        - tokenAuth: []
      x-codeSamples:
        - lang: curl
          label: BulkUpdateLeads
          source: |-
            curl --request PATCH \
              --url https://api.trysela.com/api/leads/bulk-update/ \
              --header 'Authorization: Token <api-key>' \
              --header 'Content-Type: application/json' \
              --data '{
                "leads": [
                  {
                    "id": 123,
                    "call_dnc": true,
                    "status": "LOST"
                  },
                  {
                    "id": 456,
                    "status": "CANCELLED"
                  }
                ]
              }'
components:
  schemas:
    PatchedUpdateLeadRequestRequest:
      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

            * `application_link_sms` - Application link SMS
          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.
    BulkUpdateLeadResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/BulkUpdateLeadResult'
      required:
        - results
    ErrorResponse:
      type: object
      properties:
        non_field_errors:
          type: array
          items:
            type: string
        phone_number:
          type: array
          items:
            type: string
        email:
          type: array
          items:
            type: string
        detail:
          type: string
        leads:
          type: array
          items:
            type: string
    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
        - application_link_sms
      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
        * `application_link_sms` - Application link SMS
    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
    BulkUpdateLeadResult:
      type: object
      properties:
        id:
          type: integer
          nullable: true
        action:
          $ref: '#/components/schemas/BulkUpdateLeadResultActionEnum'
        task_id:
          type: string
        error:
          type: string
      required:
        - action
        - id
    BulkUpdateLeadResultActionEnum:
      enum:
        - queued
        - error
      type: string
      description: |-
        * `queued` - queued
        * `error` - error
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````