# List Tickets

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

#### Request

```url
POST /tickets/list
```

#### Query Parameters.

This endpoint doesn't require query parameters.

#### Request Body

```json
{
    "categoryId": 33527,
    "customFields": [
        {
            "key": 18464,
            "value": "Option 2"
        }
    ],
    "from": "2020-01-01T00:00:00+00:00",
    "orderBy": "last_thread_activity_desc",
    "skip": 0,
    "source": "web",
    "status": "open",
    "take": 100,
    "to": "2020-03-02T00:00:00+00:00",
    "ticketIds": [
        4484636,
        4484618,
        4478963
    ]
}
```

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

| Field        | Type                                                                                                    | Required | Comments                                                                                                                                               |
| ------------ | ------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| categoryId   | nullabe integer                                                                                         | no       | Unique Id of category ticket should belong to. If value is `null` uncategorized tickets will be selected                                               |
| customFields | array of [Custom Field Id and Value](/docs/apis/tickets/reference/objects/custom-field-value.md) models | no       | List of models containing custom field ids and values. If array contains several custom fields, tickets must have all of them to be selected in result |
| from         | string                                                                                                  | no       | Min creation time of tickets shown in results. string containing DateTime with offset, in the following format: "2020-02-27T12:28:02.6019432+01:00"    |
| orderBy      | string                                                                                                  | no       | Order of tickets in the list. Can be one of [TicketListOrderBy](/docs/apis/tickets/reference/enumerations/ticket-list-order-by.md) enumeration values  |
| skip         | integer                                                                                                 | no       | Amount of tickets should be skipped from the result                                                                                                    |
| source       | string                                                                                                  | no       | Source of tickets. Can be one of [TicketSource](/docs/apis/tickets/reference/enumerations/ticket-source.md) enumeration values                         |
| status       | string                                                                                                  | no       | Ticket status. Can be one of [TicketStatus](/docs/apis/tickets/reference/enumerations/ticket-status.md) enumeration values                             |
| take         | int                                                                                                     | no       | Max ammount of tickets shown in results. Max value is 50. default: 25                                                                                  |
| ticketIds    | array of integers                                                                                       | no       | ids of tickets to select from results. It can be used to fetch tickets by id(s)                                                                        |
| to           | string                                                                                                  | no       | Max creation time of tickets shown in results. string containing DateTime with offset, in the following format: "2020-02-27T12:28:02.6019432+01:00"    |

```json
{
    "data": [
        {
            "id": 4484636,
            "title": "New car price list.",
            "message": "Hello I want to buy a new car, how can I get a price list?",
            "htmlMessage": "Hello I want to buy a new car, how can I get a price list?",
            "attachments": [],
            "author": {
                "id": "7c0a344a-c369-4e27-9840-88257a56e835",
                "name": "Bill Smith",
                "image": null,
                "email": "bill_smith@gmail.com",
                "status": "client",
                "isBot": false
            },
            "category": {
                "id": 15597,
                "name": "Customers"
            },
            "creationTime": "2019-12-18T18:00:03.6368531+00:00",
            "customFields": [],
            "lastThreadElementCreationTime": "2019-12-18T18:00:03.6368531+00:00",
            "lockedBy": null,
            "originalLink": null,
            "properties": {
                "isAnonymized": false,
                "isMuted": false,
                "hasAttachments": true,
                "hasDraft": false,
                "isAssignedToBot": false,
                "isDeleted": false,
                "isExpired": true,
                "isHidden": false,
                "isLocked": false,
                "isSpam": false,
                "isSensitive": false
            },
            "replyCount": 0,
            "sentiment": "question",
            "source": "web",
            "detailedSource": "web_website",
            "sourceName": null,
            "status": "open",
            "tags": [
                "urgent"
            ]
        },
        {
            "id": 4484618,
            "title": "New car price list.",
            "message": "Hello I want to buy a new car, how can I get a price list?",
            "htmlMessage": "Hello I want to buy a new car, how can I get a price list?",
            "attachments": [],
            "author": {
                "id": "7c0a344a-c369-4e27-9840-88257a56e835",
                "name": "Bill Smith",
                "image": null,
                "email": "bill_smith@gmail.com",
                "status": "client",
                "isBot": false
            },
            "category": {
                "id": 15597,
                "name": "Customers"
            },
            "creationTime": "2019-12-18T17:55:52.6381081+00:00",
            "customFields": [],
            "lastThreadElementCreationTime": "2019-12-18T17:55:52.6381081+00:00",
            "lockedBy": null,
            "originalLink": null,
            "properties": {
                "isAnonymized": false,
                "isMuted": false,
                "hasAttachments": true,
                "hasDraft": false,
                "isAssignedToBot": false,
                "isDeleted": false,
                "isExpired": true,
                "isHidden": false,
                "isLocked": false,
                "isSpam": false,
                "isSensitive": false
            },
            "replyCount": 0,
            "sentiment": "question",
            "source": "web",
            "detailedSource": "web_website",
            "sourceName": null,
            "status": "open",
            "tags": []
        },
        {
            "id": 4478963,
            "title": "Cat is ill",
            "message": "I want to take my cat to a vet",
            "htmlMessage": "I want to take my cat to a vet",
            "attachments": [],
            "author": {
                "id": "35692164-bfaa-4c49-a23c-ecfa618f7d20",
                "name": "Robert Baker",
                "image": null,
                "email": "robert78baker@gmail.com",
                "status": "client",
                "isBot": false
            },
            "category": {
                "id": 15721,
                "name": "Other cases"
            },
            "creationTime": "2019-12-17T07:03:48.318717+00:00",
            "customFields": [],
            "lastThreadElementCreationTime": "2019-12-17T07:21:21.5003556+00:00",
            "lockedBy": null,
            "originalLink": null,
            "properties": {
                "isAnonymized": false,
                "isMuted": false,
                "hasAttachments": false,
                "hasDraft": false,
                "isAssignedToBot": false,
                "isDeleted": false,
                "isExpired": true,
                "isHidden": false,
                "isLocked": false,
                "isSpam": false,
                "isSensitive": false
            },
            "replyCount": 3,
            "sentiment": "question",
            "source": "web",
            "detailedSource": "web_website",
            "sourceName": null,
            "status": "open",
            "tags": []
        }
    ],
    "errorCode": -1,
    "errorText": null
}
```

`Data` field will contain an array of [Ticket](/docs/apis/tickets/reference/objects/ticket.md) models.


---

# 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/list-tickets.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.
