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

# Update campaign leads

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

## Request

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

Update fields on many campaign leads in a single request.

**When to use.** Change lead details or campaign-lead settings (status, weight, assignment and more) across a set of campaign leads selected by their IDs.

**Parameters.**

- `where.id` (array of integers, required): the campaign-lead IDs to update.
- `update` (object, required): the fields to change, split into two groups. At least one group must be present.
  - `lead`: fields on the lead itself, such as `first_name`, `phone`, `email`, `timezone_id`, `call_after`.
  - `campaignLead`: fields on the campaign-lead assignment, such as `status_id`, `assigned_user_id`, `weight`, `call_after`. For `weight`, a plain number sets the value (1 to 65536), while a leading `+` or `-` increases or decreases the current weight.

**Returns.** `{ "data": [ ... ], "messages": [ ... ] }`. `data` holds the updated campaign leads, each with its related lead embedded under `lead`, and `messages` carries informational notes, for example a timezone that could not be applied.

**Example.**

```json
{ "where": { "id": [4, 5] }, "update": { "campaignLead": { "weight": "+10" } } }
```

## Path parameters

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

## Request body

- UpdateCampaignLeadsInput
  - `where` CampaignLeadIdsWhereClause, required
    - `id` integer[], required: Campaign lead IDs.
  - `update` object, required: Key/value pairs to update. Split into "lead" and "campaignLead" entities; at least one must be present.

## Response `200`

Successful Response

- CampaignLeadsUpdateResponse
  - `data` object[], required
  - `messages` unknown[], nullable: Informational messages (e.g. skipped timezone updates).
    - unknown

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