> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decimal.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Tickets API

> Read or delete the tickets Decimal synced from your helpdesk.

Decimal [syncs tickets](https://docs.decimal.app/support/ticket-sync.md) from your connected helpdesk. The Tickets API reads or deletes them either by the ID your helpdesk gave them or by Decimal's ticket ID.

| Endpoint | Scope |
| - | - |
| List tickets (`GET /v0/tickets`) | `tickets:read` |
| Get a ticket by Decimal ID (`GET /v0/tickets/{id}`) | `tickets:read` |
| Download a ticket file (`GET /v0/tickets/{id}/files/{file_id}`) | `tickets:read` |
| [Get a ticket](https://docs.decimal.app/api-reference/tickets/get-a-ticket.md) | `tickets:read` |
| [Delete a ticket](https://docs.decimal.app/api-reference/tickets/delete-a-ticket.md) | `tickets:delete` |

## List tickets

`GET /v0/tickets` returns tickets newest first in `data`, with `has_more` indicating whether more pages exist. Page with `limit` and `starting_after`, and filter by helpdesk with the optional `source` parameter.

## Find a ticket

To look up a ticket by Decimal's ID, use `GET /v0/tickets/{id}`. To download a file attached to a ticket, use `GET /v0/tickets/{id}/files/{file_id}`, which redirects to a short-lived download link.

The Get a ticket and Delete a ticket endpoints take two path parameters:

* `source`: the helpdesk, lowercase, such as `zendesk` or `plain`
* `external_id`: the ticket's ID in that helpdesk. For Plain, use the thread ID.

```bash theme={null}
curl https://api.getdecimal.ai/v0/tickets/zendesk/48213 \
  -H "Authorization: Bearer sk-de-..."
```

The response has the original post in `body_html`, then every reply and internal note in `messages`, oldest first. `is_private` marks internal notes. `requester`, `account`, `assignee`, `team`, and `custom_fields` come straight from the helpdesk, so their shape depends on which one you use.

## Delete a ticket

Deleting removes the ticket from Decimal only. If it still exists in your helpdesk, the next sync brings it back, so delete it there first.

A `500` on delete means the deletion didn't finish. Send the same request again.

Deleting a ticket is permanent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.