These endpoints read tickets and their comment threads. All require a Bearer token (see Tickets Overview).
List tickets
GET /company/tickets
Returns a paginated, enriched list of the company's tickets, plus total_rows and per-tab counts. The counts always reflect the full filtered set (ignoring the status filter) so tab labels stay accurate when switching between Active and Resolved.
Query parameters
| Param | Type | Required | Description |
|---|---|---|---|
page | integer (≥ 1) | optional | Page number. |
limit | integer (≥ 1) | optional | Items per page. |
status_group | string — active | resolved | optional | Filter by tab. Ignored if status/ticket_status_id is present. |
status | integer | optional | Filter by a specific status ID (takes precedence over status_group). |
ticket_status_id | integer | optional | Alias filter by status ID (takes precedence over status_group). |
type | integer | optional | Filter by ticket type ID. |
ticket_type_id | integer | optional | Alias filter by ticket type ID. |
carrier_id | integer | optional | Filter by carrier. |
filter | string | optional | Search by exact ticket ID. |
tracking_number | string | optional | Filter by shipment tracking number. |
date_from | date YYYY-MM-DD | optional | Created-at lower bound (inclusive). |
date_to | date YYYY-MM-DD | optional | Created-at upper bound (inclusive). |
active | integer (0/1) | optional | Filter by whether the ticket type is active. |
getComments | boolean | optional | When true, includes the full allComments thread per ticket. |
curl --request GET \
--url 'https://queries.envia.com/company/tickets?status_group=active&limit=50&getComments=true' \
--header 'Authorization: Bearer YOUR_API_TOKEN'Response 200
{
"data": [
{
"id": 987654,
"company_id": 4321,
"ticket_type_id": 4,
"ticket_type_name": "lost",
"reference": "guide",
"ticket_status_id": 1,
"ticket_status_name": "pending",
"ticket_status_color": "#F5A623",
"ticket_class_name": "warning",
"shipment_id": 123456,
"tracking_number": "1Z999AA10123456784",
"carrier": "DHL",
"service": "Express",
"comments": "The package never arrived.",
"data": "{\"tracking_number\":\"1Z999AA10123456784\"}",
"file_quantity": 0,
"last_comment": {},
"allComments": [],
"created_at": "2026-07-08 10:15:00",
"utc_created_at": "2026-07-08 16:15:00",
"updated_at": "2026-07-08 10:15:00"
}
],
"total_rows": 1,
"counts": { "active": 1, "resolved": 0 }
}Selected response fields
| Field | Type | Description |
|---|---|---|
id | integer | Ticket ID. |
ticket_type_id / ticket_type_name | integer / string | Type of the ticket. |
reference | string | Reference kind required by the type (guide, credit, legal-credit, or empty). |
ticket_status_id / ticket_status_name | integer / string | Current status. |
ticket_status_color / ticket_class_name | string | Suggested badge color / CSS variant. |
shipment_id / tracking_number | integer / string | Linked shipment, if any. |
carrier / service | string | Carrier and service description. |
data | string (JSON) | Ticket variables serialized as JSON. |
file_quantity | integer | Number of attached evidence files. |
last_comment | object | Most recent comment (or {}). |
allComments | array | Full thread — only when getComments=true. |
counts | object | { active, resolved } totals for tab labels. |
Get a single ticket
GET /company/tickets/{ticket_id}
Returns one ticket by ID, scoped to the company, using the same enriched shape as the list. Supports getComments to include the thread.
Path parameters
| Param | Type | Required | Description |
|---|---|---|---|
ticket_id | integer (≥ 1) | yes | The ticket ID. |
Query parameters
| Param | Type | Required | Description |
|---|---|---|---|
getComments | boolean | optional | Include the full comment thread. |
date_from | date YYYY-MM | optional | Optional created-at lower bound. |
date_to | date YYYY-MM | optional | Optional created-at upper bound. |
status_group | string — active | resolved | optional | Optional tab scoping. |
curl --request GET \
--url 'https://queries.envia.com/company/tickets/987654?getComments=true' \
--header 'Authorization: Bearer YOUR_API_TOKEN'Response 200 — same object shape as one item of List tickets.
Get ticket comments
GET /company/tickets/comments/{ticket_id}
Returns the paginated comment thread for a ticket. Admin author names are anonymized to first name + last initial (e.g. Maria G.).
Path parameters
| Param | Type | Required | Description |
|---|---|---|---|
ticket_id | integer (≥ 1) | yes | The ticket ID. |
Query parameters
| Param | Type | Required | Description |
|---|---|---|---|
page | integer (≥ 1) | optional | Page number. |
limit | integer (≥ 1) | optional | Items per page. |
curl --request GET \
--url 'https://queries.envia.com/company/tickets/comments/987654?limit=20' \
--header 'Authorization: Bearer YOUR_API_TOKEN'Response 200
{
"data": [
{
"id": 55,
"type": "admin",
"description": "We are reviewing your case.",
"status_id": 6,
"status_name": "in_review",
"created_by_name": "Maria G.",
"created_at": "2026-07-08 11:00:00",
"utc_created_at": "2026-07-08 17:00:00"
}
],
"total_rows": 1
}