GET /api/admin/audit?month=yyyy-mm&actor=<staffSub|system>&target=:&cursor=&limit= (audit.read): entries
newest first, before/after already masked when written. Reading the log is not itself audited (it holds no customer
content; reasons are the admins' own words).
Staff cookie session; permission audit.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 | month | Conditional / optional | {"type":"string","pattern":"^\d{4}-\d{2}$"} |
| query | actor | Conditional / optional | Staff sub or system. |
| query | target | Conditional / optional | type:id |
| query | cursor | Conditional / optional | {"type":"string"} |
| query | limit | Conditional / optional | {"type":"integer","minimum":1,"maximum":100} |
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/audit?month=yyyy-mm&actor=<staffSub|system>&target=:&cursor=&limit= (audit.read): entries
newest first, before/after already masked when written. Reading the log is not itself audited (it holds no customer
content; reasons are the admins' own words).
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/audit/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/audit?month=yyyy-mm&actor=<staffSub|system>&target=<type>:<id>&cursor=&limit= (audit.read): entries
* newest first, before/after already masked when written. Reading the log is not itself audited (it holds no customer
* content; reasons are the admins' own words).
*/
export const GET = adminRoute("audit.read", async (request) => adminJson(await auditPage(parseAuditQuery(new URL(request.url).searchParams))));
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.