# Tickets API

Create and update customer tickets, internal escalations, trackers, custom fields, ticket types, states, and linked external issues in dimmi.

## Ticket events

- `GET /ticket-events` - Export the ticket log: Follows every ticket change in the workspace after a cursor or since a time, deletes included.

## Ticket fields

- `PATCH /ticket-fields/{field}` - Update a ticket field: Changes a field's settings.
- `DELETE /ticket-fields/{field}` - Archive a ticket field: Hides a field; stored values stay.

## Ticket issues

- `DELETE /ticket-issues/{issue}` - Unlink an issue: Removes the link; the issue stays in its tool.

## Ticket links

- `DELETE /ticket-links/{link}` - Remove a ticket link: Removes a link.

## Ticket settings

- `GET /ticket-settings` - Get ticket switches: Reads whether duplicate conversations are linked to a tracker by themselves and the spike threshold. Returns the switches.
- `PATCH /ticket-settings` - Update ticket switches: Changes the workspace's ticket switches. Returns the switches.

## Ticket states

- `GET /ticket-states` - List ticket states: Lists states in their five groups with the label customers see.
- `POST /ticket-states` - Add a ticket state: Adds a state to a group.
- `PATCH /ticket-states/{state}` - Update a ticket state: Renames a state or changes its customer label.
- `DELETE /ticket-states/{state}` - Remove a ticket state: Removes a state, moving its tickets to move_to, a state of the same group.
- `PATCH /ticket-states` - Reorder ticket states: Sets the order of the states.

## Ticket types

- `GET /ticket-types` - List ticket types: Lists types with their fields, allowed states and ticket counts.
- `GET /ticket-types/{type}/fields` - List a type's fields: Lists a type's fields in order.
- `POST /ticket-types` - Create a ticket type: Adds a type: customer, back_office or tracker.
- `POST /ticket-types/{type}/fields` - Add a ticket field: Adds a field such as order_number (short_text) or amount (currency); key and data type never change.
- `GET /ticket-types/{type}` - Get a ticket type: Reads one type with its fields and states.
- `PATCH /ticket-types/{type}` - Update a ticket type: Changes a type's settings and the states it uses; its kind stays.
- `DELETE /ticket-types/{type}` - Archive a ticket type: Hides a type from new tickets; old ones keep it.
- `PATCH /ticket-types/{type}/fields` - Reorder ticket fields: Sets the order of a type's fields.

## Tickets

- `GET /tickets` - List tickets: Finds tickets by type, kind (customer, back_office, tracker), state, group, teammate, team, company, customer, reference, field values, linked issue status, dates or text. Use kind=tracker&q=... to find the tracker a bug report belongs to. Returns a page of tickets with type, state and customer label, fields, version and linked issues.
- `GET /tickets/{ticket}/links` - List a ticket's links: Reads back-office, tracker, follow-up links.
- `GET /tickets/{ticket}/events` - List a ticket's history: Reads every change to a ticket, oldest first. Returns state, field, type, link, issue, assignment and note entries with who and when.
- `GET /tickets/{ticket}/issues` - List a ticket's linked issues: Lists the issues and engineering incidents linked to a ticket, with each one's status as last seen. Returns the links with provider, key, URL, status, status group, warning and sync error.
- `GET /tickets/{ticket}/sla-clocks` - List a ticket's SLA clocks: Lists every clock of a ticket, newest first: target, state, started, due, paused and breached. Returns clocks in states running, paused, met, breached or canceled.
- `GET /tickets/{ticket}/conversations` - List a tracker's conversations: Lists the conversations a tracker reaches, with customer, company, plan and revenue. Returns the conversations and totals under meta.impact.
- `POST /tickets` - Create a ticket: Creates a ticket of a type: back-office work, a tracker, or a customer ticket for a contact (which starts its conversation). Required fields are enforced: a 422 lists the missing keys. Send external_id to make retries safe. Returns the ticket with its reference, such as T-482.
- `POST /tickets/{ticket}/links` - Link a ticket: Links a tracker to a conversation (kind tracker), a customer ticket to back-office work, or any two tickets (related, follow_up). Linking twice changes nothing.
- `POST /tickets/{ticket}/notes` - Add a ticket note: Leaves an internal note; a customer ticket's note also lands in its conversation.
- `POST /tickets/{ticket}/issues` - Create or link an issue: Creates an issue in a connected tool (installation_id, team_id, project_id, title) with the customer impact and a link back, or links an existing one by url or key. With an incident tool it declares the incident there (service_id for PagerDuty, severity_id). Returns the link.
- `POST /tickets/{ticket}/restore` - Restore a ticket: Takes a ticket out of the trash.
- `POST /tickets/{ticket}/escalations` - Escalate to back-office work: Creates back-office work for another team from a customer ticket and moves the customer ticket to a state that waits on the team. When the work resolves, the customer ticket comes back. Returns the new back-office ticket.
- `GET /tickets/{ticket}` - Get a ticket: Reads one ticket by id or reference (T-482) with its links, running SLA clocks and impact. Returns the ticket; trackers include customers, companies and revenue reached.
- `GET /tickets/{ticket}/summary` - Summarize a tracker: Reads what a tracker's customers report: a short summary the cheap model writes, the number of reports and which plans the reporters' companies are on. Returns summary, reports and plans with counts.
- `PATCH /tickets/{ticket}` - Update a ticket: Moves state, sets fields (merged; null removes), title, type, priority, teammate or team, and accepts AI suggestions. Send version to refuse the change if someone edited it since. Moving to a resolved state needs every field required to resolve. Returns the ticket as it now is.
- `DELETE /tickets/{ticket}` - Trash a ticket: Moves a ticket to the trash; restore brings it back.

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
