> For the complete documentation index, see [llms.txt](https://docs.cubu.com/guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cubu.com/guides/s2s-api-guide/agent-impersonation-api/change-status-to-unavailable.md).

# Change Status to Unavailable

This API changes the status of an Available agent to Unavailable or changes the unavailability reason for an already unavailable agent.

{% hint style="info" %}
This endpoint requires the **Agent Impersonator** rol&#x65;**.**
{% endhint %}

## URL

```
POST: https://[base-url]/{applicationId}/agents/{userId}/actions/becomeUnavailable
```

## Headers

```
Authorization: Bearer <accessToken>
```

## Request Body

* **unavailabilityReason**: One of the following values: Other | Break | Meeting | BackOfficeWork.
* **unavailabilityDescription** (text, max 200 chars): A free-text description of the unavailability reason. Required when `unavailabilityReason` is "Other".
* **backOfficeTaskId** (GUID): The ID of a back-office task.

  &#x20;Required when `unavailabilityReason` is "BackOfficeWork".&#x20;

## Response

#### Success -> 200

#### "Track Agent Status" is disabled for the organization --> 403

#### The agent status is not "Unavailable" --> 409, 3304

#### The agent status is not "Available" or "Unavailable" --> 409, 3303 "Invalid user status"
