# 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
    ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.acquire.io/rest-apis/conversation/conversation-or-cases/invite-agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
