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:

Name Type Read-only Mandatory Description
assignee_id integer true true The id of agent assigned to at the time of rating
comment string false false The comment received with this rating, if available
created_at string true false The time the satisfaction rating got created
group_id integer true true The id of group assigned to at the time of rating
id integer true false Automatically assigned upon creation
reason string false false The reason for a bad rating given by the requester in a follow-up question. Satisfaction reasons must be enabled
reason_code integer false false The 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".
requester_id integer true true The id of ticket requester submitting the rating
score string false true The rating "offered", "unoffered", "good" or "bad"
ticket_id integer true true The id of ticket being rated
updated_at string true false The time the satisfaction rating got updated
url string true false The 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

  • Agents

Filters

Parameter Value
score offered, unoffered, received, received_with_comment, received_without_comment,
good, good_with_comment, good_without_comment,
bad, bad_with_comment, bad_without_comment
start_time Time of the oldest satisfaction rating, as a Unix epoch time
end_time Time 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

Using curl

curl https://{subdomain}.zendesk.com/api/v2/satisfaction_ratings.json \  -v -u {email_address}:{password}

Example Response

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"    }  ]}

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

Name Type In Required Description
satisfaction_rating_id integer Path true The id of the satisfaction rating to retrieve

Using curl

curl https://{subdomain}.zendesk.com/api/v2/satisfaction_ratings/{satisfaction_rating_id}.json \  -v -u {email_address}:{password}

Example Response

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

Name Type In Required Description
ticket_id integer Path true The id of the ticket

Using 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}:{password} -H "Content-Type: application/json"

Using 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}:{password} -H "Content-Type: application/json"

Example Response

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"    }  ]}