Errors
campaign_not_ready
The campaign is not ready to start.
| HTTP status | Type | Code |
|---|---|---|
| 422 | invalid_request_error | campaign_not_ready |
What it means
The message lists what to fix first: the campaign has no agent, the agent's prompt uses placeholders the leads cannot fill, an IVR survey is missing its clips, or an inbound campaign has no callers or lead sources assigned. Fix it with PUT /campaigns/{campaignId} (or on the agent), then start again.
How to handle it
Fix the request before sending it again; retrying the same request returns the same error. error.param names the offending field when there is one.
Example response
{
"detail": [
{
"type": "missing",
"loc": [
"body",
"phone"
],
"msg": "Field required"
}
],
"error": {
"type": "invalid_request_error",
"code": "campaign_not_ready",
"message": "The campaign is not ready to start.",
"param": "phone",
"docUrl": "https://docs.callmitra.ai/errors/campaign_not_ready",
"requestId": "req_3f9c2a7d1b8e4c6a9f0e2d4b6a8c0e1f"
}
}Branch on error.code; it never changes once published. The message text can change. See Errors for the envelope.
Returned by
POST /api/v1/campaigns/create-with-leads— Create a campaign with its leadsPOST /api/v1/campaigns/{campaign_id}/start— Start a campaignPUT /api/v1/campaigns/{campaign_id}— Update a campaign