Create a campaign with its leads
The usual way to start: one request creates the campaign and adds or creates its leads. Start it with `POST /campaigns/{campaign_id}/start`, or send `campaignData.isActive: true` to start it right away (the same checks as start apply).
The usual way to start: one request creates the campaign and adds or creates its leads. Start it with POST /campaigns/{campaign_id}/start, or send campaignData.isActive: true to start it right away (the same checks as start apply).
X-API-Key<token>Create in the console: Settings → API & webhooks.
Idempotency-Key?stringAny unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.
length <= 255application/json- body
A new campaign plus the leads to put on it.
campaignData?|The campaign. name and agentId are required.
copySettingsFromCampaignId?CopysettingsfromcampaignidStart from another campaign's settings and webhook; campaignData.settings overrides them.
uuidleadSourceType?Leadsourcetypebulk_upload creates the leads in uploadedLeads; existing_leads adds leads you already have. Optional only for a catch-all inbound campaign.
"bulk_upload""existing_leads"selectedLeadIds?array<>With existing_leads: IDs of leads to add.
selectedLeadSourceIds?array<>With existing_leads: add every lead of these sources (used when no lead IDs are given).
uploadedLeads?array<>|With bulk_upload: the leads to create. Repeated numbers are added once.
[key: string]?anyOK
application/json- response
The new campaign's ID and how many leads it holds.
campaignId?|ID of the new campaign.
message?|Human-readable confirmation.
processedLeads?|Leads added to the campaign.
success?|Always true.
[key: string]?anycurl -X POST 'https://api.callmitra.ai/api/v1/campaigns/create-with-leads' \ -H 'Content-Type: application/json' \ -d '{ "campaignData": { "agentId": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d", "name": "December renewals", "settings": { "maxCallsPerDay": 200 } }, "leadSourceType": "bulk_upload", "uploadedLeads": [ { "attributes": { "city": "Pune" }, "name": "Asha Rao", "phone": "+919876543210" } ]}'{ "campaignId": "3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d", "message": "Campaign created", "processedLeads": 1, "success": true}