# Message

## Create a message within the ticket

<mark style="color:green;">`POST`</mark> `https://account.omnidesk.com/api/v2/message`

This endpoint creates a message for the ticket. You will need a ticketID of the ticket to place the message in. If you do not have a ticketId you might want to create a ticket first. The response of the ticket creation will contain a ticket ID integer.

#### Request Body

| Name     | Type              | Description                                                                                                   |
| -------- | ----------------- | ------------------------------------------------------------------------------------------------------------- |
| ticketID | integer           |                                                                                                               |
| type     | string            | `1,3,5,7,8,9,10,12,13 or calllog or contactform`                                                              |
| message  | string            |                                                                                                               |
| userID   | integer, optional | `A valid userID from the administrator user list. If omitted, the note will be assigned to 'Agent Anonymous'` |

{% tabs %}
{% tab title="200 Message successfully created." %}

```javascript
{
    "type": "result",
    "message": "Message has been sent and the ticket status was updated."
}
```

{% endtab %}

{% tab title="400 " %}

```
```

{% endtab %}
{% endtabs %}


---

# 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/ticket/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.
