# Support Tickets

Support Tickets gives your customers a hosted support portal and your team an agent inbox in the dashboard. This REST API lets your own app create and read tickets on your customers' behalf.

## How the product fits together

- **Your customers** raise and follow tickets, either on the hosted portal (your subdomain or custom domain) or inside your own app via this API.
- **Your agents** answer from Dashboard → Support: assignment, priorities, internal notes, canned replies, knowledge-base articles.
- **Your systems** stay in sync through outbound webhooks (`ticket.created` / `ticket.updated` / `ticket.comment_added`); see [Webhooks](/webhooks).

## Concepts

| Concept | Values / meaning |
|---------|-----------------|
| Ticket status | `OPEN` → `IN_PROGRESS` → `RESOLVED` → `CLOSED`. A customer comment on a RESOLVED ticket reopens it. |
| Priority | `LOW` · `NORMAL` · `HIGH` · `URGENT` |
| Comments | `PUBLIC` (customer-visible, delivered by webhook) vs `INTERNAL` agent notes (never leave the platform) |
| Customer identity | Tickets are keyed by `customerEmail`; every read requires it, so one customer can never see another's tickets. |
| Portal sign-in | Three modes: single-use **sign-in links** minted by your backend (below), hosted SSO, or delegated login against your own user store (see [Webhooks → Customer authentication](/webhooks)). |

## Using this API

Your backend calls these endpoints on behalf of your customers.

**Scope required:** `full-access` or `ticket-management`

**All requests use:** `x-api-key: {{apiKey}}`

**Ticket statuses:** `OPEN → IN_PROGRESS → RESOLVED → CLOSED`
**Priorities:** `LOW`, `NORMAL`, `HIGH`, `URGENT`

> [!NOTE]
> Agents (your support team) manage tickets from the merchant dashboard. These REST endpoints are for your application backend to create tickets on behalf of customers and let customers retrieve their own tickets.

**POST /api/v1/support-tickets/auth/login-links**: Mint customer sign-in link (fetch id `endpoint:6ae152d083f212a997c813b8`)

**GET /api/v1/support-tickets/tickets**: List customer tickets (fetch id `endpoint:6ae152d083f212a997c813b9`)

**POST /api/v1/support-tickets/tickets**: Create ticket (fetch id `endpoint:6ae152d083f212a997c813ba`)

**GET /api/v1/support-tickets/tickets/{ticketId}**: Get ticket detail (fetch id `endpoint:6ae152d083f212a997c813bb`)

**POST /api/v1/support-tickets/tickets/{ticketId}/comments**: Add customer comment (fetch id `endpoint:6ae152d083f212a997c813bc`)
