# Create conversation

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

**Request**

```
POST chat/conversations
```

**Request body**

```json
{
    "author":{
        "name": "John",
        "email": "john@dow.com"
    },
    "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](https://developers.socialboards.com/docs/apis/external-chat-api/reference/objects/user-value) model                  | Conversation author                                                                          |
| categoryId   | nullable integer                                                                                                                  | Conversation category id. Optional                                                           |
| fields       | array of [Custom Fields value](https://developers.socialboards.com/docs/apis/tickets/reference/objects/custom-field-value) 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](https://developers.socialboards.com/docs/apis/tickets/reference/enumerations/sentiment) 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                                          |

**Response**

```json
{
    "data": {
        "author": {
            "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": {
                    "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](https://developers.socialboards.com/docs/apis/external-chat-api/reference/objects/conversation) object.
