List Tickets
Retrieve paginated list of tickets
Retrieves a paginated list of tickets with filtering and sorting.
Endpoint
GET https://api.ayra.ai/v1/ticketsAuthentication
Requires API key with tickets:read permission.
Query Parameters
Pagination:
page(integer) - Page number. Default: 1per_page(integer) - Items per page, 1-100. Default: 25Filtering:
status(string) - Filter by statuspriority(integer) - Filter by priority (1-4)category(string) - Filter by categoryassigned_to(string) - Filter by assigned usercontact_id(string) - Filter by contactcreated_after(string) - ISO 8601 timestampcreated_before(string) - ISO 8601 timestampdue_after(string) - ISO 8601 timestampdue_before(string) - ISO 8601 timestampsla_breach(boolean) - Filter tickets that missed SLAtags(string) - Comma-separated tag list (tickets must have all tags)search(string) - Search in subject and descriptionSorting:
sort_by(string) - Field to sort by. Values: created_at, updated_at, due_date, priority. Default: created_atsort_order(string) - Sort direction. Values: asc, desc. Default: descRequest Examples
Basic Request:
curl https://api.ayra.ai/v1/tickets \
-H "Authorization: Bearer sk_live_abc123xyz789"Open High Priority Tickets:
curl "https://api.ayra.ai/v1/tickets?status=open&priority=2&sort_by=due_date&sort_order=asc" \
-H "Authorization: Bearer sk_live_abc123xyz789"SLA Breaches:
curl "https://api.ayra.ai/v1/tickets?sla_breach=true&status=open" \
-H "Authorization: Bearer sk_live_abc123xyz789"Response
Success Response (200 OK):
{
"data": [
{
"id": "ticket_abc123",
"number": "TICK-1234",
"subject": "Duplicate billing charge needs refund",
"priority": 2,
"priority_label": "High",
"status": "in_progress",
"category": "billing",
"assigned_to": "user_jane_smith",
"assigned_name": "Jane Smith",
"tags": ["refund", "duplicate_charge"],
"due_date": "2025-01-16T17:00:00Z",
"created_at": "2025-01-15T14:30:00Z"
}
],
"meta": {
"total": 47,
"page": 1,
"per_page": 25,
"total_pages": 2
}
}Ready to transform your agency?
Start building with Ayra today. No credit card required.