Create a new ticket with an optional initial message
curl --request POST \
--url https://api.gleap.io/v3/tickets/compose \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'project: <project>' \
--data '
{
"type": "<string>",
"title": "<string>",
"message": "<string>",
"priority": "<string>",
"status": "<string>",
"processingUser": "<string>",
"processingTeam": "<string>",
"tags": [
"<string>"
],
"session": "<string>",
"email": "<string>",
"formData": "<unknown>",
"preventAutoReply": true,
"pipelineEntry": "<string>"
}
'import requests
url = "https://api.gleap.io/v3/tickets/compose"
payload = {
"type": "<string>",
"title": "<string>",
"message": "<string>",
"priority": "<string>",
"status": "<string>",
"processingUser": "<string>",
"processingTeam": "<string>",
"tags": ["<string>"],
"session": "<string>",
"email": "<string>",
"formData": "<unknown>",
"preventAutoReply": True,
"pipelineEntry": "<string>"
}
headers = {
"project": "<project>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
project: '<project>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: '<string>',
title: '<string>',
message: '<string>',
priority: '<string>',
status: '<string>',
processingUser: '<string>',
processingTeam: '<string>',
tags: ['<string>'],
session: '<string>',
email: '<string>',
formData: '<unknown>',
preventAutoReply: true,
pipelineEntry: '<string>'
})
};
fetch('https://api.gleap.io/v3/tickets/compose', 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/compose",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'title' => '<string>',
'message' => '<string>',
'priority' => '<string>',
'status' => '<string>',
'processingUser' => '<string>',
'processingTeam' => '<string>',
'tags' => [
'<string>'
],
'session' => '<string>',
'email' => '<string>',
'formData' => '<unknown>',
'preventAutoReply' => true,
'pipelineEntry' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gleap.io/v3/tickets/compose"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"priority\": \"<string>\",\n \"status\": \"<string>\",\n \"processingUser\": \"<string>\",\n \"processingTeam\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session\": \"<string>\",\n \"email\": \"<string>\",\n \"formData\": \"<unknown>\",\n \"preventAutoReply\": true,\n \"pipelineEntry\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("project", "<project>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gleap.io/v3/tickets/compose")
.header("project", "<project>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"priority\": \"<string>\",\n \"status\": \"<string>\",\n \"processingUser\": \"<string>\",\n \"processingTeam\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session\": \"<string>\",\n \"email\": \"<string>\",\n \"formData\": \"<unknown>\",\n \"preventAutoReply\": true,\n \"pipelineEntry\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gleap.io/v3/tickets/compose")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["project"] = '<project>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"priority\": \"<string>\",\n \"status\": \"<string>\",\n \"processingUser\": \"<string>\",\n \"processingTeam\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session\": \"<string>\",\n \"email\": \"<string>\",\n \"formData\": \"<unknown>\",\n \"preventAutoReply\": true,\n \"pipelineEntry\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyTicket
Create a new ticket with an optional initial message
Create a new ticket and optionally post an initial message in a single request. Provide either a session (contact ID) or email to associate the ticket with a contact. If an email is provided and no contact exists, one will be created automatically.
POST
/
tickets
/
compose
Create a new ticket with an optional initial message
curl --request POST \
--url https://api.gleap.io/v3/tickets/compose \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'project: <project>' \
--data '
{
"type": "<string>",
"title": "<string>",
"message": "<string>",
"priority": "<string>",
"status": "<string>",
"processingUser": "<string>",
"processingTeam": "<string>",
"tags": [
"<string>"
],
"session": "<string>",
"email": "<string>",
"formData": "<unknown>",
"preventAutoReply": true,
"pipelineEntry": "<string>"
}
'import requests
url = "https://api.gleap.io/v3/tickets/compose"
payload = {
"type": "<string>",
"title": "<string>",
"message": "<string>",
"priority": "<string>",
"status": "<string>",
"processingUser": "<string>",
"processingTeam": "<string>",
"tags": ["<string>"],
"session": "<string>",
"email": "<string>",
"formData": "<unknown>",
"preventAutoReply": True,
"pipelineEntry": "<string>"
}
headers = {
"project": "<project>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
project: '<project>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: '<string>',
title: '<string>',
message: '<string>',
priority: '<string>',
status: '<string>',
processingUser: '<string>',
processingTeam: '<string>',
tags: ['<string>'],
session: '<string>',
email: '<string>',
formData: '<unknown>',
preventAutoReply: true,
pipelineEntry: '<string>'
})
};
fetch('https://api.gleap.io/v3/tickets/compose', 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/compose",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'title' => '<string>',
'message' => '<string>',
'priority' => '<string>',
'status' => '<string>',
'processingUser' => '<string>',
'processingTeam' => '<string>',
'tags' => [
'<string>'
],
'session' => '<string>',
'email' => '<string>',
'formData' => '<unknown>',
'preventAutoReply' => true,
'pipelineEntry' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gleap.io/v3/tickets/compose"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"priority\": \"<string>\",\n \"status\": \"<string>\",\n \"processingUser\": \"<string>\",\n \"processingTeam\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session\": \"<string>\",\n \"email\": \"<string>\",\n \"formData\": \"<unknown>\",\n \"preventAutoReply\": true,\n \"pipelineEntry\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("project", "<project>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gleap.io/v3/tickets/compose")
.header("project", "<project>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"priority\": \"<string>\",\n \"status\": \"<string>\",\n \"processingUser\": \"<string>\",\n \"processingTeam\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session\": \"<string>\",\n \"email\": \"<string>\",\n \"formData\": \"<unknown>\",\n \"preventAutoReply\": true,\n \"pipelineEntry\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gleap.io/v3/tickets/compose")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["project"] = '<project>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"message\": \"<string>\",\n \"priority\": \"<string>\",\n \"status\": \"<string>\",\n \"processingUser\": \"<string>\",\n \"processingTeam\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"session\": \"<string>\",\n \"email\": \"<string>\",\n \"formData\": \"<unknown>\",\n \"preventAutoReply\": true,\n \"pipelineEntry\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
CRM pipeline entry to link this ticket to (see CreateTicketDto). The pipeline create-ticket automation passes the entry that triggered it.
Response
200 - application/json
Ok
⌘I