# campaign_has_no_agent (/errors/campaign_has_no_agent)

| HTTP status | Type | Code |
| --- | --- | --- |
| 400 | `invalid_request_error` | `campaign_has_no_agent` |

## What it means [#what-it-means]

Calls need an agent to speak. Set `agentId` on the campaign with `PUT /campaigns/{campaignId}`, then retry.

## 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": "Campaign has no agent assigned.",
  "error": {
    "type": "invalid_request_error",
    "code": "campaign_has_no_agent",
    "message": "Campaign has no agent assigned.",
    "param": null,
    "docUrl": "https://docs.callmitra.ai/errors/campaign_has_no_agent",
    "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/leads/{lead_id}/call-now` — Call a lead now
- `POST /api/v1/instant/call-now` — Call a lead in a campaign now
- `POST /api/v1/calls/` — Place a call