Tickets

Base URL: $CONSUMER_API

List consumer support tickets

Logs

GET /tickets

Returns the tickets the caller opened plus tickets on accounts the caller can read, across the utilities where the caller holds accounts, or only one utility when the X-Tenant-ID header selects it. The list can be narrowed with account_id, category and status, and is cursor-paginated with limit (default 20, at most 100) and after. Answers 403 when the caller has no consumer access.

Parameters

limitinteger · query · optional

Maximum resources to return (default 20, maximum 100).

afterstring · query · optional

Opaque cursor returned by the previous page.

Returns

200 Consumer tickets

curl -X GET "$CONSUMER_API/tickets" \
  -H "Authorization: Bearer sk_test_..."
Response 200

Consumer tickets

Submit a consumer complaint or service request

Logs

POST /tickets

Opens a ticket in the open status on behalf of the signed-in person; subject and description are required, category defaults to complaint and priority to medium. When account_id is given, the ticket is filed with the utility that holds that account and the caller must be allowed to open tickets on it (403 otherwise); without it, the utility comes from the X-Tenant-ID header or the caller's only utility, and the call answers 400 when the choice is ambiguous. Returns 201 with the new ticket.

Returns

201 Ticket submitted

curl -X POST "$CONSUMER_API/tickets" \
  -H "Authorization: Bearer sk_test_..."
Response 201

Ticket submitted

Get consumer ticket details

Logs

GET /tickets/{id}

Returns the ticket with its status, category, priority and timestamps. Only tickets the caller opened, or tickets on accounts the caller can read, are found; any other ticket answers 404.

Parameters

idstring · path · required

Identifier of the ticket (starts with tkt_); it must be one the caller opened or one on an account the caller can read.

Returns

200 Consumer ticket details

curl -X GET "$CONSUMER_API/tickets/{id}" \
  -H "Authorization: Bearer sk_test_..."
Response 200

Consumer ticket details

List comments on consumer ticket

Logs

GET /tickets/{id}/comments

Returns the conversation on a ticket, with comments from both the caller and utility staff marked by author_type (consumer or staff). The caller must be able to read the ticket, otherwise the call answers 404. Results are cursor-paginated with limit (default 20, at most 100) and after.

Parameters

idstring · path · required

Identifier of a ticket the caller opened or that is on an account the caller can read.

limitinteger · query · optional

Maximum resources to return (default 20, maximum 100).

afterstring · query · optional

Opaque cursor returned by the previous page.

Returns

200 Comments

curl -X GET "$CONSUMER_API/tickets/{id}/comments" \
  -H "Authorization: Bearer sk_test_..."
Response 200

Comments

Add comment to consumer ticket

Logs

POST /tickets/{id}/comments

Adds a comment authored by the signed-in person; content is required and an empty value answers 400. When the ticket was waiting on the consumer (pending_consumer), the comment moves it back to in_progress. Returns 201 with the comment; a ticket the caller cannot read answers 404.

Parameters

idstring · path · required

Identifier of a ticket the caller opened or that is on an account the caller can read.

Returns

201 Comment added

curl -X POST "$CONSUMER_API/tickets/{id}/comments" \
  -H "Authorization: Bearer sk_test_..."
Response 201

Comment added