feat: support tickets between accounts and platform admins
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 7m0s
ci / test (pull_request) Successful in 12m1s
ci / build (pull_request) Successful in 18m14s
ci / image (pull_request) Successful in 5m9s

Accounts open tickets under Support and admins answer them under Admin →
Support tickets.

- A ticket is open while it waits for the admins and answered while it
  waits for the account. Either side can close or reopen it, and a reply
  reopens it.
- The admins are mailed about new tickets and replies, and the account
  about answers.
- A ticket can name the active organization and point at a monitor,
  notification channel, alert group, status page or incident in it.
  Each must be something the account can read.
- Next to the conversation, admins see the account at a glance: state,
  sign-in, organizations with their limits and usage, and open tickets.
- Admins switch support off and limit how many tickets an account has
  open at once.
- Suspended accounts and those yet to accept the terms reach support too;
  a suspended account opens one ticket.
- Tickets are part of the account export and are deleted with the
  account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-24 18:01:50 +01:00
1 parent 9fc3c6b050
commit f3d402705e
25 files changed
+5296 -451

No files matched your search

+23
View File
@@ -65,6 +65,17 @@ var endpoints = []endpoint{
{method: "POST", path: "/api/v1/consent", tag: "Account", summary: "Accept the platform's privacy policy and terms", sessionOnly: true,
description: "`versions` are the versions shown, e.g. `privacy:12,terms:14`; `409 consent_outdated` when a document changed meanwhile. Until an account accepted the current versions, other requests of its sessions get `403 consent_required`.",
req: consentRequest{}, resp: obj{"redirect": ""}},
{method: "GET", path: "/api/v1/support/tickets", tag: "Support", summary: "The account's support tickets", sessionOnly: true,
description: "Newest activity first. Open to suspended accounts and to those that have not accepted the terms.", resp: obj{"tickets": []supportTicketView{}}},
{method: "POST", path: "/api/v1/support/tickets", tag: "Support", summary: "Ask the platform's admins for help", sessionOnly: true,
description: "`message` is Markdown; the admins are mailed. `attach_org` names the active organization; `monitor_id`, `channel_id`, `alert_group_id`, `status_page_id` and `incident_id` point at things in it the account can read, and name it too. `409 too_many_tickets` beyond the platform's limit of open tickets per account, `409 suspended_ticket_limit` for a second ticket of a suspended account; `403 support_disabled` while the admins switched support off.",
req: supportTicketRequest{}, resp: supportTicketView{}, status: http.StatusCreated},
{method: "GET", path: "/api/v1/support/tickets/:id", tag: "Support", summary: "A support ticket with its messages", sessionOnly: true,
resp: supportTicketView{}},
{method: "POST", path: "/api/v1/support/tickets/:id/messages", tag: "Support", summary: "Reply to a support ticket", sessionOnly: true,
description: "Moves the ticket to `open`, also out of `closed`.", req: supportMessageRequest{}, resp: obj{"status": ""}, status: http.StatusCreated},
{method: "PUT", path: "/api/v1/support/tickets/:id/status", tag: "Support", summary: "Close or reopen a support ticket", sessionOnly: true,
description: "`status` is `closed` or `open`.", req: supportStatusRequest{}, status: http.StatusNoContent},
{method: "POST", path: "/api/v1/markdown/preview", tag: "Account", summary: "Render Markdown as pages will show it",
req: previewRequest{}, resp: obj{"html": ""}},
{method: "POST", path: "/api/v1/invitations/:token/accept", tag: "Account", summary: "Accept an invitation with the signed-in account", sessionOnly: true,
@@ -273,6 +284,18 @@ var endpoints = []endpoint{
// Platform
{method: "GET", path: "/api/v1/admin/audit", tag: "Platform", summary: "Platform audit log", perm: "platform admin",
description: "Paged, newest first.", resp: paged(obj{"events": []auditEventView{}})},
{method: "GET", path: "/api/v1/admin/support/settings", tag: "Platform", summary: "How the platform runs support tickets", perm: "platform admin",
resp: supportSettings{}},
{method: "PUT", path: "/api/v1/admin/support/settings", tag: "Platform", summary: "Switch support tickets on or off and limit open tickets per account", perm: "platform admin",
description: "`max_open_tickets` of 0 means unlimited.", req: supportSettings{}, status: http.StatusNoContent},
{method: "GET", path: "/api/v1/admin/support/tickets", tag: "Platform", summary: "Support tickets of every account", perm: "platform admin",
description: "`?status=open` (default), `answered`, `closed` or `all`; the latest 200, those waiting for the admins first.", resp: obj{"tickets": []supportTicketView{}}},
{method: "GET", path: "/api/v1/admin/support/tickets/:id", tag: "Platform", summary: "A support ticket with its messages", perm: "platform admin",
resp: supportTicketView{}},
{method: "POST", path: "/api/v1/admin/support/tickets/:id/messages", tag: "Platform", summary: "Answer a support ticket", perm: "platform admin",
description: "Moves the ticket to `answered` and mails the account.", req: supportMessageRequest{}, resp: obj{"status": ""}, status: http.StatusCreated},
{method: "PUT", path: "/api/v1/admin/support/tickets/:id/status", tag: "Platform", summary: "Set a support ticket's status", perm: "platform admin",
req: supportStatusRequest{}, status: http.StatusNoContent},
{method: "GET", path: "/api/v1/admin/legal", tag: "Platform", summary: "Platform legal notice and privacy policy", perm: "platform admin",
resp: obj{"documents": []legalView{}}},
{method: "PUT", path: "/api/v1/admin/legal/:kind", tag: "Platform", summary: "Set a platform legal document", perm: "platform admin",