# Create Ticket

{% hint style="warning" %}
All API requests should contain [authorization headers](/docs/apis/tickets/authorization-headers.md).
{% 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",
        "customIdentifier": null,
        "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](/docs/apis/tickets/reference/objects/base-attachment.md) 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="/pages/1BvoBefMt40oYLoG39uI">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](/docs/apis/tickets/reference/objects/ticket-creator.md) model                         | Model contains ticket creator data.                                                                                                                                                                          |
| customFields   | array of [Custom Field Id and Value](/docs/apis/tickets/reference/objects/base-custom-field.md) 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).


---

# 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://developers.socialboards.com/docs/apis/tickets/reference/endpoints/create-ticket.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.
