> 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/create-conversation.md).

# Create conversation

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

**Request**

```
POST chat/conversations
```

**Request body**

```json
{
    "author":{
        "name": "John",
        "customIdentifier": "CUS-12345"
    },
    "title": "Chat API Client Problems",
    "url": "https://thejohndow.com",
    "sentiment": "question",
    "categoryId": 1505
}
```

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

| Field        | Type                                                                                              | Comment                                                                                      |
| ------------ | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| author       | [User value](/docs/apis/external-chat-api/reference/objects/user-value.md) model                  | Conversation author                                                                          |
| categoryId   | nullable integer                                                                                  | Conversation category id. Optional                                                           |
| fields       | array of [Custom Fields value](/docs/apis/tickets/reference/objects/custom-field-value.md) models | Conversation fields. Optional                                                                |
| isBotEnabled | boolean                                                                                           | If `true`, a bot will be assigned to the conversation at the start. Default value is `false` |
| sentiment    | nullable [Sentiment](/docs/apis/tickets/reference/enumerations/sentiment.md) enumeration          | Conversation sentiment. Optional, if left unset, it will to the value `question`             |
| title        | string                                                                                            | Conversation title. Optional                                                                 |
| url          | string                                                                                            | The URL where the conversation took place. Optional                                          |

{% hint style="info" %}
The value of `customIdentifier` was normalized (trimmed and stored in lowercase).
{% endhint %}

**Response**

```json
{
    "data": {
        "author": {
            "customIdentifier": "cus-12345",
            "id": "fc2481f6-28a4-4ca7-849a-344fd6ab1b20",
            "name": "John",
            "image": null,
            "email": "john@dow.com",
            "status": "client",
            "isBot": false
        },
        "creationTime": "2023-09-01T12:56:39.0847826+03:00",
        "id": 254626,
        "isClosed": false,
        "isTakeoverEnabled": true,
        "lastModifiedTime": "2023-09-01T12:56:39.0847826+03:00",
        "messages": [
            {
                "author": {
                    "customIdentifier": "cus-12345",
                    "id": "fc2481f6-28a4-4ca7-849a-344fd6ab1b20",
                    "name": "John",
                    "image": null,
                    "email": "john@dow.com",
                    "status": "client",
                    "isBot": false
                },
                "creationTime": "2023-09-01T12:56:39.0847826+03:00",
                "id": 0,
                "lastModifiedTime": "2023-09-01T12:56:39.0847826+03:00",
                "message": "Hi, I have some questions about the Chat API"
            }
        ],
        "queuePositionInfo": 
        {
            "position": 1403,
            "waitTime": 15
        },
        "feedback": null,
        "totalMessagesCount": 1
    },
    "errorCode": -1,
    "errorText": null
}
```

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


---

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