# Message

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

All of the endpoints require the `MESSAGE_CREATE` permission.

## index

> \*\*Creates a new message.\*\*\
> \
> The ticket must already exist. It will clear the ticket's cache before processing this data.

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Message","description":"**All the endpoints that can be called on the Message controller.**\n\nAll of the endpoints require the `MESSAGE_CREATE` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/message":{"post":{"tags":["Message"],"summary":"index","description":"**Creates a new message.**\n\nThe ticket must already exist. It will clear the ticket's cache before processing this data.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"ticketID":{"type":"string","description":"type: `number`\n\nIf you want to send a message in an already existing ticket."},"type":{"type":"string","description":"type: `^([0-9]+|calllog|contactform)$`"},"toAddress":{"type":"string","description":"type: `string` = ' '\n\nNullable for contactforms and notes."},"ccInput":{"type":"string","description":"type: `string` = ' '\n\nMust be a valid email address format."},"bccInput":{"type":"string","description":"type: `string` = ' '\n\nMust be a valid email address format."},"respondMessageID":{"type":"string","description":"type: `number` = 0\n\nAdd this parameter if it is a reply to an existing message."},"plaintext":{"type":"string","description":"type: `string` = ' '\n\nIf this one is empty, it will use the value of the message parameter instead. Only relevant for emails."},"message":{"type":"string","description":"type: `string`\n\nThe actual message."},"forwardedFileIDs[]":{"type":"string","description":"type: `number` = null\n\nIf you want to forward existing files."},"sendAt":{"type":"string","description":"type: `string 'Y-m-d H:i'` = current time\n\nA special parameter as it is a string that would be following the date format specified."},"userID":{"type":"string","description":"type: `number` = 0\n\nThe ID of the user who created this message."},"submitStatus":{"type":"string","description":"type: `^open|pending|holding|solved|closed$` = null"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{}}}}}}}}
```

## chatbot

> \*\*Creates a ticket and its accompanying message coming from a chatbot.\*\*

```json
{"openapi":"3.0.0","info":{"title":"Omnidesk API documentation","version":"1.0.0"},"tags":[{"name":"Message","description":"**All the endpoints that can be called on the Message controller.**\n\nAll of the endpoints require the `MESSAGE_CREATE` permission."}],"servers":[{"url":"http://{{base_url}}"}],"security":[{"apikeyAuth":[]}],"components":{"securitySchemes":{"apikeyAuth":{"type":"http","scheme":"apikey"}}},"paths":{"/api/v2/message/chatbot":{"post":{"tags":["Message"],"summary":"chatbot","description":"**Creates a ticket and its accompanying message coming from a chatbot.**","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"brandID":{"type":"string","description":"type: `number`"},"message":{"type":"string","description":"type: `string`"},"subject":{"type":"string","description":"type: `string`"},"from":{"type":"string","description":"type: `string`"}}}}}},"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/message.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.
