Create Ticket
Create a new ticket.
curl --request POST \
--url https://public.api.serval.com/v2/tickets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"createdByUserId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"assignedToUserId": "<string>",
"parentTicketId": "<string>",
"channelSyncTargets": [
{
"email": {}
}
],
"aiActive": true,
"workflowRelationship": {
"workflowId": "<string>",
"initialInputData": {},
"allowAssigneeRetry": true,
"pollingIntervalMs": "<unknown>",
"timeoutMs": "<unknown>",
"autoSubmitInputs": true
},
"ticketRelationships": [
{
"ticketId": "<string>"
}
],
"requesterUserId": "<string>",
"dueDate": {
"year": 123,
"month": 123,
"day": 123
},
"waitUntil": "2023-11-07T05:31:56Z",
"nameTranslations": {},
"descriptionTranslations": {},
"ticketSubtype": "<string>"
}
'import requests
url = "https://public.api.serval.com/v2/tickets"
payload = {
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"createdByUserId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"assignedToUserId": "<string>",
"parentTicketId": "<string>",
"channelSyncTargets": [{ "email": {} }],
"aiActive": True,
"workflowRelationship": {
"workflowId": "<string>",
"initialInputData": {},
"allowAssigneeRetry": True,
"pollingIntervalMs": "<unknown>",
"timeoutMs": "<unknown>",
"autoSubmitInputs": True
},
"ticketRelationships": [{ "ticketId": "<string>" }],
"requesterUserId": "<string>",
"dueDate": {
"year": 123,
"month": 123,
"day": 123
},
"waitUntil": "2023-11-07T05:31:56Z",
"nameTranslations": {},
"descriptionTranslations": {},
"ticketSubtype": "<string>"
}
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({
teamId: '<string>',
name: '<string>',
description: '<string>',
createdByUserId: '<string>',
createdAt: '2023-11-07T05:31:56Z',
assignedToUserId: '<string>',
parentTicketId: '<string>',
channelSyncTargets: [{email: {}}],
aiActive: true,
workflowRelationship: {
workflowId: '<string>',
initialInputData: {},
allowAssigneeRetry: true,
pollingIntervalMs: '<unknown>',
timeoutMs: '<unknown>',
autoSubmitInputs: true
},
ticketRelationships: [{ticketId: '<string>'}],
requesterUserId: '<string>',
dueDate: {year: 123, month: 123, day: 123},
waitUntil: '2023-11-07T05:31:56Z',
nameTranslations: {},
descriptionTranslations: {},
ticketSubtype: '<string>'
})
};
fetch('https://public.api.serval.com/v2/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://public.api.serval.com/v2/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([
'teamId' => '<string>',
'name' => '<string>',
'description' => '<string>',
'createdByUserId' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'assignedToUserId' => '<string>',
'parentTicketId' => '<string>',
'channelSyncTargets' => [
[
'email' => [
]
]
],
'aiActive' => true,
'workflowRelationship' => [
'workflowId' => '<string>',
'initialInputData' => [
],
'allowAssigneeRetry' => true,
'pollingIntervalMs' => '<unknown>',
'timeoutMs' => '<unknown>',
'autoSubmitInputs' => true
],
'ticketRelationships' => [
[
'ticketId' => '<string>'
]
],
'requesterUserId' => '<string>',
'dueDate' => [
'year' => 123,
'month' => 123,
'day' => 123
],
'waitUntil' => '2023-11-07T05:31:56Z',
'nameTranslations' => [
],
'descriptionTranslations' => [
],
'ticketSubtype' => '<string>'
]),
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"
payload := strings.NewReader("{\n \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"createdByUserId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"assignedToUserId\": \"<string>\",\n \"parentTicketId\": \"<string>\",\n \"channelSyncTargets\": [\n {\n \"email\": {}\n }\n ],\n \"aiActive\": true,\n \"workflowRelationship\": {\n \"workflowId\": \"<string>\",\n \"initialInputData\": {},\n \"allowAssigneeRetry\": true,\n \"pollingIntervalMs\": \"<unknown>\",\n \"timeoutMs\": \"<unknown>\",\n \"autoSubmitInputs\": true\n },\n \"ticketRelationships\": [\n {\n \"ticketId\": \"<string>\"\n }\n ],\n \"requesterUserId\": \"<string>\",\n \"dueDate\": {\n \"year\": 123,\n \"month\": 123,\n \"day\": 123\n },\n \"waitUntil\": \"2023-11-07T05:31:56Z\",\n \"nameTranslations\": {},\n \"descriptionTranslations\": {},\n \"ticketSubtype\": \"<string>\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"createdByUserId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"assignedToUserId\": \"<string>\",\n \"parentTicketId\": \"<string>\",\n \"channelSyncTargets\": [\n {\n \"email\": {}\n }\n ],\n \"aiActive\": true,\n \"workflowRelationship\": {\n \"workflowId\": \"<string>\",\n \"initialInputData\": {},\n \"allowAssigneeRetry\": true,\n \"pollingIntervalMs\": \"<unknown>\",\n \"timeoutMs\": \"<unknown>\",\n \"autoSubmitInputs\": true\n },\n \"ticketRelationships\": [\n {\n \"ticketId\": \"<string>\"\n }\n ],\n \"requesterUserId\": \"<string>\",\n \"dueDate\": {\n \"year\": 123,\n \"month\": 123,\n \"day\": 123\n },\n \"waitUntil\": \"2023-11-07T05:31:56Z\",\n \"nameTranslations\": {},\n \"descriptionTranslations\": {},\n \"ticketSubtype\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/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 \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"createdByUserId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"assignedToUserId\": \"<string>\",\n \"parentTicketId\": \"<string>\",\n \"channelSyncTargets\": [\n {\n \"email\": {}\n }\n ],\n \"aiActive\": true,\n \"workflowRelationship\": {\n \"workflowId\": \"<string>\",\n \"initialInputData\": {},\n \"allowAssigneeRetry\": true,\n \"pollingIntervalMs\": \"<unknown>\",\n \"timeoutMs\": \"<unknown>\",\n \"autoSubmitInputs\": true\n },\n \"ticketRelationships\": [\n {\n \"ticketId\": \"<string>\"\n }\n ],\n \"requesterUserId\": \"<string>\",\n \"dueDate\": {\n \"year\": 123,\n \"month\": 123,\n \"day\": 123\n },\n \"waitUntil\": \"2023-11-07T05:31:56Z\",\n \"nameTranslations\": {},\n \"descriptionTranslations\": {},\n \"ticketSubtype\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"friendlyIdentifier": "<string>",
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"escalatedAt": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"assignedToUserId": "<string>",
"requesterUserId": "<string>",
"statusId": "<string>",
"priorityId": "<string>",
"slaStartedAt": "2023-11-07T05:31:56Z",
"slaBreachesAt": "2023-11-07T05:31:56Z",
"labelIds": [
"<string>"
],
"dueDate": {
"year": 123,
"month": 123,
"day": 123
},
"isOverdue": true,
"childTicketIds": [
"<string>"
],
"linkedTicketIds": [
"<string>"
],
"duplicateTicketIds": [
"<string>"
],
"dependsOnTicketIds": [
"<string>"
],
"parentTicketId": "<string>",
"conversationThreadTicketIds": [
"<string>"
],
"conversationThreadParentTicketId": "<string>",
"nameTranslations": {},
"descriptionTranslations": {},
"categoryOptionId": "<string>"
}
}{
"message": "<string>",
"detail": {
"type": "<string>",
"value": "<string>",
"debug": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
A timestamp in RFC 3339 format (e.g., "2025-01-15T01:30:15Z").
Optional. The ID of the parent ticket (this is a special relationship type)
Note that these are ADDITIONAL sync targets. There may be some "default" sync targets for the team (e.g. ServiceNow, JSM etc).
- Email
- Microsoft Teams Dm
- Slack Dm
Show child attributes
Show child attributes
Optional. Whether AI is active for this ticket. Defaults to false. When true, Serval's AI will respond to messages on this ticket. When false, AI will not respond even if the ticket is at the AI escalation level.
Optional. The type of ticket to create. Defaults to REQUEST. If parent_ticket_id is set, this must be TASK (or omitted, in which case TASK is used).
TICKET_TYPE_UNSPECIFIED, TICKET_TYPE_REQUEST, TICKET_TYPE_TASK, TICKET_TYPE_MAJOR_INCIDENT, TICKET_TYPE_CONVERSATION, TICKET_TYPE_JOURNEY, TICKET_TYPE_JOURNEY_CONVERSATION, TICKET_TYPE_INCIDENT, TICKET_TYPE_CHANGE, TICKET_TYPE_CUSTOM Optional. A workflow to associate with this ticket. The workflow will show a form to collect inputs, then run when the user fills the form.
Show child attributes
Show child attributes
Optional. Relationships to create with other tickets. For example, to indicate this ticket depends on another ticket.
Show child attributes
Show child attributes
Optional. The ID of the user this ticket is created on behalf of (the requester). Defaults to created_by_user_id if not provided. Use this when creating a ticket on behalf of someone else, e.g., when creating child tasks in a journey where the requester should be the journey's requester.
Optional. Due date (date only, no time component).
Show child attributes
Show child attributes
Optional. Timestamp until which this ticket is waiting. Workflow calls on this ticket will not run until this time has passed.
Per-language translations. Key = BCP 47 language code, value = translated string.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Optional. The subtype of the ticket (e.g. "normal", "standard", "emergency" for CHANGE tickets). Must correspond to a configured ticket model for the given team and type.
Response
Success
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://public.api.serval.com/v2/tickets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"createdByUserId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"assignedToUserId": "<string>",
"parentTicketId": "<string>",
"channelSyncTargets": [
{
"email": {}
}
],
"aiActive": true,
"workflowRelationship": {
"workflowId": "<string>",
"initialInputData": {},
"allowAssigneeRetry": true,
"pollingIntervalMs": "<unknown>",
"timeoutMs": "<unknown>",
"autoSubmitInputs": true
},
"ticketRelationships": [
{
"ticketId": "<string>"
}
],
"requesterUserId": "<string>",
"dueDate": {
"year": 123,
"month": 123,
"day": 123
},
"waitUntil": "2023-11-07T05:31:56Z",
"nameTranslations": {},
"descriptionTranslations": {},
"ticketSubtype": "<string>"
}
'import requests
url = "https://public.api.serval.com/v2/tickets"
payload = {
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"createdByUserId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"assignedToUserId": "<string>",
"parentTicketId": "<string>",
"channelSyncTargets": [{ "email": {} }],
"aiActive": True,
"workflowRelationship": {
"workflowId": "<string>",
"initialInputData": {},
"allowAssigneeRetry": True,
"pollingIntervalMs": "<unknown>",
"timeoutMs": "<unknown>",
"autoSubmitInputs": True
},
"ticketRelationships": [{ "ticketId": "<string>" }],
"requesterUserId": "<string>",
"dueDate": {
"year": 123,
"month": 123,
"day": 123
},
"waitUntil": "2023-11-07T05:31:56Z",
"nameTranslations": {},
"descriptionTranslations": {},
"ticketSubtype": "<string>"
}
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({
teamId: '<string>',
name: '<string>',
description: '<string>',
createdByUserId: '<string>',
createdAt: '2023-11-07T05:31:56Z',
assignedToUserId: '<string>',
parentTicketId: '<string>',
channelSyncTargets: [{email: {}}],
aiActive: true,
workflowRelationship: {
workflowId: '<string>',
initialInputData: {},
allowAssigneeRetry: true,
pollingIntervalMs: '<unknown>',
timeoutMs: '<unknown>',
autoSubmitInputs: true
},
ticketRelationships: [{ticketId: '<string>'}],
requesterUserId: '<string>',
dueDate: {year: 123, month: 123, day: 123},
waitUntil: '2023-11-07T05:31:56Z',
nameTranslations: {},
descriptionTranslations: {},
ticketSubtype: '<string>'
})
};
fetch('https://public.api.serval.com/v2/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://public.api.serval.com/v2/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([
'teamId' => '<string>',
'name' => '<string>',
'description' => '<string>',
'createdByUserId' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'assignedToUserId' => '<string>',
'parentTicketId' => '<string>',
'channelSyncTargets' => [
[
'email' => [
]
]
],
'aiActive' => true,
'workflowRelationship' => [
'workflowId' => '<string>',
'initialInputData' => [
],
'allowAssigneeRetry' => true,
'pollingIntervalMs' => '<unknown>',
'timeoutMs' => '<unknown>',
'autoSubmitInputs' => true
],
'ticketRelationships' => [
[
'ticketId' => '<string>'
]
],
'requesterUserId' => '<string>',
'dueDate' => [
'year' => 123,
'month' => 123,
'day' => 123
],
'waitUntil' => '2023-11-07T05:31:56Z',
'nameTranslations' => [
],
'descriptionTranslations' => [
],
'ticketSubtype' => '<string>'
]),
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"
payload := strings.NewReader("{\n \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"createdByUserId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"assignedToUserId\": \"<string>\",\n \"parentTicketId\": \"<string>\",\n \"channelSyncTargets\": [\n {\n \"email\": {}\n }\n ],\n \"aiActive\": true,\n \"workflowRelationship\": {\n \"workflowId\": \"<string>\",\n \"initialInputData\": {},\n \"allowAssigneeRetry\": true,\n \"pollingIntervalMs\": \"<unknown>\",\n \"timeoutMs\": \"<unknown>\",\n \"autoSubmitInputs\": true\n },\n \"ticketRelationships\": [\n {\n \"ticketId\": \"<string>\"\n }\n ],\n \"requesterUserId\": \"<string>\",\n \"dueDate\": {\n \"year\": 123,\n \"month\": 123,\n \"day\": 123\n },\n \"waitUntil\": \"2023-11-07T05:31:56Z\",\n \"nameTranslations\": {},\n \"descriptionTranslations\": {},\n \"ticketSubtype\": \"<string>\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"createdByUserId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"assignedToUserId\": \"<string>\",\n \"parentTicketId\": \"<string>\",\n \"channelSyncTargets\": [\n {\n \"email\": {}\n }\n ],\n \"aiActive\": true,\n \"workflowRelationship\": {\n \"workflowId\": \"<string>\",\n \"initialInputData\": {},\n \"allowAssigneeRetry\": true,\n \"pollingIntervalMs\": \"<unknown>\",\n \"timeoutMs\": \"<unknown>\",\n \"autoSubmitInputs\": true\n },\n \"ticketRelationships\": [\n {\n \"ticketId\": \"<string>\"\n }\n ],\n \"requesterUserId\": \"<string>\",\n \"dueDate\": {\n \"year\": 123,\n \"month\": 123,\n \"day\": 123\n },\n \"waitUntil\": \"2023-11-07T05:31:56Z\",\n \"nameTranslations\": {},\n \"descriptionTranslations\": {},\n \"ticketSubtype\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/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 \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"createdByUserId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"assignedToUserId\": \"<string>\",\n \"parentTicketId\": \"<string>\",\n \"channelSyncTargets\": [\n {\n \"email\": {}\n }\n ],\n \"aiActive\": true,\n \"workflowRelationship\": {\n \"workflowId\": \"<string>\",\n \"initialInputData\": {},\n \"allowAssigneeRetry\": true,\n \"pollingIntervalMs\": \"<unknown>\",\n \"timeoutMs\": \"<unknown>\",\n \"autoSubmitInputs\": true\n },\n \"ticketRelationships\": [\n {\n \"ticketId\": \"<string>\"\n }\n ],\n \"requesterUserId\": \"<string>\",\n \"dueDate\": {\n \"year\": 123,\n \"month\": 123,\n \"day\": 123\n },\n \"waitUntil\": \"2023-11-07T05:31:56Z\",\n \"nameTranslations\": {},\n \"descriptionTranslations\": {},\n \"ticketSubtype\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"friendlyIdentifier": "<string>",
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"escalatedAt": "2023-11-07T05:31:56Z",
"createdByUserId": "<string>",
"assignedToUserId": "<string>",
"requesterUserId": "<string>",
"statusId": "<string>",
"priorityId": "<string>",
"slaStartedAt": "2023-11-07T05:31:56Z",
"slaBreachesAt": "2023-11-07T05:31:56Z",
"labelIds": [
"<string>"
],
"dueDate": {
"year": 123,
"month": 123,
"day": 123
},
"isOverdue": true,
"childTicketIds": [
"<string>"
],
"linkedTicketIds": [
"<string>"
],
"duplicateTicketIds": [
"<string>"
],
"dependsOnTicketIds": [
"<string>"
],
"parentTicketId": "<string>",
"conversationThreadTicketIds": [
"<string>"
],
"conversationThreadParentTicketId": "<string>",
"nameTranslations": {},
"descriptionTranslations": {},
"categoryOptionId": "<string>"
}
}{
"message": "<string>",
"detail": {
"type": "<string>",
"value": "<string>",
"debug": {}
}
}
