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

# Tickets API — list all tickets and query audit history

> Retrieve a unified view of all tickets across incidents, changes, and problems, and pull an audit trail of every state transition.

The Tickets API provides a read interface over the ticket layer that sits beneath incidents, changes, and problems. Rather than querying each domain endpoint separately, use `/tickets` to get a unified view of everything active in your workspace. The `/history` endpoint exposes the complete audit log — every status change, reassignment, comment, and system event — making it straightforward to satisfy compliance requirements or prepare for a post-incident review.

<Note>
  All endpoints require `Authorization: Bearer <token>`.
</Note>

**Base path:** `https://your-api-domain.com/api/v1/tickets`

***

## List all tickets

Returns a paginated list of all tickets in the workspace. Each record identifies its originating domain — incident, change, or problem — alongside the current status and assignee.

`GET /`

<ParamField query="page" type="number" default="1">
  Page number.
</ParamField>

<ParamField query="limit" type="number" default="20">
  Items per page (max 100).
</ParamField>

<ParamField query="type" type="string">
  Filter by ticket type: `INCIDENT`, `CHANGE`, or `PROBLEM`.
</ParamField>

<ParamField query="status" type="string">
  Filter by current lifecycle status.
</ParamField>

```http theme={null}
GET /api/v1/tickets?type=INCIDENT&status=OPEN
Authorization: Bearer <token>
```

**Response**

```json theme={null}
{
  "success": true,
  "message": "Tickets retrieved",
  "data": [
    {
      "id": "INC-20260522-0041",
      "type": "INCIDENT",
      "summary": "Payment service down",
      "priority": "CRITICAL",
      "status": "OPEN",
      "assignedTo": "oncall@example.com",
      "createdAt": "2026-05-22T14:33:00Z",
      "updatedAt": "2026-05-22T14:45:00Z"
    }
  ],
  "meta": {
    "total": 84,
    "page": 1,
    "limit": 20,
    "totalPages": 5
  }
}
```

<ResponseField name="id" type="string">Unique ticket identifier.</ResponseField>
<ResponseField name="type" type="string">Ticket domain: `INCIDENT`, `CHANGE`, or `PROBLEM`.</ResponseField>
<ResponseField name="summary" type="string">Short description of the ticket.</ResponseField>
<ResponseField name="priority" type="string">Severity: `LOW`, `MEDIUM`, `HIGH`, or `CRITICAL`.</ResponseField>
<ResponseField name="status" type="string">Current lifecycle status.</ResponseField>
<ResponseField name="assignedTo" type="string">Email of the assigned engineer.</ResponseField>
<ResponseField name="createdAt" type="string">ISO 8601 creation timestamp.</ResponseField>
<ResponseField name="updatedAt" type="string">ISO 8601 timestamp of the most recent update.</ResponseField>

***

## Get ticket history

Returns the complete audit log for tickets in the workspace — every status change, comment, reassignment, priority update, and system-generated event — ordered chronologically. Scope the results to a single ticket using the `ticketId` query parameter.

`GET /history`

<ParamField query="ticketId" type="string">
  Scope the history to a single ticket ID.
</ParamField>

<ParamField query="from" type="string">
  Start of the date range (ISO 8601).
</ParamField>

<ParamField query="to" type="string">
  End of the date range (ISO 8601).
</ParamField>

<ParamField query="page" type="number" default="1">
  Page number.
</ParamField>

<ParamField query="limit" type="number" default="20">
  Items per page (max 100).
</ParamField>

```http theme={null}
GET /api/v1/tickets/history?ticketId=INC-20260522-0041
Authorization: Bearer <token>
```

**Response**

```json theme={null}
{
  "success": true,
  "message": "History retrieved",
  "data": [
    {
      "ticketId": "INC-20260522-0041",
      "event": "STATUS_CHANGE",
      "from": "OPEN",
      "to": "ACKNOWLEDGED",
      "actor": "oncall@example.com",
      "timestamp": "2026-05-22T14:38:00Z"
    },
    {
      "ticketId": "INC-20260522-0041",
      "event": "COMMENT_ADDED",
      "actor": "sre@example.com",
      "message": "Identified crash-loop in stripe-service pod",
      "timestamp": "2026-05-22T14:40:00Z"
    }
  ],
  "meta": {
    "total": 12,
    "page": 1,
    "limit": 20,
    "totalPages": 1
  }
}
```

<ResponseField name="ticketId" type="string">The ticket this event belongs to.</ResponseField>

<ResponseField name="event" type="string">
  Event type. Common values: `STATUS_CHANGE`, `COMMENT_ADDED`, `ASSIGNED`, `PRIORITY_CHANGE`, `RESOLVED`.
</ResponseField>

<ResponseField name="from" type="string">Previous value, present on change events.</ResponseField>
<ResponseField name="to" type="string">New value, present on change events.</ResponseField>
<ResponseField name="actor" type="string">Email of the user or system that triggered the event.</ResponseField>
<ResponseField name="message" type="string">Event detail text, present on comment and note events.</ResponseField>
<ResponseField name="timestamp" type="string">ISO 8601 timestamp of the event.</ResponseField>
