# Create Ticket

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

#### Request

```
POST /tickets
```

#### Query Parameters.

This endpoint doesn't require query parameters.

#### Request Body

```json
{
    "assigneeId": "43b8adc7-755d-2be3-afb1-b6a462631977",
    "attachments": [
        {
            "url": "https://your.attachment.url/filename.png",
            "name": "filename.png"
        }
    ],
    "categoryId": 15597,
    "cc": [
        "ann_smith@gmail.com"
    ],
    "creator": {
        "name": "Bill Smith",
        "email": "bill_smith@gmail.com",
        "image": null,
        "phoneNumber": null
    },
    "customFields": [
        {
            "id": 42623,
            "value": "Oslo"
        }
    ],
    "message": "Hello I want to buy a new car, how can I get a price list?",
    "sentiment": "question",
    "tags": [],
    "title": "New car price list."
}
```

Body of request should contain the following model serialized to JSON.

| Field          | Type                                                                                                                                   | Comments                                                                                                                                                                                         |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| attachments    | array of [Base Attachment](https://developers.socialboards.com/docs/apis/tickets/reference/objects/base-attachment) models             | Ticket Attachments                                                                                                                                                                               |
| assigneeId     | string                                                                                                                                 | <p>Unique teammate ticket assignee Id. Set to null if the ticket does not have any assignee.<br>You can obtain a list of teammates through the <a href="../../teammates">Teammates route</a></p> |
| categoryId     | nullabe integer                                                                                                                        | Unique Id of category ticket should belong to. If value is `null` ticket will be created uncategorized                                                                                           |
| cc             | array of strings                                                                                                                       | CC emails of ticket. Team member replies will be sent not only to ticket author but also to these emails                                                                                         |
| creator        | [Ticket Creator](https://developers.socialboards.com/docs/apis/tickets/reference/objects/ticket-creator) model                         | Model contains ticket creator data.                                                                                                                                                              |
| customFields   | array of [Custom Field Id and Value](https://developers.socialboards.com/docs/apis/tickets/reference/objects/base-custom-field) models | List of models containing custom field ids and values                                                                                                                                            |
| isHtml         | boolean                                                                                                                                | <p>If <code>true</code> indicates that message content should be processed as HTML with tags, classes and attributes.</p><p>By default is <code>true</code></p>                                  |
| message        | string                                                                                                                                 | Ticket message                                                                                                                                                                                   |
| sentiment\[^1] | string                                                                                                                                 | Sentiment of ticket. Can be `question`, `praise`, `suggestion`, `complaint`                                                                                                                      |
| sourceName     | string                                                                                                                                 | Name of ticket source. Can have any string as value (for example page or channel name)                                                                                                           |
| tags           | array of string                                                                                                                        | Ticket tags' names                                                                                                                                                                               |
| title          | string                                                                                                                                 | Title of the ticket                                                                                                                                                                              |

#### Response

```json
{
  "data": 4484636,
  "errorCode": -1,
  "errorText": null
}
```

`Data` field will contain ticket Id (type integer).
