Satisfaction Ratings

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

JSON Format

Name Type Read-only Mandatory Comment
id integer yes no Automatically assigned upon creation
url string yes no The API url of this rating
assignee_id integer yes yes The id of agent assigned to at the time of rating
group_id integer yes yes The id of group assigned to at the time of rating
requester_id integer yes yes The id of ticket requester submitting the rating
ticket_id integer yes yes The id of ticket being rated
score string yes yes The rating: "offered", "unoffered", "good" or "bad"
created_at date yes no The time the satisfaction rating got created
updated_at date yes no The time the satisfaction rating got updated
comment string yes no The comment received with this rating, if available
reason string yes no The reason for a bad rating given by the requester in a follow-up question. Satisfaction reasons must be enabled
Example
{
  "id":              35436,
  "url":             "https://company.zendesk.com/api/v2/satisfaction_ratings/62.json",
  "assignee_id":     135,
  "group_id":        44,
  "requester_id":    7881,
  "ticket_id":       208,
  "score":           "good",
  "updated_at":      "2011-07-20T22:55:29Z",
  "created_at":      "2011-07-20T22:55:29Z"
}

List Satisfaction Ratings

GET /api/v2/satisfaction_ratings.json

Allowed For:
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/satisfaction_ratings.json \
  -v -u {email_address}:{password}
Filters
Parameter Value
score 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
Example Response
Status: 200 OK

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

Show Satisfaction Rating

GET /api/v2/satisfaction_ratings/{id}.json

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

Allowed For:
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/satisfaction_ratings/{id}.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

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

Create a Satisfaction Rating

POST /api/v2/tickets/{ticket_id}/satisfaction_rating.json

Creates a CSAT rating for solved tickets, or for tickets that were previously solved and then reopened.

Allowed For:
  • End user who requested the ticket

The end user must be a verified user.

Available parameters
Name Type Required Comments
sort_order string no One of asc, desc. Defaults to asc
Using curl
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"
Example Response
Status: 200 OK

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