README — GET /api/admin/support/canned/{id}
GET /api/admin/support/canned/{id}#
GET/PUT/DELETE /api/admin/support/canned/🆔 read (support.read), replace and delete (support.manage, audited).Caller and authorization#
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.Request contract#
| Location | Name | Required | Meaning |
|---|
| path | id | Yes | Use the ID from an authorized staff response; source validators reject malformed IDs. |
This operation does not define a JSON payload. Staff writes still require Content-Type: application/json and the session-bound CSRF header.Response and failures#
Success: 200. GET/PUT/DELETE /api/admin/support/canned/🆔 read (support.read), replace and delete (support.manage, audited).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.Usage notes#
Keep customer messages and attachment URLs out of general logs. Replies can send real email; notes remain internal. Render inbound HTML only in the console’s sandboxed, network-restricted frame.
Implementation contract#
Source snapshot: admin/src/app/api/admin/support/canned/[id]/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/PUT/DELETE /api/admin/support/canned/:id: read (support.read), replace and delete (support.manage, audited). */
export const GET = adminRoute("support.read", async (_request, _ctx, context: Context) => adminJson(await getCanned(await idOf(context))));
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.Modified at 2026-10-26 13:41:16