# Invite Agent

## Invite an agent&#x20;

<mark style="color:green;">`POST`</mark> `https://{{account_id}}.acquire.io/api/v1/crm/messenger/agent/invite-agent`

Invite agents or departments to the chat. The **caseId** must be passed in the body of the request. The agent IDs or department IDs **(agentId | department)** must be passed to the body as a JSON array of integers. You can add as many agents as you'd like and invite a department. Agents or departments will receive an in-app notification and an email which they can use to access the conversion. \
\
**agentId** - An agent's ID. To find agent IDs, log in to Acquire and go to `Settings > Users and Roles` or send a GET request to Agent List.\
\
**department -** A department's ID. Send a GET request to Department List to find department IDs. <br>

#### Headers

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Bearer {{API\_KEY}} |

#### Request Body

| Name                                     | Type   | Description                                          |
| ---------------------------------------- | ------ | ---------------------------------------------------- |
| caseId<mark style="color:red;">\*</mark> | string | The case ID                                          |
| department                               | array  | Array of integers. Required if inviting departments. |
| agentIds                                 | array  | Array of integers. Required if inviting agents.      |

{% tabs %}
{% tab title="200 " %}

```
{
  "data": {
    "1": {
      "userId": 1,
      "online": true,
      "sent": true
    },
    "11": {
      "userId": 11,
      "online": false,
      "sent": false
    },
    "26": {
      "userId": 26,
      "online": false,
      "sent": false
    }
  
```

{% endtab %}
{% endtabs %}

**Body (raw)**

```
{
    "caseId": 22,
    "department": [
    2,
    3,
    4
  ],
    "agentIds": [
        1,
        11,
        26
    ]
}
```
