GET /api/admin/support/tickets?status&assignee&email&account&cursor&limit&counts=1 (support.read): a page of tickets
by status (Index1), by requester email or by customer account sub (Index2 TICKETREQ#; the account's
email is resolved server-side), requesters masked; counts=1 adds per-status
counts (capped at 100).
Staff cookie session; permission support.read.
This is the private staff console on https://admin.handwrites.io. A personal API key, organisation token, student login or isolated app-testing credential does not authenticate this route.
| Location | Name | Required | Meaning |
|---|---|---|---|
| query | status | Conditional / optional | {"type":"string","enum":["open","pending","solved","spam"]} |
| query | assignee | Conditional / optional | me, none, or staff sub. |
| query | email | Conditional / optional | {"type":"string","maxLength":320} |
| query | account | Conditional / optional | {"type":"string"} |
| query | cursor | Conditional / optional | {"type":"string","maxLength":2000} |
| query | limit | Conditional / optional | {"type":"integer","minimum":1,"maximum":100} |
| query | counts | Conditional / optional | {"const":"1"} |
This operation does not define a JSON payload. Staff writes still require Content-Type: application/json and the session-bound CSRF header.
Success: 200. GET /api/admin/support/tickets?status&assignee&email&account&cursor&limit&counts=1 (support.read): a page of tickets
by status (Index1), by requester email or by customer account sub (Index2 TICKETREQ#; the account's
email is resolved server-side), requesters masked; counts=1 adds per-status
counts (capped at 100).
The wrapper returns {error:{code,message}} for CloudError failures, attaches Request-Id, and disables caching. Handle 401 by signing in; show role refusal for 403 forbidden, reauthenticate only for step_up_required, and collect a reason for 400 reason_required. A CSRF failure needs a current page/session token, not blind retries. Operation-specific 404/409/413/422/502/503 errors retain their status. Honor Retry-After on 429.
Source snapshot: admin/src/app/api/admin/support/tickets/route.ts. This reference describes the current working tree, not proof of deployment. The response service types and validators remain authoritative. The exact exported handler below makes conditional behavior reviewable. For helpers such as customer-routes or cloudRoute, see the shared API specification notes and the named service module.
/**
* GET /api/admin/support/tickets?status&assignee&email&account&cursor&limit&counts=1 (support.read): a page of tickets
* by status (Index1), by requester email or by customer account sub (Index2 TICKETREQ#<emailHash>; the account's
* email is resolved server-side), requesters masked; `counts=1` adds per-status
* counts (capped at 100).
*/
export const GET = adminRoute("support.read", async (request, ctx) => {
const parsed = QUERY.safeParse(Object.fromEntries(new URL(request.url).searchParams));
if (!parsed.success) throw invalid("Unknown filter.");
const { counts, ...query } = parsed.data;
const [page, totals] = await Promise.all([listDesk(ctx, query), counts ? statusCounts() : undefined]);
return adminJson({ ...page, counts: totals });
});
Do not use production customer data to test this operation. Use an authorized staff test account and a disposable target in an appropriate environment; email, deletion, role and credential mutations have real effects.