Welcome to our new docs! Please keep in mind we are still working on making everything is as accurate as possible. Join us on discord and ask us questions if you are unsure.
DezerX Spartan Logo
Ticket

Get All Tickets

Retrieve a paginated list of all tickets with optional filtering by search term and status

GET
/api/application/tickets
AuthorizationBearer <token>

Bearer token authentication

In: header

Query Parameters

per_page?integer

Number of tickets per page

Default15
Range1 <= value <= 100
search?string

Search in ticket name, description, or user details

status?string

Filter by ticket status

Value in"open" | "closed" | "resolved" | "answered" | "awaiting"

Response Body

curl -X GET "https://api.example.com/api/application/api/application/tickets?per_page=15&search=string&status=open"
{
  "success": true,
  "data": {
    "current_page": 1,
    "first_page_url": "https://api.example.com/api/application/tickets?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://api.example.com/api/application/tickets?page=1",
    "links": [
      {
        "url": "string",
        "label": "string",
        "active": true
      }
    ],
    "next_page_url": null,
    "path": "https://api.example.com/api/application/tickets",
    "per_page": 15,
    "prev_page_url": null,
    "to": 1,
    "total": 1,
    "data": [
      {
        "id": 1,
        "name": "Account Access Issue",
        "description": "Cannot login to my account",
        "status": "open",
        "department": "Support",
        "related_service_id": null,
        "user_id": 5,
        "extra_user_ids": null,
        "created_at": "2024-01-15T10:30:00.000000Z",
        "updated_at": "2024-01-15T10:30:00.000000Z",
        "user_display_name": "John Doe",
        "user": {
          "id": 5,
          "name": "John Doe",
          "email": "user@example.com"
        },
        "messages": [
          {
            "id": 1,
            "ticket_id": 1,
            "user_id": 5,
            "message": "I'm having trouble with my account access",
            "is_staff": false,
            "attachments": null,
            "created_at": "2024-01-15T10:30:00.000000Z",
            "updated_at": "2024-01-15T10:30:00.000000Z",
            "user_display_name": "John Doe",
            "user": {
              "id": 5,
              "name": "John Doe",
              "email": "user@example.com"
            }
          }
        ]
      }
    ]
  }
}
{
  "error": "Unauthorized",
  "message": "Bearer token required"
}

{
  "error": "Forbidden",
  "message": "Insufficient permissions for this action"
}

{
  "success": false,
  "message": "Validation failed",
  "errors": {
    "name": [
      "The name field is required."
    ],
    "department": [
      "The selected department is invalid."
    ],
    "user_id": [
      "The selected user id is invalid."
    ],
    "status": [
      "The selected status is invalid."
    ],
    "message": [
      "The message field is required."
    ],
    "is_staff": [
      "The is staff field is required."
    ]
  }
}