Ticket list, create, and update β with auto-generated changelog rows on tracked field changes.
List tickets
Paginated tickets with full inline relations β status, assigned_user, created_by_user, conversation, assignees[], _count.activities. Used by the chat detail screen's Linked tickets tab and the dedicated tickets screen.
sort always prepends position ASC as the primary key (kanban order), UNLESS conversation_id is set β in that case kanban order is irrelevant and only the user-selected key is applied.
Performance: 7 queries flat β list + count + batched (statuses, users, conversations, assignees, activity-counts). No N+1.
query Parameters
board_idstatus_idpriorityComma-separated: LOW,MEDIUM,HIGH,URGENT.
assigned_toComma-separated UUIDs. Matches legacy assigned_to OR junction ticket_assignees.
created_byComma-separated UUIDs.
conversation_idTickets linked to a specific chat. Disables position sort.
searchILIKE across title, description, cast(ticket_number AS TEXT).
is_donedate_fromYYYY-MM-DD or RFC 3339. Inclusive lower bound on created_at.
date_toYYYY-MM-DD or RFC 3339. Inclusive upper bound on created_at. Bare dates are auto-bumped to end-of-day.
sortpage1-indexed page number. Capped at 500 to bound deep-scan cost.
limitRows per page. Capped at 100.
List tickets βΊ Responses
Tickets page.
successCreate a ticket
Creates a ticket. ticket_number is auto-allocated as MAX(ticket_number)+1 within the organization; position is auto-allocated as MAX(position)+1 within the target status column. All writes (ticket + assignees + field_values + product snapshots) happen in a single transaction.
Create a ticket βΊ Request Body
board_idstatus_idMust belong to board_id.
titledescriptionprioritytemplate_idassigned_toLegacy single assignee.
assigned_to_idsMulti-assignee array. Inserted into ticket_assignees.
conversation_idCreate a ticket βΊ Responses
Ticket created with all relations inlined.
successcodeGet a ticket
Returns the same enriched ticket detail payload as POST /tickets and PATCH /tickets/{id} β one DTO for all three on the client side. Includes inline status, assigned_user, created_by_user, conversation, assignees[], products[], attachments[], field_values[], and a _count.activities badge.
path Parameters
ticket_idUUID of the ticket.
Get a ticket βΊ Responses
Ticket detail.
successUpdate a ticket
Partial update. Empty body returns 400 no editable fields in update request.
Status side-effect: when status_id points at a status with is_default=true on its board, the ticket flips to is_done=true and stamps done_at. Moving back to a non-default status clears both.
Auto-changelog: every tracked field change auto-writes a ticket_activities row of type=CHANGELOG with structured metadata: {field, old, new}. Tracked fields: title, description, priority, status (uses the status NAME, not the id, in the human-readable content), and custom field values. All writes (ticket update + assignee delete-create + field_value upserts + N changelog inserts) happen inside one transaction.
path Parameters
ticket_idUUID of the ticket.
Update a ticket βΊ Request Body
titledescriptionPass empty string to clear.
prioritystatus_idMust belong to the same board. Flips is_done if the target status is the board's is_default.
assigned_toassigned_to_idsWhen present, REPLACES ticket_assignees (delete-all + create-all in one transaction).
conversation_idtemplate_idUpdate a ticket βΊ Responses
Updated ticket with all relations.
successMark a ticket done (or reopen)
Flips is_done (+ done_at) directly β no status change required. Mirrors the dashboard's mark-done endpoint so boards without a is_default-flagged status can still surface a one-tap Mark done affordance on mobile.
Pass {"is_done": false} to reopen. Empty body defaults to mark-as-done. Idempotent β calling with the requested value when the ticket is already in that state still returns 200.
path Parameters
ticket_idUUID of the ticket.
Mark a ticket done (or reopen) βΊ Request Body optional
is_doneMark a ticket done (or reopen) βΊ Responses
Ticket updated (or already in the requested state β idempotent).
success