curl --request PATCH \
--url https://api.yo-lead.com/v1/tickets/{ticketId}/assignee \
--header 'Content-Type: application/json' \
--header 'X-YoLead-Key: <api-key>' \
--header 'X-YoLead-Signature: <api-key>' \
--header 'X-YoLead-Timestamp: <api-key>' \
--data '
{
"newAssigneeId": "64f000000000000000000004"
}
'import requests
url = "https://api.yo-lead.com/v1/tickets/{ticketId}/assignee"
payload = { "newAssigneeId": "64f000000000000000000004" }
headers = {
"X-YoLead-Key": "<api-key>",
"X-YoLead-Timestamp": "<api-key>",
"X-YoLead-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-YoLead-Key': '<api-key>',
'X-YoLead-Timestamp': '<api-key>',
'X-YoLead-Signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({newAssigneeId: '64f000000000000000000004'})
};
fetch('https://api.yo-lead.com/v1/tickets/{ticketId}/assignee', 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.yo-lead.com/v1/tickets/{ticketId}/assignee",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'newAssigneeId' => '64f000000000000000000004'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-YoLead-Key: <api-key>",
"X-YoLead-Signature: <api-key>",
"X-YoLead-Timestamp: <api-key>"
],
]);
$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.yo-lead.com/v1/tickets/{ticketId}/assignee"
payload := strings.NewReader("{\n \"newAssigneeId\": \"64f000000000000000000004\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-YoLead-Key", "<api-key>")
req.Header.Add("X-YoLead-Timestamp", "<api-key>")
req.Header.Add("X-YoLead-Signature", "<api-key>")
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.patch("https://api.yo-lead.com/v1/tickets/{ticketId}/assignee")
.header("X-YoLead-Key", "<api-key>")
.header("X-YoLead-Timestamp", "<api-key>")
.header("X-YoLead-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"newAssigneeId\": \"64f000000000000000000004\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yo-lead.com/v1/tickets/{ticketId}/assignee")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-YoLead-Key"] = '<api-key>'
request["X-YoLead-Timestamp"] = '<api-key>'
request["X-YoLead-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"newAssigneeId\": \"64f000000000000000000004\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"ticketId": "64f000000000000000000003",
"chatId": "64f000000000000000000002",
"previousAssigneeId": "64f000000000000000000001",
"newAssigneeId": "64f000000000000000000004"
}
}Change ticket assignee
Changes the assignee of the current active ticket.
Required API key scope: read-write.
newAssigneeId must reference a different active employee with access to the ticket channel. The endpoint only works for the current ticket in the chat, and the ticket must already be active with an existing assignee.
curl --request PATCH \
--url https://api.yo-lead.com/v1/tickets/{ticketId}/assignee \
--header 'Content-Type: application/json' \
--header 'X-YoLead-Key: <api-key>' \
--header 'X-YoLead-Signature: <api-key>' \
--header 'X-YoLead-Timestamp: <api-key>' \
--data '
{
"newAssigneeId": "64f000000000000000000004"
}
'import requests
url = "https://api.yo-lead.com/v1/tickets/{ticketId}/assignee"
payload = { "newAssigneeId": "64f000000000000000000004" }
headers = {
"X-YoLead-Key": "<api-key>",
"X-YoLead-Timestamp": "<api-key>",
"X-YoLead-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-YoLead-Key': '<api-key>',
'X-YoLead-Timestamp': '<api-key>',
'X-YoLead-Signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({newAssigneeId: '64f000000000000000000004'})
};
fetch('https://api.yo-lead.com/v1/tickets/{ticketId}/assignee', 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.yo-lead.com/v1/tickets/{ticketId}/assignee",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'newAssigneeId' => '64f000000000000000000004'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-YoLead-Key: <api-key>",
"X-YoLead-Signature: <api-key>",
"X-YoLead-Timestamp: <api-key>"
],
]);
$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.yo-lead.com/v1/tickets/{ticketId}/assignee"
payload := strings.NewReader("{\n \"newAssigneeId\": \"64f000000000000000000004\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-YoLead-Key", "<api-key>")
req.Header.Add("X-YoLead-Timestamp", "<api-key>")
req.Header.Add("X-YoLead-Signature", "<api-key>")
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.patch("https://api.yo-lead.com/v1/tickets/{ticketId}/assignee")
.header("X-YoLead-Key", "<api-key>")
.header("X-YoLead-Timestamp", "<api-key>")
.header("X-YoLead-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"newAssigneeId\": \"64f000000000000000000004\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yo-lead.com/v1/tickets/{ticketId}/assignee")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-YoLead-Key"] = '<api-key>'
request["X-YoLead-Timestamp"] = '<api-key>'
request["X-YoLead-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"newAssigneeId\": \"64f000000000000000000004\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"ticketId": "64f000000000000000000003",
"chatId": "64f000000000000000000002",
"previousAssigneeId": "64f000000000000000000001",
"newAssigneeId": "64f000000000000000000004"
}
}Authorizations
Public API key generated in the YoLead UI.
Unix timestamp in milliseconds. Requests must be signed within a 5-minute window.
Hex HMAC-SHA256 signature over <timestamp>.<raw_body> using the API secret.
Path Parameters
Ticket id. MongoDB ObjectId represented as a 24-character hexadecimal string.
^[0-9a-fA-F]{24}$"64f000000000000000000001"
Body
Ticket assignee change.
A different active employee in the API key company who has access to the ticket channel.
^[0-9a-fA-F]{24}$"64f000000000000000000001"
Response
Ticket assignee changed.
Show child attributes
Show child attributes