Create a ticket
curl --request POST \
--url https://api.usefrictionless.com/api/v1/tickets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer": {
"userId": "user_42",
"phone": "+2348012345678"
},
"subject": "Refund for order 381",
"description": "Charged twice on 3 November.",
"type": "Refund",
"priority": "high",
"status": "in_progress",
"dueAt": "2026-11-07T17:00:00Z",
"notifyCustomer": true
}
'import requests
url = "https://api.usefrictionless.com/api/v1/tickets"
payload = {
"customer": {
"userId": "user_42",
"phone": "+2348012345678"
},
"subject": "Refund for order 381",
"description": "Charged twice on 3 November.",
"type": "Refund",
"priority": "high",
"status": "in_progress",
"dueAt": "2026-11-07T17:00:00Z",
"notifyCustomer": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {userId: 'user_42', phone: '+2348012345678'},
subject: 'Refund for order 381',
description: 'Charged twice on 3 November.',
type: 'Refund',
priority: 'high',
status: 'in_progress',
dueAt: '2026-11-07T17:00:00Z',
notifyCustomer: true
})
};
fetch('https://api.usefrictionless.com/api/v1/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.usefrictionless.com/api/v1/tickets",
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([
'customer' => [
'userId' => 'user_42',
'phone' => '+2348012345678'
],
'subject' => 'Refund for order 381',
'description' => 'Charged twice on 3 November.',
'type' => 'Refund',
'priority' => 'high',
'status' => 'in_progress',
'dueAt' => '2026-11-07T17:00:00Z',
'notifyCustomer' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.usefrictionless.com/api/v1/tickets"
payload := strings.NewReader("{\n \"customer\": {\n \"userId\": \"user_42\",\n \"phone\": \"+2348012345678\"\n },\n \"subject\": \"Refund for order 381\",\n \"description\": \"Charged twice on 3 November.\",\n \"type\": \"Refund\",\n \"priority\": \"high\",\n \"status\": \"in_progress\",\n \"dueAt\": \"2026-11-07T17:00:00Z\",\n \"notifyCustomer\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.usefrictionless.com/api/v1/tickets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"userId\": \"user_42\",\n \"phone\": \"+2348012345678\"\n },\n \"subject\": \"Refund for order 381\",\n \"description\": \"Charged twice on 3 November.\",\n \"type\": \"Refund\",\n \"priority\": \"high\",\n \"status\": \"in_progress\",\n \"dueAt\": \"2026-11-07T17:00:00Z\",\n \"notifyCustomer\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usefrictionless.com/api/v1/tickets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"userId\": \"user_42\",\n \"phone\": \"+2348012345678\"\n },\n \"subject\": \"Refund for order 381\",\n \"description\": \"Charged twice on 3 November.\",\n \"type\": \"Refund\",\n \"priority\": \"high\",\n \"status\": \"in_progress\",\n \"dueAt\": \"2026-11-07T17:00:00Z\",\n \"notifyCustomer\": true\n}"
response = http.request(request)
puts response.read_body{
"ticket": {
"id": "NE-1042",
"ticketId": "c0a8f3e2-5b1d-4f7e-9a3c-1e2d3f4a5b6c",
"subject": "Refund for order 381",
"description": "<string>",
"type": "Refund",
"priority": "high",
"status": "in_progress",
"dueAt": "2023-11-07T05:31:56Z",
"resolvedAt": "2023-11-07T05:31:56Z",
"createdAt": "2026-11-04T09:12:00Z",
"updatedAt": "2026-11-05T10:00:00Z",
"notifyCustomer": true,
"customer": {
"name": "Ada Obi",
"channel": "whatsapp",
"phone": "+2348012345678",
"email": "<string>",
"userId": "user_42"
},
"owner": {
"name": "Kemi"
},
"chatUrl": "<string>",
"url": "https://usefrictionless.com/tickets/NE-1042"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Tickets
Create a ticket
Opens a ticket for a customer who has chatted with you, found by your userId (linked through the Context API) or their phone. It’s linked to their latest chat. Unless notifyCustomer is false, the customer is told in that chat, and your ticket webhook gets ticket.created.
POST
/
tickets
Create a ticket
curl --request POST \
--url https://api.usefrictionless.com/api/v1/tickets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer": {
"userId": "user_42",
"phone": "+2348012345678"
},
"subject": "Refund for order 381",
"description": "Charged twice on 3 November.",
"type": "Refund",
"priority": "high",
"status": "in_progress",
"dueAt": "2026-11-07T17:00:00Z",
"notifyCustomer": true
}
'import requests
url = "https://api.usefrictionless.com/api/v1/tickets"
payload = {
"customer": {
"userId": "user_42",
"phone": "+2348012345678"
},
"subject": "Refund for order 381",
"description": "Charged twice on 3 November.",
"type": "Refund",
"priority": "high",
"status": "in_progress",
"dueAt": "2026-11-07T17:00:00Z",
"notifyCustomer": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: {userId: 'user_42', phone: '+2348012345678'},
subject: 'Refund for order 381',
description: 'Charged twice on 3 November.',
type: 'Refund',
priority: 'high',
status: 'in_progress',
dueAt: '2026-11-07T17:00:00Z',
notifyCustomer: true
})
};
fetch('https://api.usefrictionless.com/api/v1/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.usefrictionless.com/api/v1/tickets",
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([
'customer' => [
'userId' => 'user_42',
'phone' => '+2348012345678'
],
'subject' => 'Refund for order 381',
'description' => 'Charged twice on 3 November.',
'type' => 'Refund',
'priority' => 'high',
'status' => 'in_progress',
'dueAt' => '2026-11-07T17:00:00Z',
'notifyCustomer' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.usefrictionless.com/api/v1/tickets"
payload := strings.NewReader("{\n \"customer\": {\n \"userId\": \"user_42\",\n \"phone\": \"+2348012345678\"\n },\n \"subject\": \"Refund for order 381\",\n \"description\": \"Charged twice on 3 November.\",\n \"type\": \"Refund\",\n \"priority\": \"high\",\n \"status\": \"in_progress\",\n \"dueAt\": \"2026-11-07T17:00:00Z\",\n \"notifyCustomer\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
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.usefrictionless.com/api/v1/tickets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customer\": {\n \"userId\": \"user_42\",\n \"phone\": \"+2348012345678\"\n },\n \"subject\": \"Refund for order 381\",\n \"description\": \"Charged twice on 3 November.\",\n \"type\": \"Refund\",\n \"priority\": \"high\",\n \"status\": \"in_progress\",\n \"dueAt\": \"2026-11-07T17:00:00Z\",\n \"notifyCustomer\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usefrictionless.com/api/v1/tickets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": {\n \"userId\": \"user_42\",\n \"phone\": \"+2348012345678\"\n },\n \"subject\": \"Refund for order 381\",\n \"description\": \"Charged twice on 3 November.\",\n \"type\": \"Refund\",\n \"priority\": \"high\",\n \"status\": \"in_progress\",\n \"dueAt\": \"2026-11-07T17:00:00Z\",\n \"notifyCustomer\": true\n}"
response = http.request(request)
puts response.read_body{
"ticket": {
"id": "NE-1042",
"ticketId": "c0a8f3e2-5b1d-4f7e-9a3c-1e2d3f4a5b6c",
"subject": "Refund for order 381",
"description": "<string>",
"type": "Refund",
"priority": "high",
"status": "in_progress",
"dueAt": "2023-11-07T05:31:56Z",
"resolvedAt": "2023-11-07T05:31:56Z",
"createdAt": "2026-11-04T09:12:00Z",
"updatedAt": "2026-11-05T10:00:00Z",
"notifyCustomer": true,
"customer": {
"name": "Ada Obi",
"channel": "whatsapp",
"phone": "+2348012345678",
"email": "<string>",
"userId": "user_42"
},
"owner": {
"name": "Kemi"
},
"chatUrl": "<string>",
"url": "https://usefrictionless.com/tickets/NE-1042"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Body
application/json

