---
title: "Update Leads"
method: PUT
path: "/{sub_domain}/api/leads/mass-update"
tags: ["Leads"]
---

# Update Leads

`PUT /{sub_domain}/api/leads/mass-update`

## Request

- Base URL: `https://api.commpeak.com/dialer`
- URL: `https://api.commpeak.com/dialer/{sub_domain}/api/leads/mass-update`
- Auth: API key in header `Authorization`

Update multiple leads that match a filter, applying the same changes to each.

**When to use.** Change many leads in one request. To update a single known lead, use `PUT /leads/{id}`.

**Request body.** A JSON object with two keys:
- `where`: the filter selecting which leads to update. Each key is a lead field, a scalar matches by equality and an array matches any of the listed values.
- `update`: the fields and new values to apply, optionally including a `customFields` object of your own field name and value pairs.

**Returns.** `{ "leads": [ ... ] }` with the updated leads. If some values could not be applied, a `messages` array describes what was skipped.

**Example.** `PUT /api/leads/mass-update` with body `{ "where": { "id": [ 1, 2 ] }, "update": { "first_name": "John" } }`

## Path parameters

- `sub_domain` string, required: Dialer Name (subdomain)

## Request body

- LeadMassUpdateInput
  - `where` object, required: Criteria selecting the leads to update. Each key is a lead field; a scalar matches by equality and an array matches with IN (...).
  - `update` object, required: Fields and their new values to apply to the selected leads. May include a customFields object.

## Response `200`

Successful Response

- LeadsListResponse
  - `leads` LeadItem[], required
    - `id` integer, nullable: Lead ID.
    - `lead_file_id` integer, nullable: Lead file ID.
    - `api_user_id` integer, nullable: API user ID.
    - `first_name` string, nullable: First name.
    - `last_name` string, nullable: Last name.
    - `phone` string, nullable: Phone.
    - `phone_normalized` string, nullable: Phone normalized.
    - `country_id` integer, nullable: Country ID.
    - `timezone_id` integer, nullable: Timezone ID.
    - `support_site` string, nullable: Support site.
    - `purchase_site` string, nullable: Purchase site.
    - `purchase_amount` integer, nullable: Purchase amount.
    - `is_deleted` integer, nullable: Is deleted (1 - deleted, 0 - active).
    - `is_do_not_call` integer, nullable: Is do not call.
    - `is_locked` integer, nullable: Is locked (1 - in call, 0 - available).
    - `hlr` integer, nullable: HLR.
    - `created_at` string, nullable: Created at.
    - `updated_at` string, nullable: Updated at.
    - `customFields` object, nullable: Custom field name/value pairs.
  - `total_leads` integer, nullable: Total number of leads in the response.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/commpeak/apis/commpeak-dialer-api.md) - [All operations](https://skmtc.dev/commpeak/apis/commpeak-dialer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/commpeak/apis/commpeak-dialer-api/revisions/18c5edc07544?raw)
