# Support Tickets

Endpoints for interacting with customer support tickets.

## List support tickets

 - [GET /support_tickets](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_tickets.md): List all support tickets that the authorization token has access to.

Access control:
- User-scoped tokens: Returns only tickets belonging to that user
- Organization-scoped tokens: Returns only tickets belonging to users in that organization
- Tokens with access_all_areas: Returns all tickets including those without a user

Note: Tickets without a user (null user field) are only accessible to applications with access_all_areas permission. These tickets represent inquiries from channels where a user account may not exist (e.g., pre-signup inquiries, web forms).

## Retrieve support ticket

 - [GET /support_tickets/{support_ticket_id}](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_tickets-support_ticket_id.md): Retrieve information about a single, specific support ticket.

Access control:
- User-scoped tokens: Can only access tickets belonging to that user
- Organization-scoped tokens: Can only access tickets belonging to users in that organization
- Tokens with access_all_areas: Can access all tickets including those without a user

Note: Tickets without a user (null user field) will return 404 for tokens without access_all_areas permission.

## Update support ticket

 - [PATCH /support_tickets/{support_ticket_id}](https://developers.ev.energy/ev.energy-api-v2/support-tickets/patch-support_tickets-support_ticket_id.md): Update support ticket categorization.

Access control follows the same rules as retrieval:
- User-scoped tokens: Can only update tickets belonging to that user
- Organization-scoped tokens: Can only update tickets belonging to users in that organization
- Tokens with access_all_areas: Can update all tickets including those without a user

## List messages for a support ticket

 - [GET /support_tickets/{support_ticket_id}/messages](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_tickets-support_ticket_id-messages.md): List all messages in a support ticket conversation, ordered by position.

Access control follows the same rules as the parent support ticket:
- User-scoped tokens: Can only access messages for tickets belonging to that user
- Organization-scoped tokens: Can only access messages for tickets belonging to users in that organization
- Tokens with access_all_areas: Can access messages for all tickets including those without a user

## Retrieve a message for a support ticket

 - [GET /support_tickets/{support_ticket_id}/messages/{message_id}](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_tickets-support_ticket_id-messages-message_id.md): Retrieve a single message from a support ticket conversation.

Access control follows the same rules as the parent support ticket.

## Get support ticket categories

 - [GET /support_tickets/categories](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_tickets-categories.md): Returns all available support ticket categories and subcategories.

## Get support ticket Sankey diagram data

 - [GET /support-ticket-stats/sankey](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_ticket_stats-sankey.md): Returns aggregated data for visualizing ticket flow from category to subcategory in a Sankey diagram. Only includes tickets with human-verified categories.

## Get support ticket volume time series

 - [GET /support-ticket-stats/volume](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_ticket_stats-volume.md): Returns time series data showing ticket volume over time. Can be grouped by day, week, or month.

## Get support ticket resolution metrics

 - [GET /support-ticket-stats/resolution](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_ticket_stats-resolution.md): Returns metrics about ticket resolution including resolution rate, average and median resolution times.

## Get support ticket status breakdown

 - [GET /support-ticket-stats/status](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_ticket_stats-status.md): Returns the distribution of tickets across different status values.

## Get support ticket priority breakdown

 - [GET /support-ticket-stats/priority](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_ticket_stats-priority.md): Returns the distribution of tickets across different priority values.

## Get support ticket source breakdown

 - [GET /support-ticket-stats/source](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_ticket_stats-source.md): Returns the distribution of tickets across different source values.

## Get top support ticket categories and subcategories

 - [GET /support-ticket-stats/top-categories](https://developers.ev.energy/ev.energy-api-v2/support-tickets/get-support_ticket_stats-top-categories.md): Returns the most common categories and subcategories sorted by ticket count. Supports a limit parameter to control the number of results.

