Skip to Content
CallMitraDocs
API referenceCampaigns

Add or remove leads

New leads are dialed automatically if the campaign is running. Removed leads keep their call history. A lead already on the campaign, or a number already on it, is skipped.

PUT
/api/v1/campaigns/{campaign_id}/leads

New leads are dialed automatically if the campaign is running. Removed leads keep their call history. A lead already on the campaign, or a number already on it, is skipped.

Authorization

headerX-API-Key<token>

Create in the console: Settings → API & webhooks.

Path Parameters

campaign_id*string

Campaign ID.

Formatuuid

Request Body

application/json
  1. body

Leads to add to or remove from a campaign.

added?array<>

Lead IDs to add. Removed leads are added back.

confirmRemovedContacted?Confirmremovedcontacted

Required to remove leads that were already called; otherwise the request returns 409 campaign_leads_need_confirmation with their IDs.

Defaultfalse
removed?array<>

Lead IDs to remove.

[key: string]?any

Response Body

OK

application/json
  1. response

What changed on the campaign's lead list.

added?|

Leads added, including re-added ones.

campaign?|

The campaign.

dialScheduled?|

A dial round was scheduled for the new leads.

message?|

Human-readable confirmation.

reactivated?|

Previously removed leads added back.

removed?|

Leads removed.

success?|

Always true.

[key: string]?any
Example Request
curl -X PUT 'https://api.callmitra.ai/api/v1/campaigns/497f6eca-6276-4993-bfeb-53cbbbba6f08/leads' \  -H 'Content-Type: application/json' \  -d '{  "added": [    "5a1d2c3b-4e5f-4a6b-8c7d-9e0f1a2b3c4d"  ],  "removed": []}'
Example Response
{  "added": 1,  "campaign": {    "id": "3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d"  },  "dialScheduled": true,  "message": "Updated",  "reactivated": 0,  "removed": 0,  "success": true}