Note: The endpoints listed on this page are for the legacy CSAT feature. We recommend you use survey responses for more accurate and relevant feedback. For more information, see Survey responses, Survey offered event, and Survey response submitted event. See also Setting up the CSAT survey. If you are using the legacy CSAT, you must deactivate legacy CSAT and manually deactivate any custom CSAT automations and triggers before you can use survey responses. You can have only one CSAT option activated at a time.

If you have enabled satisfaction ratings for your account, this endpoint allows you to quickly retrieve all ratings.

It supports cursor pagination and offset pagination when paginating through results. See Pagination.

JSON format

Satisfaction Ratings are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
assignee_idintegertruetrueThe id of agent assigned to at the time of rating
commentstringfalsefalseThe comment received with this rating, if available
created_atstringtruefalseThe time the satisfaction rating got created
group_idintegertruetrueThe id of group assigned to at the time of rating
idintegertruefalseAutomatically assigned upon creation
reasonstringfalsefalseThe reason for a bad rating given by the requester in a follow-up question. Satisfaction reasons must be enabled
reason_codeintegerfalsefalseThe default reasons the user can select from a list menu for giving a negative rating. See Reason codes in the Satisfaction Reasons API. Can only be set on ratings with a score of "bad". Responses don't include this property
reason_idintegerfalsefalseid for the reason the user gave a negative rating. Can only be set on ratings with a score of "bad". To get a descriptive value for the id, use the Show Reason for Satisfaction Rating endpoint
requester_idintegertruetrueThe id of ticket requester submitting the rating
scorestringfalsetrueThe rating "offered", "unoffered", "good" or "bad"
ticket_idintegertruetrueThe id of ticket being rated
updated_atstringtruefalseThe time the satisfaction rating got updated
urlstringtruefalseThe API url of this rating

Example

{  "assignee_id": 135,  "created_at": "2011-07-20T22:55:29Z",  "group_id": 44,  "id": 35436,  "requester_id": 7881,  "score": "good",  "ticket_id": 208,  "updated_at": "2011-07-20T22:55:29Z",  "url": "https://company.zendesk.com/api/v2/satisfaction_ratings/62.json"}

List Satisfaction Ratings

  • GET /api/v2/satisfaction_ratings

Allowed For

  • Admins

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

See Pagination.

Filters

ParameterValue
scoreoffered, unoffered, received, received_with_comment, received_without_comment,
good, good_with_comment, good_without_comment,
bad, bad_with_comment, bad_without_comment
start_timeTime of the oldest satisfaction rating, as a Unix epoch time
end_timeTime of the most recent satisfaction rating, as a Unix epoch time

If you specify an unqualified score such as good, the results include all the records with and without comments.

Examples:

  • /api/v2/satisfaction_ratings.json?score=bad
  • /api/v2/satisfaction_ratings.json?score=bad&start_time=1498151194
  • /api/v2/satisfaction_ratings.json?start_time=1340384793&end_time=1371920793

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/satisfaction_ratings.json \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/satisfaction_ratings"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/satisfaction_ratings")		.newBuilder();String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/satisfaction_ratings',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/satisfaction_ratings"headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"GET",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/satisfaction_ratings")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "satisfaction_ratings": [    {      "assignee_id": 135,      "comment": "Awesome support!",      "created_at": "2011-07-20T22:55:29Z",      "group_id": 44,      "id": 35436,      "requester_id": 7881,      "score": "good",      "ticket_id": 208,      "updated_at": "2011-07-20T22:55:29Z",      "url": "https://example.zendesk.com/api/v2/satisfaction_ratings/35436.json"    },    {      "assignee_id": 136,      "comment": "Awesome support!",      "created_at": "2012-02-01T04:31:29Z",      "group_id": 44,      "id": 120447,      "requester_id": 7881,      "score": "good",      "ticket_id": 209,      "updated_at": "2012-02-02T10:32:59Z",      "url": "https://example.zendesk.com/api/v2/satisfaction_ratings/120447.json"    }  ]}

Count Satisfaction Ratings

  • GET /api/v2/satisfaction_ratings/count

Returns an approximate count of satisfaction ratings in the account. If the count exceeds 100,000, the count will return a cached result. This cached result will update every 24 hours.

The count[refreshed_at] property is a timestamp that indicates when the count was last updated.

Note: When the count exceeds 100,000, count[refreshed_at] may occasionally be null. This indicates that the count is being updated in the background, and count[value] is limited to 100,000 until the update is complete.

Allowed For

  • Admins

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/satisfaction_ratings/count.json \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/satisfaction_ratings/count"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/satisfaction_ratings/count")		.newBuilder();String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/satisfaction_ratings/count',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/satisfaction_ratings/count"headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"GET",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/satisfaction_ratings/count")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "count": {    "refreshed_at": "2020-04-06T02:18:17Z",    "value": 102  }}

Show Satisfaction Rating

  • GET /api/v2/satisfaction_ratings/{satisfaction_rating_id}

Returns a specific satisfaction rating. You can get the id from the List Satisfaction Ratings endpoint.

Allowed For

  • Admins

Parameters

NameTypeInRequiredDescription
satisfaction_rating_idintegerPathtrueThe id of the satisfaction rating to retrieve

Code Samples

curl
curl https://{subdomain}.zendesk.com/api/v2/satisfaction_ratings/{satisfaction_rating_id}.json \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/satisfaction_ratings/35436"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/satisfaction_ratings/35436")		.newBuilder();String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://example.zendesk.com/api/v2/satisfaction_ratings/35436',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/satisfaction_ratings/35436"headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"GET",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/satisfaction_ratings/35436")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "satisfaction_rating": [    {      "assignee_id": 135,      "comment": "Awesome support!",      "created_at": "2011-07-20T22:55:29Z",      "group_id": 44,      "id": 35436,      "requester_id": 7881,      "score": "good",      "ticket_id": 208,      "updated_at": "2011-07-20T22:55:29Z",      "url": "https://example.zendesk.com/api/v2/satisfaction_ratings/35436.json"    }  ]}

Create a Satisfaction Rating

  • POST /api/v2/tickets/{ticket_id}/satisfaction_rating

Creates a CSAT rating for a solved ticket, or for a ticket that was previously solved and then reopened.

Only the end user listed as the ticket requester can create a satisfaction rating for the ticket.

Allowed For

  • End user who requested the ticket

The end user must be a verified user.

Parameters

NameTypeInRequiredDescription
ticket_idintegerPathtrueThe id of the ticket

Code Samples

curl

Good rating

curl https://{subdomain}.zendesk.com/api/v2/tickets/{ticket_id}/satisfaction_rating.json \    -X POST -d '{"satisfaction_rating": {"score": "good", "comment": "Awesome support."}}' \    -v -u {email_address}/token:{api_token} -H "Content-Type: application/json"
curl

Bad rating

curl https://{subdomain}.zendesk.com/api/v2/tickets/{ticket_id}/satisfaction_rating.json \  -X POST -d '{"satisfaction_rating": {"score": "bad", "comment": "Needed more detail.", "reason_code":100}}' \  -v -u {email_address}/token:{api_token} -H "Content-Type: application/json"
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://example.zendesk.com/api/v2/tickets/35436/satisfaction_rating"	method := "POST"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://example.zendesk.com/api/v2/tickets/35436/satisfaction_rating")		.newBuilder();RequestBody body = RequestBody.create(MediaType.parse("application/json"),		"""""");String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("POST", body)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'POST',  url: 'https://example.zendesk.com/api/v2/tickets/35436/satisfaction_rating',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://example.zendesk.com/api/v2/tickets/35436/satisfaction_rating"headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"POST",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://example.zendesk.com/api/v2/tickets/35436/satisfaction_rating")request = Net::HTTP::Post.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "satisfaction_rating": [    {      "assignee_id": 135,      "comment": "Awesome support!",      "created_at": "2011-07-20T22:55:29Z",      "group_id": 44,      "id": 35436,      "requester_id": 7881,      "score": "good",      "ticket_id": 208,      "updated_at": "2011-07-20T22:55:29Z",      "url": "https://example.zendesk.com/api/v2/satisfaction_ratings/35436.json"    }  ]}