Skip to Content
CallMitraDocs
API referenceCampaigns

Create an empty campaign

Add leads later with `PUT /campaigns/{campaign_id}/leads`. Without `phoneNumberId` the agent's assigned number is used.

POST
/api/v1/campaigns/

Add leads later with PUT /campaigns/{campaign_id}/leads. Without phoneNumberId the agent's assigned number is used.

Authorization

headerX-API-Key<token>

Create in the console: Settings → API & webhooks.

Header Parameters

Idempotency-Key?string

Any unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.

Lengthlength <= 255

Request Body

application/json
  1. body

Campaign fields to create or change. On update, send only the fields to change.

agentId?Agentid

The agent that makes the calls.

Formatuuid
crmWebhookSecret?Crmwebhooksecret

Secret used to sign those webhooks. Never returned.

crmWebhookUrl?Crmwebhookurl

Public HTTPS URL that receives this campaign's call results; empty clears it.

Formaturi
description?Description

Free-text description.

direction?Direction

outbound (call leads) or inbound (answer calls).

Default"outbound"
Value in"outbound""inbound"
endDate?Enddate

Planned end date, free text.

isActive?Isactive

Update only: true starts the campaign, false stops it (same checks as start and stop).

isDefaultInbound?Isdefaultinbound

Inbound only: take calls to the number that no other campaign matches.

name?Name

Campaign name. Defaults to Untitled.

phoneNumberId?Phonenumberid

Caller ID. Required for inbound campaigns. Defaults to the agent's assigned number.

Formatuuid
phoneNumberIds?array<>

Every number to call from, in order; the first is the primary caller ID.

settings?|

Dialing rules; merged into the current ones.

startDate?Startdate

Planned start date, free text (for example 2026-12-01).

status?Status

Display status to set, for example draft.

[key: string]?any

Response Body

OK

application/json
  1. response

The campaign after the request.

campaign?|

The campaign.

success?|

Always true.

[key: string]?any
Example Request
curl -X POST 'https://api.callmitra.ai/api/v1/campaigns/' \  -H 'Content-Type: application/json' \  -d '{  "agentId": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",  "name": "December renewals",  "settings": {    "maxCallsPerDay": 200,    "maxConcurrentCalls": 2  }}'
Example Response
{  "campaign": {    "agentId": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",    "autoDialEnabled": false,    "createdAt": "2026-11-15T10:00:00Z",    "direction": "outbound",    "id": "3f6c1b2a-7d4e-4a1b-9c2d-5e6f7a8b9c0d",    "isActive": false,    "name": "December renewals",    "phoneNumberId": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",    "settings": {      "dialWindowEnd": "18:00",      "dialWindowStart": "10:00",      "maxCallsPerDay": 200,      "maxConcurrentCalls": 2,      "pacingSeconds": 5    },    "stats": {      "calledLeads": 0,      "connectRate": 0,      "totalLeads": 0    },    "status": "draft"  },  "success": true}