# agent_state_blocked (/errors/agent_state_blocked)

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

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

The agent's current settings or state do not allow this step: for example the script is over its length limit, the voice is not available for the language, the language model has no usable key, the agent has no phone number, or it is archived. The message says which rule failed; fix it and 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": [
    {
      "type": "missing",
      "loc": [
        "body",
        "phone"
      ],
      "msg": "Field required"
    }
  ],
  "error": {
    "type": "invalid_request_error",
    "code": "agent_state_blocked",
    "message": "The agent cannot make this change yet.",
    "param": "phone",
    "docUrl": "https://docs.callmitra.ai/errors/agent_state_blocked",
    "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/calls/` — Place a call
- `POST /api/v1/agents/{agent_id}/publish` — Publish the agent's draft
- `PUT /api/v1/agents/{agent_id}/post-call-webhook` — Set an agent's post-call webhook
- `POST /api/v1/agents/{agent_id}/go-live` — Start taking calls
- `PATCH /api/v1/agents/{agent_id}` — Update an agent