Working with Support Tickets
The Tickets API lets your application open, track, and resolve support cases tied to a company's account and shipments — lost packages, damage claims, overweight disputes, carrier issues, credit line requests, and more. It is part of the Queries API and is the same engine that powers the ticket center in the Envia dashboard.
A ticket is a conversation with a lifecycle. Each ticket has:
- A type (
ticket_type_id) — what the case is about. - A status (
ticket_status_id) — where it is in the workflow. - A message thread (comments) exchanged between the customer and the support agent.
- Variables — structured, type-specific form data (sent as a JSON string in
data). - File evidence — photos or documents attached to the case.
- Optional references — a shipment, a credit reference, or a warehouse package.
Environments & authentication
All ticket endpoints live under the Queries API host and require a Bearer token in the Authorization header. Every request is automatically scoped to the company that owns the token — you only ever see and act on your own company's tickets.
| Environment | Base URL |
|---|---|
| Sandbox | https://queries-test.envia.com/ |
| Production | https://queries.envia.com/ |
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer YOUR_API_TOKEN |
Content-Type | for POST/PUT | application/json (except file upload, which is multipart/form-data) |
Accept-Language | optional | Locale for translated fields (en, es, …). Defaults to the account locale. |
Tokens are issued per company. See API Token for how to obtain and rotate yours.
Endpoint overview
Open, update, and comment on tickets. POST /company/tickets · PUT /company/tickets/{id} · POST /company/tickets/{id}/comments
List and read tickets and their threads. GET /company/tickets · GET /company/tickets/{id} · GET /company/tickets/comments/{id}
List and attach file evidence. GET /company/evidences/{id} · PUT /company/attach/evidences/{id}
Rate a resolved ticket. POST /tickets/ratings/{id}
Types, filter options, and legal forms. GET /tickets/types · GET /tickets/filters-options · GET /tickets/legal-form/{type}/{country}
Ticket types
Every ticket has a ticket_type_id. Fetch the live catalog (with localized name and the UI rules for each type) from GET /tickets/types.
| ID | Type | Typical use |
|---|---|---|
| 1 | International | International shipment service request |
| 2 | Carrier | Carrier activation / carrier issue |
| 3 | Overweight | Dispute an overweight surcharge |
| 4 | Lost | Package lost in transit |
| 5 | Damaged | Package delivered damaged |
| 6 | Wrong address | Delivery to the wrong address |
| 7 | Refund | Refund request |
| 8 | Delay | Shipment delayed |
| 9 | Payment pending | Report a pending payment / receipt |
| 10 | PO box package pending | Warehouse package pending |
| 11 | PO box package delayed | Warehouse package delayed |
| 13 | Theft | Stolen package |
| 14 | Redirection | Redirect a shipment |
| 15 | LTL / FTL | Freight shipment request |
| 16 | Credit LTL / FTL | Freight on credit |
| 17 | Partners | Partner request |
| 18 | Service request info | Request to enable a service |
| 19 | Credit line | Credit line application (requires documents) |
| 20 | Delay payment | Request a payment deadline extension |
| 21 | Irregular package | Irregular package report |
| 23 | Service guarantee | Service guarantee claim |
| 24 | Partial refund | Partial refund request |
| 25 | Delivery attempt | Failed delivery attempt |
| 26 | Customs delay | Shipment held in customs |
The table above is a reference snapshot. Always read
GET /tickets/typesat runtime — types, availability, and their input rules are managed server-side and can change.
Ticket statuses
Each ticket carries a ticket_status_id. Statuses are grouped into the two tabs you see in the dashboard via the status_group query parameter.
| ID | Status | Group (status_group) | Meaning |
|---|---|---|---|
| 1 | Pending | active | New, awaiting agent review |
| 4 | Incomplete | active | Missing required data / files |
| 5 | Follow up | active | Needs agent action after a client reply |
| 6 | In review | active | Being reviewed by an agent |
| 2 | Accepted (Solved) | resolved | Resolved in the customer's favor |
| 3 | Declined (Closed) | resolved | Closed / rejected |
Lifecycle rules
- Manually created tickets start as Pending (1).
- Automatically generated tickets (from a shipment incidence) start as Incomplete (4) until the required data/files are provided.
- When a customer replies to a ticket that is In review (6), it moves to Follow up (5) so an agent re-engages.
- Accepted (2) and Declined (3) are terminal — no more comments or status changes are accepted.
- A ticket auto-closes to Accepted (2) when the related shipment is delivered (for delay/redirection cases).
Errors
| Status | When it happens |
|---|---|
400 / 422 | Invalid payload or query parameters (failed validation), or an already-rated ticket. |
401 | Missing or invalid Bearer token. |
409 | Duplicate open ticket for the same shipment + type. |
Validation errors return a Boom-style body:
{
"statusCode": 422,
"error": "Unprocessable Entity",
"message": "Invalid data."
}Typical ticket flow
- Create a ticket with
POST /company/tickets, choosing the righttype_idand referencing a shipment or credit when applicable. - Attach evidence with
PUT /company/attach/evidences/{ticket_id}if the case needs proof. - Poll
GET /company/tickets/{ticket_id}(or list withstatus_group) to watch the status advance. - Reply through
POST /company/tickets/{ticket_id}/commentswhenever the support agent asks for more information. - Resolve — the ticket reaches Accepted or Declined; optionally rate it with
POST /tickets/ratings/{ticket_id}.
Need Help?Building against the Tickets API and something isn't behaving as expected?
Our support team is ready to help 🚀Create a support ticket here and we'll guide you through setup and troubleshooting.
