Ticket API
Create Ticket Message
Create a new message in a ticket. Set is_internal_note to post an internal note visible only to team members.
POST
/
v2
/
tickets
/
{ticket_id}
/
messages
Create Ticket Message
curl --request POST \
--url https://public.api.serval.com/v2/tickets/{ticket_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"authorUserId": "<string>",
"triggerHelpAgent": true,
"isInternalNote": true
}
'import requests
url = "https://public.api.serval.com/v2/tickets/{ticket_id}/messages"
payload = {
"message": "<string>",
"authorUserId": "<string>",
"triggerHelpAgent": True,
"isInternalNote": 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({
message: '<string>',
authorUserId: '<string>',
triggerHelpAgent: true,
isInternalNote: true
})
};
fetch('https://public.api.serval.com/v2/tickets/{ticket_id}/messages', 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://public.api.serval.com/v2/tickets/{ticket_id}/messages",
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([
'message' => '<string>',
'authorUserId' => '<string>',
'triggerHelpAgent' => true,
'isInternalNote' => 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://public.api.serval.com/v2/tickets/{ticket_id}/messages"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"authorUserId\": \"<string>\",\n \"triggerHelpAgent\": true,\n \"isInternalNote\": 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://public.api.serval.com/v2/tickets/{ticket_id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"authorUserId\": \"<string>\",\n \"triggerHelpAgent\": true,\n \"isInternalNote\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/tickets/{ticket_id}/messages")
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 \"message\": \"<string>\",\n \"authorUserId\": \"<string>\",\n \"triggerHelpAgent\": true,\n \"isInternalNote\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"messageId": "<string>"
}
}{
"message": "<string>",
"detail": {
"type": "<string>",
"value": "<string>",
"debug": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the ticket to add a message to.
Body
application/json
The content of the message.
The ID of the user who authored the message.
Optional. Whether to trigger the AI help agent workflow for this message. Defaults to true. Set to false to suppress the help agent (e.g. when syncing messages from an external system or posting automated replies).
Optional. When true, the message is created as an internal note, visible only to team members and never surfaced to the requester. Defaults to false.
Response
Success
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Create Ticket Message
curl --request POST \
--url https://public.api.serval.com/v2/tickets/{ticket_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>",
"authorUserId": "<string>",
"triggerHelpAgent": true,
"isInternalNote": true
}
'import requests
url = "https://public.api.serval.com/v2/tickets/{ticket_id}/messages"
payload = {
"message": "<string>",
"authorUserId": "<string>",
"triggerHelpAgent": True,
"isInternalNote": 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({
message: '<string>',
authorUserId: '<string>',
triggerHelpAgent: true,
isInternalNote: true
})
};
fetch('https://public.api.serval.com/v2/tickets/{ticket_id}/messages', 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://public.api.serval.com/v2/tickets/{ticket_id}/messages",
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([
'message' => '<string>',
'authorUserId' => '<string>',
'triggerHelpAgent' => true,
'isInternalNote' => 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://public.api.serval.com/v2/tickets/{ticket_id}/messages"
payload := strings.NewReader("{\n \"message\": \"<string>\",\n \"authorUserId\": \"<string>\",\n \"triggerHelpAgent\": true,\n \"isInternalNote\": 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://public.api.serval.com/v2/tickets/{ticket_id}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\",\n \"authorUserId\": \"<string>\",\n \"triggerHelpAgent\": true,\n \"isInternalNote\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/tickets/{ticket_id}/messages")
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 \"message\": \"<string>\",\n \"authorUserId\": \"<string>\",\n \"triggerHelpAgent\": true,\n \"isInternalNote\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"messageId": "<string>"
}
}{
"message": "<string>",
"detail": {
"type": "<string>",
"value": "<string>",
"debug": {}
}
}
