# List Tickets

> Source: https://truto.one/docs/api-reference/unified-ticketing-api/tickets/list/

`GET /unified/ticketing/tickets`

Resource: **Tickets** · API: **Unified Ticketing API**

## Supported integrations

Accelo, Airtable, Asana, Azure DevOps, Basecamp, Bitbucket, BMC Helix, ClickUp (partial), Dixa (partial), eDesk, Enchant, Freshdesk (partial), Front, FuseDesk, GitLab, Gorgias, Help Scout, Helpshift, Hive, HubSpot, Intercom, Jira, Jira Service Management, Kustomer, Linear, LiveAgent, LiveChat, Microsoft 365, Microsoft Planner, Missive, Monday.com, Pivotal Tracker, Planhat, Podium (partial), Productboard, Puzzel Case Management, Qualtrics CoreXM (partial), Quickbase for Project Management, Re:amaze, Richpanel, Salesforce, ServiceNow (partial), servicenowitsm, Shortcut, SolarWinds Service Desk, SurveySparrow Ticket Management, Teamwork Project Management, Todoist, Trello, Trengo, Wrike, YouTrack, Zendesk, Zoho Desk, Zoho Projects

## Query parameters

- **`integrated_account_id`** _(string, required)_
  The ID of the integrated account to use for the request.
- **`truto_response_format`** _(string)_
  The format of the response. - `unified` returns the response with unified mappings applied. - `raw` returns the unprocessed, raw response from the remote API. - `normalized` applies the unified mappings and returns the data in a normalized format. - `stream` returns the response as a stream, which is ideal for transmitting large datasets, files, or binary data. Using streaming mode helps to efficiently handle large payloads or real-time data flows without requiring the entire data to be buffered in memory. Defaults to `unified`.
  Allowed: `unified`, `raw`, `normalized`, `stream`
- **`truto_key_by`** _(string)_
  By default the `result` attribute is an array of objects. This parameter allows you to specify a field in each `result` objects to use as key, which transforms the `result` array into an object with the array items keyed by the field. This is useful for when you want to use the result as a lookup table.
- **`truto_ignore_limit`** _(boolean)_
  Ignores the `limit` query parameter.
- **`truto_ignore_remote_data`** _(boolean)_
  Excludes the `remote_data` attribute from the response.
- **`truto_exclude_fields`** _(array<string>)_
  Array of fields to exclude from the response.
- **`remote_query`** _(object)_
  Query parameters to pass to the underlying API without any transformations. Refer [this guide](https://truto.one/docs/api-reference/overview/querying#remote-query-parameters) to see how to structure the query parameters.
- **`status`** _(object)_
  The status of the ticket
  Allowed: `active`, `archived`, `closed`, `completed`, `deleted`, `open`, `pending`, `spam`, `trash`
- **`ticket_type`** _(object)_
  Type of the ticket
  Allowed: `conversation`, `issue`, `task`
- **`priority`** _(object)_
  Priority of the ticket
  Allowed: `high`, `low`, `medium`
- **`assignees`** _(array<object>)_
  Users assigned to the ticket
- **`workspace`** _(object)_
  Workspace associated with the ticket
- **`name`** _(string)_
  The name of the ticket
- **`created_at`** _(string)_
  Time at which the ticket was created
- **`updated_at`** _(string)_
  Time at which the ticket was last updated
- **`completed_at`** _(string)_
  Time at which the ticket was completed
- **`due_date`** _(string)_
  Due date of the ticket
- **`search_term`** _(string)_
  The search term.
- **`workspace_id`** _(string)_
  The unique identifier for the workspace
- **`collections`** _(array<object>)_
  Collections associated with the ticket
- **`assignee`** _(object)_
- **`tags`** _(array<object>)_
  Tags associated with the ticket
- **`teams`** _(object)_
  Team associated with the ticket.
- **`custom_fields`** _(object)_
  Custom fields associated with the ticket. If provided, workspace should also be provided.
- **`parent_ticket`** _(object)_
  Parent ticket associated for the ticket.
- **`contact`** _(object)_
  Contact associated with the ticket
- **`sort_by`** _(object)_
  Allowed: `completed_at`, `created_at`, `due_date`, `id`, `name`, `status`, `updated_at`
- **`created_by`** _(object)_
  User or contact who created the ticket
- **`number`** _(string)_
  An optional ticket number maintained by the system.
- **`description`** _(string)_
  Description of the ticket
- **`fields`** _(unknown)_
- **`team`** _(object)_
  Team associated with the ticket
- **`created_by_id`** _(string)_
  The unique identifier for the user who created the ticket
- **`account`** _(object)_
  Account associated with the ticket
- **`collection`** _(unknown)_
- **`assignee_name`** _(string)_
  The name of the user assigned to the ticket
- **`attachments`** _(array<object>)_
  Attachments associated with the ticket
- **`assignee_id`** _(string)_
  The unique identifier for the users assigned to the ticket
- **`include`** _(array<string>)_
  The side-loaded resources to include in the response. Only value supported is `users`
- **`organization`** _(object)_

## Response body

- **`result`** _(array<object>)_
  List of Tickets
  - **`id`** _(string, required)_
    The unique identifier for a ticket
  - **`name`** _(string)_
    The name of the ticket
  - **`number`** _(string)_
    An optional ticket number maintained by the system.
  - **`assignees`** _(array<object>)_
    Users assigned to the ticket
    - **`id`** _(string)_
      The unique identifier for a user
    - **`name`** _(string)_
      The name of the user
    - **`first_name`** _(string)_
      The first name of the user
    - **`last_name`** _(string)_
      The last name of the user
    - **`emails`** _(array<object>)_
      The user's email addresses
      - **`email`** _(string, required)_
        The user's email address
      - **`type`** _(string)_
        The type of email address
    - **`phones`** _(array<object>)_
      The user's phone number
      - **`number`** _(string, required)_
        The user's phone number
      - **`type`** _(string)_
        The type of phone number
  - **`status`** _(object)_
    The status of the ticket
    - **`id`** _(string)_
      The unique identifier for a status
    - **`name`** _(string)_
      The name of the status
      Allowed: `active`, `closed`, `open`, `pending`, `spam`, `resolved`, `archived`, `deleted`, `completed`
  - **`created_by`** _(object)_
    User or contact who created the ticket
    - **`id`** _(string)_
      The unique identifier for a user
    - **`name`** _(string)_
      The name of the user
    - **`type`** _(string)_
      The type of the user
      Allowed: `user`, `contact`
  - **`due_date`** _(string)_
    Due date of the ticket
  - **`description`** _(string)_
    Description of the ticket
  - **`workspace`** _(object)_
    Workspace associated with the ticket
    - **`id`** _(string)_
      The unique identifier for a workspace
    - **`name`** _(string)_
      The name of the workspace
  - **`team`** _(object)_
    Team associated with the ticket
    - **`id`** _(string)_
      The unique identifier for a team
    - **`name`** _(string)_
      The name of the team
  - **`collections`** _(array<object>)_
    Collections associated with the ticket
    - **`id`** _(string)_
      The unique identifier for a collection
    - **`name`** _(string)_
      The name of the collection
    - **`type`** _(string)_
      The type of the collection
  - **`conversations`** _(array<object>)_
    Conversations associated with the ticket
    - **`id`** _(string)_
      The unique identifier for a conversation
    - **`name`** _(string)_
      The name of the conversation
    - **`type`** _(string)_
      The type of the conversation
  - **`ticket_type`** _(object)_
    Type of the ticket
    - **`id`** _(string)_
      The unique identifier for a ticket type
    - **`name`** _(string)_
      The name of the ticket type
  - **`contact`** _(object)_
    Contact associated with the ticket
    - **`id`** _(string)_
      The unique identifier for a contact
    - **`first_name`** _(string)_
      The first name of the contact
    - **`last_name`** _(string)_
      The last name of the contact
    - **`name`** _(string)_
      The name of the contact
    - **`emails`** _(array<object>)_
      The emails of the contact
      - **`email`** _(string, required)_
        The email of the contact
      - **`type`** _(string)_
        The type of the email
    - **`phones`** _(array<object>)_
      The contact's phone number
      - **`number`** _(string, required)_
        The contact's phone number
      - **`type`** _(string)_
        The type of phone number
  - **`additional_contacts`** _(array<object>)_
    Additional Contacts associated with the ticket
    - **`id`** _(string)_
      The unique identifier for a contact
    - **`first_name`** _(string)_
      The first name of the contact
    - **`last_name`** _(string)_
      The last name of the contact
    - **`name`** _(string)_
      The name of the contact
    - **`emails`** _(array<object>)_
      The emails of the contact
      - **`email`** _(string, required)_
        The email of the contact
      - **`type`** _(string)_
        The type of the email
    - **`phones`** _(array<object>)_
      The contact's phone number
      - **`number`** _(string, required)_
        The contact's phone number
      - **`type`** _(string)_
        The type of phone number
  - **`account`** _(object)_
    Account associated with the ticket
    - **`id`** _(string)_
      The unique identifier for a contact
  - **`parent_ticket`** _(object)_
    Parent ticket associated with the ticket
    - **`id`** _(string)_
      The unique identifier for a ticket
    - **`name`** _(string)_
      The name of the ticket
  - **`attachments`** _(array<object>)_
    Attachments associated with the ticket
    - **`id`** _(string)_
      The unique identifier for an attachment
    - **`file_name`** _(string)_
      The name of the attachment
    - **`file_url`** _(string)_
      The url of the attachment
  - **`tags`** _(array<object>)_
    Tags associated with the ticket
    - **`id`** _(string)_
      The unique identifier for a tag
    - **`name`** _(string)_
      The name of the tag
  - **`created_at`** _(string)_
    Time at which the ticket was created
  - **`updated_at`** _(string)_
    Time at which the ticket was last updated
  - **`completed_at`** _(string)_
    Time at which the ticket was completed
  - **`ticket_url`** _(string)_
    URL of the ticket
  - **`priority`** _(object)_
    Priority of the ticket
    - **`id`** _(string)_
      The unique identifier for a priority
    - **`name`** _(string)_
      The name of the priority
  - **`languages`** _(array<string>)_
    Languages of the ticket
  - **`is_unread`** _(boolean)_
    Whether the ticket is unread
  - **`source`** _(object)_
    The source of the ticket
    - **`id`** _(string)_
      The unique identifier for a source
    - **`name`** _(string)_
      The name of the source
  - **`custom_fields`** _(object)_
    All the custom fields present on the ticket
  - **`etag`** _(string)_
    The unique identifier for the specific version of the resource.
  - **`remote_data`** _(object)_
    Raw data returned from the remote API call.
- **`next_cursor`** _(string)_
  The cursor to use for the next page of results. Pass this value as `next_cursor` in the query parameter in the next request to get the next page of results.

## Code examples

### curl

```bash
curl -X GET 'https://api.truto.one/unified/ticketing/tickets?integrated_account_id=<integrated_account_id>' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const integratedAccountId = '<integrated_account_id>';

const response = await fetch(`https://api.truto.one/unified/ticketing/tickets?integrated_account_id=${integratedAccountId}`, {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/unified/ticketing/tickets"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
    "integrated_account_id": "<integrated_account_id>"
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
```

### Truto TS SDK

```typescript
import Truto from '@truto/truto-ts-sdk';

const truto = new Truto({
  token: '<your_api_token>',
});

const result = await truto.unifiedApi.list(
  'ticketing',
  'tickets',
  { integrated_account_id: '<integrated_account_id>' }
);

console.log(result);
```

### Truto Python SDK

```python
import asyncio
from truto_python_sdk import TrutoApi

truto_api = TrutoApi(token="<your_api_token>")

async def main():
    async for item in truto_api.unified_api.list(
        "ticketing",
        "tickets",
        {"integrated_account_id": "<integrated_account_id>"}
    ):
        print(item)

asyncio.run(main())
```
