Documentation

Learn TicketsX faster

Setup guides, the full command reference, Premium features, and the REST API in one place.

Search Transcripts

GET/<guild_id>/api/transcripts/search

Search every closed ticket in the server, not just its metadata: what was said inside it, who said it, who took part, when it opened or closed, its panel, rating, or Discord channel ID. This is the same engine as Deep Search in the dashboard. Requires the `search_transcripts` permission (off by default).

POST/<guild_id>/api/transcripts/search

Identical, with the filters sent as a JSON body instead of query parameters. Easier for long queries and participant lists. If you send both, the body wins.

Every result carries the ticket’s metadata, up to 8 participants, and — when you searched by content — up to 3 matching message snippets so you can see *why* it matched. Take the TicketId from any result straight to Get a Transcript for the full message list, or Get Transcript HTML for the rendered archive.

Filters (all optional; combine as many as you like)

NameTypeRequiredDescription
qstringoptionalFree-text search of message content, max 200 characters. Words shorter than 3 characters are ignored by the index.
said_bystringoptionalOnly match content written by this Discord user ID. Combine with q.
participantsstring[]optionalUp to 5 users who messaged in the ticket, each a Discord user ID or a partial username. Comma-separated on GET, an array on POST.
participants_modestringoptionalall (default) requires every listed participant to have messaged in the same ticket; any matches tickets where at least one did.
include_botsbooleanoptionalInclude bot messages and bot participants in matching. Defaults to false.
opened_bystringoptionalTicket creator, as a Discord user ID or a partial username.
closed_bystringoptionalDiscord user ID of whoever closed the ticket.
channel_idstringoptionalThe Discord channel or thread ID the ticket used.
panel_idnumberoptionalOnly tickets opened from this panel.
opened_fromnumberoptionalUnix timestamp: only tickets opened at or after this time.
opened_tonumberoptionalUnix timestamp: only tickets opened at or before this time.
closed_fromnumberoptionalUnix timestamp: only tickets closed at or after this time.
closed_tonumberoptionalUnix timestamp: only tickets closed at or before this time.
rating_minnumberoptionalMinimum feedback rating, 1–5.
rating_maxnumberoptionalMaximum feedback rating, 1–5.
limitnumberoptionalResults per page, 1–50 (default 25).
offsetnumberoptionalResults to skip for pagination, max 10000 (default 0).

Search is rate limited to 10 requests per minute per token, separately from other reads, and runs under a strict time budget. A search that cannot finish in time returns 504 — narrow the filters (add a date range or a panel) and retry rather than repeating the same query. Values that do not validate are dropped rather than rejected, so check the filters object echoed back in the response to see exactly what was applied.

Search reads the transcript index, which is built while the server has Premium and backfilled across your existing archive when you first upgrade. The coverage object in every response tells you how many of your transcripts are indexed (indexed) out of the total stored (total) — if a backfill is still running, they will not match yet.

Example request — what a user said, in tickets a staff member also worked
curl -X GET \
  -H "Authorization: Bearer <API_TOKEN>" \
  "https://api.ticketsx.xyz/<guild_id>/api/transcripts/search?q=refund&participants=123456789,987654321&participants_mode=all&closed_from=1730000000&limit=25"
Example request — same search as a JSON body
curl -X POST \
  -H "Authorization: Bearer <API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"q":"refund","participants":["123456789","987654321"],"participants_mode":"all","closed_from":1730000000,"limit":25}' \
  https://api.ticketsx.xyz/<guild_id>/api/transcripts/search
Example response
{
  "transcripts": [
    {
      "TicketId": 42,
      "AuthorId": "123456789",
      "AuthorUsername": "jane",
      "PanelId": 1,
      "PanelName": "Support",
      "Rating": 5,
      "CloseReason": "Resolved",
      "CreatedAt": 1732200000,
      "ClosedAt": 1732210000,
      "ChannelId": "1122334455",
      "ClosedBy": "987654321",
      "Participants": [
        { "UserId": "123456789", "Username": "jane", "MessageCount": 12, "IsBot": false }
      ],
      "Snippets": [
        { "AuthorId": "123456789", "AuthorUsername": "jane", "Content": "my refund never arrived", "CreatedAt": 1732200050 }
      ]
    }
  ],
  "pagination": { "total": 1, "limit": 25, "offset": 0, "returned": 1 },
  "coverage": { "indexed": 480, "total": 480 },
  "filters": { "q": "refund", "participants_mode": "all", "limit": 25 }
}