# Chat

**All the endpoints that can be called on the Chat controller.**

All endpoints require the `API_CHAT` permission.

## requestChatConfig

> \*\*Requests chat configuration by this chat's details.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Chat","description":"**All the endpoints that can be called on the Chat controller.**\n\nAll endpoints require the `API_CHAT` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/chat/requestChatConfig":{"post":{"tags":["Chat"],"summary":"requestChatConfig","description":"**Requests chat configuration by this chat's details.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"chatServer":{"type":"string","description":"type: `^[a-zA-Z0-9\\.\\:\\/\\-]+$`"},"chatAccountToken":{"type":"string","description":"type: `^[a-zA-Z0-9]+$`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## notifyUserNewChatMessage

> \*\*Notifies the user of a new chat message.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Chat","description":"**All the endpoints that can be called on the Chat controller.**\n\nAll endpoints require the `API_CHAT` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/chat/notifyUserNewChatMessage":{"post":{"tags":["Chat"],"summary":"notifyUserNewChatMessage","description":"**Notifies the user of a new chat message.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"chatServer":{"type":"string","description":"type: `^[a-zA-Z0-9\\.\\:\\/\\-]+$`"},"chatSessionID":{"type":"string","description":"type: `^\\+?[a-zA-Z0-9\\-]+$`"},"chatAccountToken":{"type":"string","description":"type: `^[a-zA-Z0-9]+$`"},"channelID":{"type":"string","description":"type: `number` = 8"},"message":{"type":"string","description":"type: `string`"},"url":{"type":"string","description":"type: `string` = ' '"},"messageNumber":{"type":"string","description":"type: `number` = 1"},"usedPredefinedUserInput":{"type":"string","description":"type: `string` = false"},"additionalData":{"type":"string","description":"type: `string` = ' '"},"externalAddressOverwrite":{"type":"string","description":"type: `string` = ' '"},"customerName":{"type":"string","description":"type: `^[a-zA-Z 0-9]+$` = null"},"emailAddress":{"type":"string","description":"type: `email`"},"phoneNumber":{"type":"string","description":"type: `^\\+[0-9]+$` = null"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## notifyUserNewChatEvent

> \*\*Notifies the user of a new chat event.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Chat","description":"**All the endpoints that can be called on the Chat controller.**\n\nAll endpoints require the `API_CHAT` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/chat/notifyUserNewChatEvent":{"post":{"tags":["Chat"],"summary":"notifyUserNewChatEvent","description":"**Notifies the user of a new chat event.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"chatServer":{"type":"string","description":"type: `^[a-zA-Z0-9\\.\\:\\/\\-]+$`"},"chatSessionID":{"type":"string","description":"type: `^[a-zA-Z0-9\\-]+$`"},"event":{"type":"string","description":"type: `^startedtyping|stoppedtyping|expandedchat|minimizedchat$`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## notifyUserVisited

> \*\*Notifies the user of a new chat URL visited.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Chat","description":"**All the endpoints that can be called on the Chat controller.**\n\nAll endpoints require the `API_CHAT` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/chat/notifyUserVisited":{"post":{"tags":["Chat"],"summary":"notifyUserVisited","description":"**Notifies the user of a new chat URL visited.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"chatServer":{"type":"string","description":"type: `^[a-zA-Z0-9\\.\\:\\/\\-]+$`"},"chatSessionID":{"type":"string","description":"type: `^[a-zA-Z0-9\\-]+$`"},"url":{"type":"string","description":"type: `string`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## notifyUserEndChat

> \*\*Notifies the user that the chat has ended.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Chat","description":"**All the endpoints that can be called on the Chat controller.**\n\nAll endpoints require the `API_CHAT` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/chat/notifyUserEndChat":{"post":{"tags":["Chat"],"summary":"notifyUserEndChat","description":"**Notifies the user that the chat has ended.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"chatServer":{"type":"string","description":"type: `^[a-zA-Z0-9\\.\\:\\/\\-]+$`"},"chatSessionID":{"type":"string","description":"type: `^[a-zA-Z0-9\\-]+$`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## addAttachment

> \*\*Adds an attachment to the chat.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Chat","description":"**All the endpoints that can be called on the Chat controller.**\n\nAll endpoints require the `API_CHAT` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/chat/addAttachment":{"post":{"tags":["Chat"],"summary":"addAttachment","description":"**Adds an attachment to the chat.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"type: `binary`","format":"binary"}}}}}},"parameters":[{"name":"chatServer","in":"query","schema":{"type":"string"}},{"name":"chatSessionID","in":"query","schema":{"type":"string"}},{"name":"chatAccountToken","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## checkOriginAndIP

> \*\*Checks the origin and IP address of this user.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Chat","description":"**All the endpoints that can be called on the Chat controller.**\n\nAll endpoints require the `API_CHAT` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/chat/checkOriginAndIP":{"post":{"tags":["Chat"],"summary":"checkOriginAndIP","description":"**Checks the origin and IP address of this user.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"chatServer":{"type":"string","description":"type: `^[a-zA-Z0-9\\.\\:\\/\\-]+$`"},"chatAccountToken":{"type":"string","description":"type: `^[a-zA-Z0-9]+$`"},"origin":{"type":"string","description":"type: `^[a-zA-Z0-9\\.\\-]+$`\n\nThe hostname from the domain to be checked."},"ip":{"type":"string","description":"type: `string`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## whitelistedDomainsAndBlacklistedIPs

> \*\*Returns all the whitelisted domains and blacklisted IP addresses.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Chat","description":"**All the endpoints that can be called on the Chat controller.**\n\nAll endpoints require the `API_CHAT` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/chat/whitelistedDomainsAndBlacklistedIPs":{"get":{"tags":["Chat"],"summary":"whitelistedDomainsAndBlacklistedIPs","description":"**Returns all the whitelisted domains and blacklisted IP addresses.**","responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## requestChatQueue

> \*\*Returns the chat queue.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Chat","description":"**All the endpoints that can be called on the Chat controller.**\n\nAll endpoints require the `API_CHAT` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/chat/requestChatQueue":{"post":{"tags":["Chat"],"summary":"requestChatQueue","description":"**Returns the chat queue.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"chatAccountToken":{"type":"string","description":"type: `^[a-zA-Z0-9]+$`"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```


---

# 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://docs.omnidesk.io/omnidesk/api-specification/chat.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.
