Update a CSAT rule
curl --request PATCH \
--url https://platform.thena.ai/v1/csat/rules/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "High Priority Ticket Survey",
"description": "Sends CSAT surveys to customers with high priority tickets",
"isActive": true,
"allFilters": {
"ticket": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"account": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"contact": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
}
},
"anyFilters": {
"ticket": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"account": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"contact": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
}
},
"priority": 1
}
'import requests
url = "https://platform.thena.ai/v1/csat/rules/{id}"
payload = {
"name": "High Priority Ticket Survey",
"description": "Sends CSAT surveys to customers with high priority tickets",
"isActive": True,
"allFilters": {
"ticket": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"account": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"contact": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
}
},
"anyFilters": {
"ticket": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"account": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"contact": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
}
},
"priority": 1
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'High Priority Ticket Survey',
description: 'Sends CSAT surveys to customers with high priority tickets',
isActive: true,
allFilters: {
ticket: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
},
account: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
},
contact: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
}
},
anyFilters: {
ticket: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
},
account: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
},
contact: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
}
},
priority: 1
})
};
fetch('https://platform.thena.ai/v1/csat/rules/{id}', 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://platform.thena.ai/v1/csat/rules/{id}",
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([
'name' => 'High Priority Ticket Survey',
'description' => 'Sends CSAT surveys to customers with high priority tickets',
'isActive' => true,
'allFilters' => [
'ticket' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
],
'account' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
],
'contact' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
]
],
'anyFilters' => [
'ticket' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
],
'account' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
],
'contact' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
]
],
'priority' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://platform.thena.ai/v1/csat/rules/{id}"
payload := strings.NewReader("{\n \"name\": \"High Priority Ticket Survey\",\n \"description\": \"Sends CSAT surveys to customers with high priority tickets\",\n \"isActive\": true,\n \"allFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"anyFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"priority\": 1\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<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://platform.thena.ai/v1/csat/rules/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High Priority Ticket Survey\",\n \"description\": \"Sends CSAT surveys to customers with high priority tickets\",\n \"isActive\": true,\n \"allFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"anyFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"priority\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.thena.ai/v1/csat/rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"High Priority Ticket Survey\",\n \"description\": \"Sends CSAT surveys to customers with high priority tickets\",\n \"isActive\": true,\n \"allFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"anyFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"priority\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"ok": true,
"data": {
"id": "e4d2a5b1-9c3f-4c8d-b1a2-3e4f5a6b7c8d",
"name": "Updated High Priority Ticket Survey",
"description": "Updated description for high priority ticket surveys",
"isActive": false,
"priority": 10,
"allFilters": {
"ticket": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "closed"
}
],
"customFields": []
},
"account": {
"standardFields": [],
"customFields": []
},
"contact": {
"standardFields": [],
"customFields": []
}
},
"anyFilters": {
"ticket": {
"standardFields": [
{
"field": "priority",
"operator": "=",
"value": "high"
}
],
"customFields": []
},
"account": {
"standardFields": [],
"customFields": []
},
"contact": {
"standardFields": [],
"customFields": []
}
},
"triggerConfig": {
"enabled": true,
"deliveryChannel": "email",
"delayInMinutes": 5
},
"feedbackConfig": {
"enabled": true,
"feedbackType": "thumbs",
"includeCommentField": false,
"brandingColor": "#dc2626"
},
"createdAt": "2023-08-01T12:00:00Z",
"updatedAt": "2023-08-02T14:30:00Z"
}
},
"status": true,
"message": "CSAT rule updated successfully",
"timestamp": "2025-07-15T11:38:09.817Z"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Unauthorized",
"error": "Unauthorized"
}{
"statusCode": 403,
"message": "Forbidden",
"error": "Forbidden"
}{
"statusCode": 404,
"message": "CSAT rule with ID rule123 not found",
"error": "Not Found"
}{
"statusCode": 500,
"message": "Internal Server Error",
"error": "Internal Server Error"
}{
"statusCode": 503,
"message": "Service Unavailable",
"error": "Service Unavailable"
}CSAT
Update a CSAT rule
PATCH
/
v1
/
csat
/
rules
/
{id}
Update a CSAT rule
curl --request PATCH \
--url https://platform.thena.ai/v1/csat/rules/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "High Priority Ticket Survey",
"description": "Sends CSAT surveys to customers with high priority tickets",
"isActive": true,
"allFilters": {
"ticket": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"account": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"contact": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
}
},
"anyFilters": {
"ticket": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"account": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"contact": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
}
},
"priority": 1
}
'import requests
url = "https://platform.thena.ai/v1/csat/rules/{id}"
payload = {
"name": "High Priority Ticket Survey",
"description": "Sends CSAT surveys to customers with high priority tickets",
"isActive": True,
"allFilters": {
"ticket": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"account": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"contact": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
}
},
"anyFilters": {
"ticket": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"account": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
},
"contact": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "open"
}
],
"customFields": [
{
"field": "custom_CFLLXQWWY4Z",
"customFieldId": "CFLLXQWWY4Z",
"operator": "=",
"value": "Value"
}
]
}
},
"priority": 1
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'High Priority Ticket Survey',
description: 'Sends CSAT surveys to customers with high priority tickets',
isActive: true,
allFilters: {
ticket: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
},
account: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
},
contact: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
}
},
anyFilters: {
ticket: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
},
account: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
},
contact: {
standardFields: [{field: 'status', operator: '=', value: 'open'}],
customFields: [
{
field: 'custom_CFLLXQWWY4Z',
customFieldId: 'CFLLXQWWY4Z',
operator: '=',
value: 'Value'
}
]
}
},
priority: 1
})
};
fetch('https://platform.thena.ai/v1/csat/rules/{id}', 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://platform.thena.ai/v1/csat/rules/{id}",
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([
'name' => 'High Priority Ticket Survey',
'description' => 'Sends CSAT surveys to customers with high priority tickets',
'isActive' => true,
'allFilters' => [
'ticket' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
],
'account' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
],
'contact' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
]
],
'anyFilters' => [
'ticket' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
],
'account' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
],
'contact' => [
'standardFields' => [
[
'field' => 'status',
'operator' => '=',
'value' => 'open'
]
],
'customFields' => [
[
'field' => 'custom_CFLLXQWWY4Z',
'customFieldId' => 'CFLLXQWWY4Z',
'operator' => '=',
'value' => 'Value'
]
]
]
],
'priority' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://platform.thena.ai/v1/csat/rules/{id}"
payload := strings.NewReader("{\n \"name\": \"High Priority Ticket Survey\",\n \"description\": \"Sends CSAT surveys to customers with high priority tickets\",\n \"isActive\": true,\n \"allFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"anyFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"priority\": 1\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<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://platform.thena.ai/v1/csat/rules/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High Priority Ticket Survey\",\n \"description\": \"Sends CSAT surveys to customers with high priority tickets\",\n \"isActive\": true,\n \"allFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"anyFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"priority\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.thena.ai/v1/csat/rules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"High Priority Ticket Survey\",\n \"description\": \"Sends CSAT surveys to customers with high priority tickets\",\n \"isActive\": true,\n \"allFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"anyFilters\": {\n \"ticket\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"account\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n },\n \"contact\": {\n \"standardFields\": [\n {\n \"field\": \"status\",\n \"operator\": \"=\",\n \"value\": \"open\"\n }\n ],\n \"customFields\": [\n {\n \"field\": \"custom_CFLLXQWWY4Z\",\n \"customFieldId\": \"CFLLXQWWY4Z\",\n \"operator\": \"=\",\n \"value\": \"Value\"\n }\n ]\n }\n },\n \"priority\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"ok": true,
"data": {
"id": "e4d2a5b1-9c3f-4c8d-b1a2-3e4f5a6b7c8d",
"name": "Updated High Priority Ticket Survey",
"description": "Updated description for high priority ticket surveys",
"isActive": false,
"priority": 10,
"allFilters": {
"ticket": {
"standardFields": [
{
"field": "status",
"operator": "=",
"value": "closed"
}
],
"customFields": []
},
"account": {
"standardFields": [],
"customFields": []
},
"contact": {
"standardFields": [],
"customFields": []
}
},
"anyFilters": {
"ticket": {
"standardFields": [
{
"field": "priority",
"operator": "=",
"value": "high"
}
],
"customFields": []
},
"account": {
"standardFields": [],
"customFields": []
},
"contact": {
"standardFields": [],
"customFields": []
}
},
"triggerConfig": {
"enabled": true,
"deliveryChannel": "email",
"delayInMinutes": 5
},
"feedbackConfig": {
"enabled": true,
"feedbackType": "thumbs",
"includeCommentField": false,
"brandingColor": "#dc2626"
},
"createdAt": "2023-08-01T12:00:00Z",
"updatedAt": "2023-08-02T14:30:00Z"
}
},
"status": true,
"message": "CSAT rule updated successfully",
"timestamp": "2025-07-15T11:38:09.817Z"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Unauthorized",
"error": "Unauthorized"
}{
"statusCode": 403,
"message": "Forbidden",
"error": "Forbidden"
}{
"statusCode": 404,
"message": "CSAT rule with ID rule123 not found",
"error": "Not Found"
}{
"statusCode": 500,
"message": "Internal Server Error",
"error": "Internal Server Error"
}{
"statusCode": 503,
"message": "Service Unavailable",
"error": "Service Unavailable"
}Authorizations
Enter your API key
Path Parameters
Body
application/json
Name of the CSAT rule
Example:
"High Priority Ticket Survey"
Description of the CSAT rule
Example:
"Sends CSAT surveys to customers with high priority tickets"
Whether the rule is active
Example:
true
Filters where ALL conditions must be met
Show child attributes
Show child attributes
Filters where ANY condition can be met
Show child attributes
Show child attributes
Configuration for when and how the CSAT survey is triggered
Show child attributes
Show child attributes
Configuration for the CSAT survey appearance and behavior
Show child attributes
Show child attributes
Priority of the CSAT rule
Example:
1
Response
Success - CSAT rule updated successfully
⌘I