Get all tickets
curl --request GET \
--url https://api.gleap.io/v3/tickets \
--header 'Authorization: Bearer <token>' \
--header 'project: <project>'import requests
url = "https://api.gleap.io/v3/tickets"
headers = {
"project": "<project>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {project: '<project>', Authorization: 'Bearer <token>'}
};
fetch('https://api.gleap.io/v3/tickets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gleap.io/v3/tickets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"project: <project>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gleap.io/v3/tickets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("project", "<project>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gleap.io/v3/tickets")
.header("project", "<project>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gleap.io/v3/tickets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["project"] = '<project>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"tickets": [
{
"_id": "507f1f77bcf86cd799439011",
"id": "507f1f77bcf86cd799439011",
"title": "Login button not working",
"formData": {
"description": "Users cannot log in when clicking the login button"
},
"type": "BUG",
"status": "OPEN",
"priority": "HIGH",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T11:45:00.000Z",
"processingUser": {
"_id": "507f1f77bcf86cd799439012",
"email": "support@example.com",
"firstName": "John",
"lastName": "Doe"
},
"session": {
"_id": "507f1f77bcf86cd799439013",
"email": "user@example.com"
},
"latestComment": {
"_id": "507f1f77bcf86cd799439014",
"data": {
"content": "Any update on this issue?"
}
}
}
],
"count": 1,
"totalCount": 42
}Ticket
Get all tickets
Get all tickets in a project with support for filtering, sorting, and pagination.
Filtering:
- Filter by type:
type=BUGortype=BUG,FEATURE_REQUEST - Filter by status:
status=OPEN - Filter by priority:
priority=HIGHorpriority=HIGH,MEDIUM - Filter by archived state: archived tickets are hidden by default; pass
ignoreArchived=trueto include them, orignoreArchived=true&archived=truefor archived tickets only - Filter by spam:
isSpam=false - Filter the archive by archive date:
startDate/endDate(ISO 8601) narrow the archive, spam and waiting-on-customer views to tickets archived within that range. Ignored on the non-archive views, wherearchivedAtis unset.
Sorting:
- Sort by creation date:
sort=-createdAt(newest first) orsort=createdAt(oldest first) - Sort by priority:
sort=priority(highest first: HIGH, MEDIUM, LOW) orsort=-priority(lowest first) - Sort by updated date:
sort=-updatedAt - Default sort (no
sortparam): most recent activity first (lastNotificationdescending) - Archived, spam and waiting-on-customer views always sort by
archivedAtdescending; asortparam is ignored there
Pagination:
- Limit results:
limit=20(default: 500, max: 500) - Skip results:
skip=0(for pagination:skip=(page-1)*limit)
Retention — read this before building an export:
type=BOTconversations (AI conversations that never reached a human) are closed and archived about 3 days after they are created, and permanently deleted 30 days after that. Roughly the last 33 days are available; older AI-only conversations no longer exist and cannot be exported or restored.- Every other ticket type is permanently deleted 365 days after it was archived, or after the project’s custom archive window if one is configured. Unarchived tickets are never deleted by retention.
- A conversation handed over to a human stops being
type=BOT(it becomesINQUIRYor the type the handover assigns) and from then on follows the longer window above. - Ticket history entries have their own 180-day window — see GET /tickets//history.
GET
/
tickets
Get all tickets
curl --request GET \
--url https://api.gleap.io/v3/tickets \
--header 'Authorization: Bearer <token>' \
--header 'project: <project>'import requests
url = "https://api.gleap.io/v3/tickets"
headers = {
"project": "<project>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {project: '<project>', Authorization: 'Bearer <token>'}
};
fetch('https://api.gleap.io/v3/tickets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gleap.io/v3/tickets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"project: <project>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gleap.io/v3/tickets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("project", "<project>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gleap.io/v3/tickets")
.header("project", "<project>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gleap.io/v3/tickets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["project"] = '<project>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"tickets": [
{
"_id": "507f1f77bcf86cd799439011",
"id": "507f1f77bcf86cd799439011",
"title": "Login button not working",
"formData": {
"description": "Users cannot log in when clicking the login button"
},
"type": "BUG",
"status": "OPEN",
"priority": "HIGH",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T11:45:00.000Z",
"processingUser": {
"_id": "507f1f77bcf86cd799439012",
"email": "support@example.com",
"firstName": "John",
"lastName": "Doe"
},
"session": {
"_id": "507f1f77bcf86cd799439013",
"email": "user@example.com"
},
"latestComment": {
"_id": "507f1f77bcf86cd799439014",
"data": {
"content": "Any update on this issue?"
}
}
}
],
"count": 1,
"totalCount": 42
}