<!-- Generated from the canonical 99 Digital API documentation. Do not edit this file. -->

Canonical page: https://docs.99digital.co.il/online-api/tickets/list-tickets

# List Tickets

`GET https://online.99digital.co.il/api/v1/accounts/{account_id}/conversations/{conversation_id}/tickets`

Returns all tickets of the conversation, oldest first.

## Tickets

A ticket is one "case" inside a conversation. The first ticket opens when the
conversation is created. It is **closed** when the conversation is resolved,
and a **new** ticket opens when the conversation is reopened. So one
long-lived conversation (for example a WhatsApp thread) can hold many
tickets. Messages and
[conversation events](https://docs.99digital.co.il/online-api/conversations/list-conversation-events)
carry the `ticket_id` they belong to. Closing a ticket fires the
`ticket_resolved` [webhook event](https://docs.99digital.co.il/online-api/webhooks/webhook-events).

Tickets are created and closed automatically; there is no endpoint to create
or delete one. Through the API you can read tickets and store **custom
attributes** on them (for example a case type or a refund amount).

All ticket endpoints are nested under a conversation (`{conversation_id}` is
the display ID — see
[Conversation Basics](https://docs.99digital.co.il/online-api/conversations/conversation-basics)).

**Endpoints in this section**

- `GET /api/v1/accounts/{account_id}/conversations/{conversation_id}/tickets`:
  [List Tickets](https://docs.99digital.co.il/online-api/tickets/list-tickets)
- `GET /api/v1/accounts/{account_id}/conversations/{conversation_id}/tickets/{ticket_id}`:
  [Get Ticket](https://docs.99digital.co.il/online-api/tickets/get-ticket)
- `GET /api/v1/accounts/{account_id}/conversations/{conversation_id}/tickets/current`:
  [Get Current Ticket](https://docs.99digital.co.il/online-api/tickets/get-current-ticket)
- `PATCH /api/v1/accounts/{account_id}/conversations/{conversation_id}/tickets/{ticket_id}`:
  [Set Ticket Custom Attributes](https://docs.99digital.co.il/online-api/tickets/set-ticket-custom-attributes)
- `PUT /api/v1/accounts/{account_id}/conversations/{conversation_id}/tickets/{ticket_id}/destroy_custom_attributes`:
  [Delete Ticket Custom Attributes](https://docs.99digital.co.il/online-api/tickets/delete-ticket-custom-attributes)

**Authorization (all ticket endpoints)**: user token; the caller must be able
to see the conversation (see
[Who can see a conversation](https://docs.99digital.co.il/online-api/conversations/conversation-basics#who-can-see-a-conversation)).

**Permissions:**

- User token: any agent who can see the conversation — see
  [Who can see a conversation](https://docs.99digital.co.il/online-api/conversations/conversation-basics#who-can-see-a-conversation).
- Agent-bot token: not allowed.

## The ticket object

| Field | Type | Description |
| --- | --- | --- |
| `id` | integer | Ticket ID. |
| `ticket_status` | string | `open` or `closed`. |
| `initiated_by` | string | Who started the conversation: `user` (the contact), `agent`, `agent_bot`. |
| `channel_name` | string | Inbox channel type, e.g. `Channel::Api`, `Channel::Whatsapp`. |
| `created_at` | string | When the ticket opened (ISO 8601). |
| `resolved_at` | string | When it was closed, or `null`. |
| `total_time` | integer | Seconds from opening to closing, or `null` while open. |
| `resolved_by_id`, `resolved_agent_id` | integer | Agent who resolved the conversation, or `null` (e.g. closed by a bot or automation). |
| `custom_attributes` | object | Your data for this ticket. |
| `account_id`, `contact_id`, `inbox_id` | integer | Related IDs. |
| `conversation_id` | integer | The conversation's **display ID** in *List Tickets* and *Get Ticket*. In *Get Current Ticket*, *Set Ticket Custom Attributes* and *Delete Ticket Custom Attributes* it is the **internal** conversation ID (see the note there). |
| `updated_at` | string | Last update (ISO 8601). |

## List tickets

| Setting | Value |
| --- | --- |
| **Method** | `GET` |
| **Path** | `/api/v1/accounts/{account_id}/conversations/{conversation_id}/tickets` |

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `account_id` | integer | Yes | Account ID. |
| `conversation_id` | integer | Yes | Conversation display ID. |

**Example request**

```bash
curl -X GET 'https://online.99digital.co.il/api/v1/accounts/12/conversations/1501/tickets' \
  -H 'api_access_token: <YOUR_API_ACCESS_TOKEN>'
```

**Example response** (`200 OK`). The conversation was resolved twice and
reopened, so it has two closed tickets and one open ticket.

```json
{
  "payload": [
    {
      "id": 901,
      "channel_name": "Channel::Api",
      "initiated_by": "user",
      "resolved_at": "2026-11-12T08:20:00.000Z",
      "ticket_status": "closed",
      "total_time": 600,
      "created_at": "2026-11-12T08:10:00.000Z",
      "updated_at": "2026-11-12T08:20:00.004Z",
      "account_id": 12,
      "contact_id": 801,
      "conversation_id": 1501,
      "inbox_id": 31,
      "resolved_agent_id": 51,
      "resolved_by_id": 51,
      "custom_attributes": {}
    },
    {
      "id": 902,
      "channel_name": "Channel::Api",
      "initiated_by": "user",
      "resolved_at": "2026-11-12T08:35:00.000Z",
      "ticket_status": "closed",
      "total_time": 300,
      "created_at": "2026-11-12T08:30:00.000Z",
      "updated_at": "2026-11-12T08:35:00.004Z",
      "account_id": 12,
      "contact_id": 801,
      "conversation_id": 1501,
      "inbox_id": 31,
      "resolved_agent_id": null,
      "resolved_by_id": null,
      "custom_attributes": {}
    },
    {
      "id": 903,
      "channel_name": "Channel::Api",
      "initiated_by": "user",
      "resolved_at": null,
      "ticket_status": "open",
      "total_time": null,
      "created_at": "2026-11-12T08:40:00.000Z",
      "updated_at": "2026-11-12T08:40:00.000Z",
      "account_id": 12,
      "contact_id": 801,
      "conversation_id": 1501,
      "inbox_id": 31,
      "resolved_agent_id": null,
      "resolved_by_id": null,
      "custom_attributes": {}
    }
  ]
}
```

To store your own data on a ticket, use
[Set Ticket Custom Attributes](https://docs.99digital.co.il/online-api/tickets/set-ticket-custom-attributes).

## Authentication

`api_access_token` in the header — Your access token. A user token is in the dashboard under **Profile settings → Access Token**, and grants exactly what that agent's role allows. An agent-bot token may call only the endpoints marked for agent bots. See [Getting Started](https://docs.99digital.co.il/online-api/getting-started#authentication).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `account_id` | path | integer | Yes | The numeric ID of your account: the number after `/app/accounts/` in the dashboard URL. Example: `12`. |
| `conversation_id` | path | integer | Yes | The numeric ID of the conversation: its display ID, which is the `id` in conversation responses and the number in the dashboard URL. Example: `1501`. |

## Responses

### 200 — The conversation's tickets, oldest first.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `payload` | array of object | The tickets. |
| `payload[].id` | integer | The numeric ID of the ticket. |
| `payload[].ticket_status` | string | Whether the ticket is open or closed. One of: `open` — The ticket is open — the conversation has not been resolved since the ticket opened; `closed` — The ticket was closed, because the conversation was resolved. |
| `payload[].initiated_by` | string | Who started the conversation. One of: `user` — The contact; `agent` — An agent; `agent_bot` — An agent bot. |
| `payload[].channel_name` | string | The channel type of the inbox, for example `Channel::Api` or `Channel::Whatsapp`. |
| `payload[].created_at` | string | When the ticket opened (ISO 8601). |
| `payload[].updated_at` | string | The last update (ISO 8601). |
| `payload[].resolved_at` | string \| null | When the ticket was closed (ISO 8601), or `null`. |
| `payload[].total_time` | integer \| null | Seconds from opening to closing, or `null` while open. |
| `payload[].resolved_by_id` | integer \| null | The ID of the agent who resolved the conversation, or `null` (for example when a bot or an automation closed it). |
| `payload[].resolved_agent_id` | integer \| null | The same as `resolved_by_id`. |
| `payload[].custom_attributes` | object | Your data for this ticket, as key-value pairs (for example a case type or a refund amount). |
| `payload[].account_id` | integer | The numeric ID of the account. |
| `payload[].contact_id` | integer | The numeric ID of the contact. |
| `payload[].inbox_id` | integer | The numeric ID of the inbox. |
| `payload[].conversation_id` | integer | The conversation. [List Tickets](https://docs.99digital.co.il/online-api/tickets/list-tickets) and [Get Ticket](https://docs.99digital.co.il/online-api/tickets/get-ticket) return its display ID; the other ticket endpoints return its internal ID. |

#### Example: Three tickets

The conversation was resolved and reopened twice, so it has two closed tickets and an open one.

```json
{
  "payload": [
    {
      "id": 901,
      "channel_name": "Channel::Api",
      "initiated_by": "user",
      "resolved_at": "2026-11-12T08:20:00.000Z",
      "ticket_status": "closed",
      "total_time": 600,
      "created_at": "2026-11-12T08:10:00.000Z",
      "updated_at": "2026-11-12T08:20:00.004Z",
      "account_id": 12,
      "contact_id": 801,
      "conversation_id": 1501,
      "inbox_id": 31,
      "resolved_agent_id": 51,
      "resolved_by_id": 51,
      "custom_attributes": {}
    },
    {
      "id": 902,
      "channel_name": "Channel::Api",
      "initiated_by": "user",
      "resolved_at": "2026-11-12T08:35:00.000Z",
      "ticket_status": "closed",
      "total_time": 300,
      "created_at": "2026-11-12T08:30:00.000Z",
      "updated_at": "2026-11-12T08:35:00.004Z",
      "account_id": 12,
      "contact_id": 801,
      "conversation_id": 1501,
      "inbox_id": 31,
      "resolved_agent_id": null,
      "resolved_by_id": null,
      "custom_attributes": {}
    },
    {
      "id": 903,
      "channel_name": "Channel::Api",
      "initiated_by": "user",
      "resolved_at": null,
      "ticket_status": "open",
      "total_time": null,
      "created_at": "2026-11-12T08:40:00.000Z",
      "updated_at": "2026-11-12T08:40:00.000Z",
      "account_id": 12,
      "contact_id": 801,
      "conversation_id": 1501,
      "inbox_id": 31,
      "resolved_agent_id": null,
      "resolved_by_id": null,
      "custom_attributes": {}
    }
  ]
}
```

### 401 — The access token is missing or wrong, or its user does not belong to this account.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | The error message. |

#### Example: Invalid token

The api_access_token header is missing or wrong.

```json
{
  "error": "Invalid Access Token"
}
```

#### Example: Another account

A valid token, for a user who is not in this account.

```json
{
  "error": "You are not authorized to access this account"
}
```

### 403 — The token's role does not have the permission this endpoint needs, or the endpoint is not open to agent-bot tokens. See [Authorization](https://docs.99digital.co.il/online-api/getting-started#authorization).

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | The error message. |

#### Example: No permission

The role lacks the permission.

```json
{
  "error": "You are not authorized to do this action"
}
```

#### Example: Agent bot

An agent-bot token on an endpoint that is not open to bots.

```json
{
  "error": "Access to this endpoint is not authorized for bots"
}
```

### 404 — The resource does not exist in this account.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | The error message. |

#### Example

```json
{
  "error": "Resource could not be found"
}
```
