> For the complete documentation index, see [llms.txt](https://developers.socialboards.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.socialboards.com/docs/apis/external-chat-api/reference/endpoints/add-messages-to-conversation.md).

# Add messages to conversation

{% hint style="warning" %}
All API requests should contain [authorization headers](/docs/apis/tickets/authorization-headers.md).
{% endhint %}

**Request**

```
POST chat/conversations/{id}/messages
```

**Request body**

```json
[
    {
        "message": "Example of chat message",
        "author": {
            "name": "John",
            "email": "john@dow.com"
        }
    },
    {
        "message": "Example of previous chat message",
        "author": {
            "name": "John",
            "email": "john@dow.com"
        },
        "creationTime": "2023-10-19T10:00:58.84+00:00"
    }
]
```

The body of the request should contain the following model serialized to JSON.

The maximum future time set in the `creationTime` property cannot exceed 30 seconds from the moment the server receives the message. For example, if the time specified in property `creationTime` for a created message is `15:00:35`, and the server receives it at `15:00:00`, an error will be generated.

| Field        | Type                                                                             | Comment                                                                                                                                                                                                                                                                 |
| ------------ | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| author       | [User value](/docs/apis/external-chat-api/reference/objects/user-value.md) model | Message author                                                                                                                                                                                                                                                          |
| creationTime | nullable string                                                                  | Message creation time. Optional, if `null` current time will be set                                                                                                                                                                                                     |
| isByTeam     | nullable boolean                                                                 | <p>Indicate if the message author is a team member<br>If it's <code>null</code>, the system uses a default value.<br>If it's <code>false</code>, the message is flagged as from a client<br>If it's <code>true</code>, the message is flagged as from a team member</p> |
| message      | string                                                                           | Message content                                                                                                                                                                                                                                                         |

**Response**

```json
{
    "data": [
        {
            "author": {
                "customIdentifier": null,
                "email": "john@dow.com",
                "id": "fc2481f6-28a4-4ca7-849a-344fd6ab1b20",
                "image": null,
                "isBot": false,
                "name": "John",
                "status": "client"
            },
            "creationTime": "2023-08-22T14:50:07.21+00:00",
            "id": 667155,
            "lastModifiedTime": "2023-09-01T15:03:59.81+00:00",
            "message": "Example of chat message"
        }
    ],
    "errorCode": -1,
    "errorText": null
}
```

`Data` field has type of array of [Conversation message](/docs/apis/external-chat-api/reference/objects/conversation-message.md) objects.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developers.socialboards.com/docs/apis/external-chat-api/reference/endpoints/add-messages-to-conversation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
