# campaign_not_ready (/errors/campaign_not_ready)

| HTTP status | Type | Code |
| --- | --- | --- |
| 422 | `invalid_request_error` | `campaign_not_ready` |

## What it means [#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 [#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 [#example-response]

```json
{
  "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](/errors) for the envelope.

## Returned by [#returned-by]

- `POST /api/v1/campaigns/create-with-leads` — Create a campaign with its leads
- `POST /api/v1/campaigns/{campaign_id}/start` — Start a campaign
- `PUT /api/v1/campaigns/{campaign_id}` — Update a campaign