PT EN

Pedidos de apoio

URL base: $CONSUMER_API

Listar pedidos de apoio

Registos

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.

Parâmetros

limitinteger · consulta · opcional

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

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Consumer tickets

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

Consumer tickets

Abrir um pedido de apoio

Registos

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.

Devolve

201 Ticket submitted

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

Ticket submitted

Obter um pedido de apoio

Registos

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.

Parâmetros

idstring · caminho · obrigatório

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

Devolve

200 Consumer ticket details

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

Consumer ticket details

Listar comentários de um pedido de apoio

Registos

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.

Parâmetros

idstring · caminho · obrigatório

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

limitinteger · consulta · opcional

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

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Comments

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

Comments

Comentar um pedido de apoio

Registos

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.

Parâmetros

idstring · caminho · obrigatório

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

Devolve

201 Comment added

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

Comment added