Support Tickets API

Support Tickets API

API endpoints for creating and managing support tickets with threaded conversations. All endpoints require a valid JWT token from device attestation.

TicketStatus Enum

Value Description
openTicket is open and awaiting admin response
awaiting_replyAdmin has replied, awaiting user response
resolvedIssue has been resolved
closedTicket is closed

TicketPriority Enum

Value Description
lowNon-urgent issue
normalStandard priority (default)
highImportant issue requiring prompt attention
urgentCritical issue requiring immediate action

1. Create Support Ticket

POST /api/v1/support/tickets

Creates a new support ticket. The initial message body is saved as the first ticket message.

Request Body

{
  "subject": "Unable to sign in after update",
  "body": "After updating to v2.1, I get a blank screen on the login page. Device: iPhone 15 Pro, iOS 17.2.",
  "submitterId": "user_123",
  "submitterEmail": "user@example.com",
  "deviceHash": "abc123def456"
}
Field Type Required Description
subjectStringYesTicket subject line
bodyStringYesInitial message content
submitterIdStringYesYour app's user identifier
submitterEmailStringNoUser's email for notifications
deviceHashStringNoDevice identifier from attestation

Response (201 Created)

{
  "id": "990e8400-e29b-41d4-a716-446655440000",
  "subject": "Unable to sign in after update",
  "status": "open",
  "priority": "normal",
  "submitterId": "user_123",
  "messageCount": 1,
  "createdAt": "2025-01-15T10:30:00Z"
}

2. List Support Tickets

GET /api/v1/support/tickets

Returns tickets for a specific user. The submitterId query parameter is required to scope results.

Query Parameters

Parameter Type Required Description
submitterIdStringYesFilter tickets by submitter

Response

{
  "items": [
    {
      "id": "990e8400-e29b-41d4-a716-446655440000",
      "subject": "Unable to sign in after update",
      "status": "awaiting_reply",
      "priority": "normal",
      "submitterId": "user_123",
      "messageCount": 3,
      "createdAt": "2025-01-15T10:30:00Z",
      "updatedAt": "2025-01-16T14:00:00Z"
    }
  ]
}

3. Get Ticket with Messages

GET /api/v1/support/tickets/:ticketId

Returns a single ticket with its full message thread.

Response

{
  "id": "990e8400-e29b-41d4-a716-446655440000",
  "subject": "Unable to sign in after update",
  "status": "awaiting_reply",
  "priority": "normal",
  "submitterId": "user_123",
  "submitterEmail": "user@example.com",
  "messageCount": 2,
  "createdAt": "2025-01-15T10:30:00Z",
  "updatedAt": "2025-01-16T14:00:00Z",
  "messages": [
    {
      "id": "aaa-111",
      "authorId": "user_123",
      "authorType": "user",
      "body": "After updating to v2.1, I get a blank screen on the login page.",
      "createdAt": "2025-01-15T10:30:00Z"
    },
    {
      "id": "bbb-222",
      "authorId": "admin_1",
      "authorType": "admin",
      "body": "Thanks for reporting this. Can you try clearing the app cache?",
      "createdAt": "2025-01-16T14:00:00Z"
    }
  ]
}

4. Reply to Ticket

POST /api/v1/support/tickets/:ticketId/messages

Adds a message to an existing support ticket conversation.

Request Body

{
  "authorId": "user_123",
  "body": "Clearing the cache fixed it. Thanks!"
}
Field Type Required Description
authorIdStringYesYour app's user identifier
bodyStringYesReply message content

Response (201 Created)

{
  "id": "ccc-333",
  "authorId": "user_123",
  "authorType": "user",
  "body": "Clearing the cache fixed it. Thanks!",
  "createdAt": "2025-01-17T09:00:00Z"
}

Error Responses

// 404 Not Found
{
  "error": "not_found",
  "message": "Support ticket not found"
}

// 403 Forbidden
{
  "error": "forbidden",
  "message": "Access denied"
}

// 422 Unprocessable Entity
{
  "error": "validation_error",
  "message": "Subject and body are required"
}

Next Steps