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

Canonical page: https://docs.99digital.co.il/online-api/tickets/get-current-ticket

# Get Current Ticket

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

Returns the conversation's open ticket.

If none exists yet, one is created. This works only while the conversation
status is `open` (Bot). See [List Tickets](https://docs.99digital.co.il/online-api/tickets/list-tickets)
for what a ticket is.

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

**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.

**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/current' \
  -H 'api_access_token: <YOUR_API_ACCESS_TOKEN>'
```

**Example response** (`200 OK`). Here `conversation_id` is the **internal**
conversation ID (`2301`), not the display ID (`1501`).

```json
{
  "id": 903,
  "account_id": 12,
  "inbox_id": 31,
  "channel_name": "Channel::Api",
  "conversation_id": 2301,
  "contact_id": 801,
  "initiated_by": "user",
  "resolved_by_id": null,
  "total_time": null,
  "resolved_at": null,
  "resolved_agent_id": null,
  "ticket_status": "open",
  "created_at": "2026-11-12T08:40:00.000Z",
  "updated_at": "2026-11-12T08:40:00.000Z",
  "custom_attributes": {}
}
```

:::warning

**When the conversation is not `open`** (for example `pending` / Manual, or
`resolved`) the response is still HTTP **`200`**, with an error body:

```json
{
  "error": "No open conversation",
  "status": "unprocessable_entity"
}
```

Check for the `error` key instead of relying on the HTTP status. To find the
open ticket of a Manual conversation, use
[List Tickets](https://docs.99digital.co.il/online-api/tickets/list-tickets) and pick the one with
`ticket_status: "open"`.

:::

## 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 open ticket — or, when the conversation is not `open`, an error body.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `id` | integer | (one of: Ticket) The numeric ID of the ticket. |
| `ticket_status` | string | (one of: Ticket) 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. |
| `initiated_by` | string | (one of: Ticket) Who started the conversation. One of: `user` — The contact; `agent` — An agent; `agent_bot` — An agent bot. |
| `channel_name` | string | (one of: Ticket) The channel type of the inbox, for example `Channel::Api` or `Channel::Whatsapp`. |
| `created_at` | string | (one of: Ticket) When the ticket opened (ISO 8601). |
| `updated_at` | string | (one of: Ticket) The last update (ISO 8601). |
| `resolved_at` | string \| null | (one of: Ticket) When the ticket was closed (ISO 8601), or `null`. |
| `total_time` | integer \| null | (one of: Ticket) Seconds from opening to closing, or `null` while open. |
| `resolved_by_id` | integer \| null | (one of: Ticket) The ID of the agent who resolved the conversation, or `null` (for example when a bot or an automation closed it). |
| `resolved_agent_id` | integer \| null | (one of: Ticket) The same as `resolved_by_id`. |
| `custom_attributes` | object | (one of: Ticket) Your data for this ticket, as key-value pairs (for example a case type or a refund amount). |
| `account_id` | integer | (one of: Ticket) The numeric ID of the account. |
| `contact_id` | integer | (one of: Ticket) The numeric ID of the contact. |
| `inbox_id` | integer | (one of: Ticket) The numeric ID of the inbox. |
| `conversation_id` | integer | (one of: Ticket) 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. |
| `error` | string | (one of: Conversation not open) Why there is no ticket: `No open conversation` — the conversation's status is not `open` (Bot). |
| `status` | string | (one of: Conversation not open) Always `unprocessable_entity`. The HTTP status itself is still `200`. |

#### Example: Open ticket

The open ticket. `conversation_id` is the internal ID.

```json
{
  "id": 903,
  "account_id": 12,
  "inbox_id": 31,
  "channel_name": "Channel::Api",
  "conversation_id": 2301,
  "contact_id": 801,
  "initiated_by": "user",
  "resolved_by_id": null,
  "total_time": null,
  "resolved_at": null,
  "resolved_agent_id": null,
  "ticket_status": "open",
  "created_at": "2026-11-12T08:40:00.000Z",
  "updated_at": "2026-11-12T08:40:00.000Z",
  "custom_attributes": {}
}
```

#### Example: Conversation not open

The conversation is `pending` (Manual) or `resolved`. The HTTP status is still 200.

```json
{
  "error": "No open conversation",
  "status": "unprocessable_entity"
}
```

### 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"
}
```
