CSAT Survey Responses are represented as JSON objects with the following properties:
Name
Type
Read-only
Mandatory
Description
answers
array
false
true
An array of survey response answer objects. See Answer object
expires_at
string
false
true
The date and time of when the responder can no longer edit their survey response
id
string
false
true
Automatically assigned when the survey response is created
responder_id
integer
false
true
The id of the user the survey response belongs to
subject_zrns
array
false
true
An array of Zendesk resource names, such as ticket, request, and conversation (zen:ticket:123, zen:request:123, zen:conversation:4295a81b-ccdd-4998-88d9-0eff5e76dc44)
subjects
array
false
true
An array of structured objects which represent Zendesk resource names. See Subject object
survey
object
false
true
The survey object this survey response belongs to. See Survey object
Subject object
Name
Type
Optional
Nullable
Descriptions
id
string
false
false
The id of the subject this survey response belongs to
type
string
false
false
The type of the subject this survey response belongs to, such as ticket, request, conversation
zrn
string
false
false
The Zendesk resource name this survey response belongs to
Survey object
Name
Type
Optional
Nullable
Descriptions
id
string
false
false
The id of the survey this survey response belongs to. Automatically assigned when the survey is created
version
integer
false
false
The version of the survey upon which the survey response was based on. Every time the survey is updated, its version is auto-incremented
state
string
false
false
The survey state. The value has 2 options: enabled, disabled
Answer object
The answer object can be one of the following types:
An object containing a text string that isn't translated to the user's preferred language.
Name
Type
Optional
Nullable
Descriptions
type
string
false
false
Has the value static
value
string
false
false
A static (non-translatable) plain text content
Dynamic text content object
An object containing a dynamic content placeholder, which returns pre-defined content that is translated to a user's preferred language. See Dynamic content article.
Name
Type
Optional
Nullable
Descriptions
type
string
false
false
Has the value dynamic
key
string
false
false
The key of a dynamic content
value
string
false
false
The translated value of the dynamic content represented by its key for a given locale (determined by the locale path parameter)
Example
{"answers":[{"created_at":"2024-08-14T12:00:00.000Z","question":{"alias":"comment","headline":{"type":"static","value":"Anything else you would like to share about your experience?"},"id":"01GFYBENPDGN1R6NAA4WRDNVFR","type":"open_ended"},"type":"skipped","updated_at":"2024-08-14T12:00:00.000Z"}],"expires_at":"2024-08-14T12:00:00.000Z","id":"01J1WB51MG6HXTYWE6Q0C93RNW","responder_id":4398080151295,"subject_zrns":["zen:ticket:99"],"subjects":[{"id":"99","type":"ticket","zrn":"zen:ticket:99"}],"survey":{"id":"01J58KJ9RAE0D2EK7HRVM7Z8F2","state":"enabled","version":3}}
List Survey Responses
GET /api/v2/guide/survey_responses
Shows information about survey responses.
Allowed for
Admins
End users (responders only)
Parameters
Name
Type
In
Required
Description
filter
object
Query
false
[responder_ids] - A comma-separated list of survey responder ids [subject_zrns] - A comma-separated list of Zendesk resource names, such as ticket, request, and conversation (zen:ticket:123, zen:request:123, zen:conversation:4295a81b-ccdd-4998-88d9-0eff5e76dc44) [created_at_start] - Timestamp of the oldest survey response object in the filtered result set, as a Unix epoch time [created_at_end] - Timestamp of the most recent offered survey response object in the filtered result set, as a Unix epoch time
page
object
Query
false
A group of query parameters used for pagination. See Pagination
sort
string
Query
false
Options for sorting the result set by field and direction. Values with no prefix stand for ASC order. Values with the - prefix stand for DESC order. Allowed values are "id", or "-id".
Code Samples
Curl
curl --request GET https://your_account_subdomain.zendesk.com/api/v2/api/v2/guide/survey_responses?filter=&page=&sort=\--header "Content-Type: application/json"\-u {email_address}/token:{api_token}
// Status 200 OK{"meta":{"after_cursor":"MW","before_cursor":"MQ","has_more":false},"survey_responses":[{"answers":[{"created_at":"2024-08-14T12:00:00.000Z","question":{"id":"01J1WBE8QR0YQVE373K2JDJR0F","sub_type":"customer_satisfaction","type":"rating_scale_numeric"},"rating":1,"rating_category":"bad","type":"rating_scale","updated_at":"2024-08-14T12:00:00.000Z"},{"created_at":"2024-08-14T12:00:00.000Z","question":{"id":"01J1WBGX1BR4ECKTS87CRJTXSF","type":"closed_ended"},"selections":[{"option_id":"01J1WBKRG57E6M8C1145EXJ535","type":"predefined"}],"type":"closed_ended","updated_at":"2024-08-14T12:00:00.000Z"},{"created_at":"2024-08-14T12:00:00.000Z","question":{"id":"01J1WBNS76ZC4TTFWP9RCNQ1S8","type":"open_ended"},"type":"open_ended","updated_at":"2024-08-14T12:00:00.000Z","value":"I had to repeatedly answer the same questions."},{"created_at":"2024-08-14T12:00:00.000Z","question":{"id":"01J1WBSAZWVY2XR1EFZKS3CM13","type":"open_ended"},"type":"skipped","updated_at":"2024-08-14T12:00:00.000Z"}],"expires_at":"2024-08-14T12:00:00.000Z","id":"01J1WB51MG6HXTYWE6Q0C93RNW","responder_id":4398080151295,"subject_zrns":["zen:ticket:99"],"subjects":[{"id":"99","type":"ticket","zrn":"zen:ticket:99"}],"survey":{"id":"01J58KJ9RAE0D2EK7HRVM7Z8F2","state":"enabled","version":3}}]}
Create Survey Response
POST /api/v2/guide/survey_responses
Creates a new survey response to be offered to a user.
The links contained in the response contain an access_token query parameter that allows any user to submit a survey response on behalf of a responder. As an API user, make sure to restrict access to the links to prevent the impersonation of the survey responder.
// Status 200 OK{"survey_response":{"id":"01JPHVQK3JY2RQCPWGBVCN6Y11","links":{"rating_links":[{"emoji":{"type":"static","value":"😞"},"label":{"type":"static","value":"Very unsatisfied"},"rating":1,"url_path":"/hc/en-us/survey_responses/01JPHVQK3JY2RQCPWGBVCN6Y11?access_token=PMXFC68dx_aoluWHb_yCHPY_WQ&rating=1"},{"emoji":{"type":"static","value":"😀"},"label":{"type":"static","value":"Very satisfied"},"rating":5,"url_path":"/hc/en-us/survey_responses/01JPHVQK3JY2RQCPWGBVCN6Y11?access_token=PMXFC68dx_aoluWHb_yCHPY_WQ&rating=5"}],"type":"rating_link_emoji","url_path":"/hc/en-us/survey_responses/01JPHVQK3JY2RQCPWGBVCN6Y11?access_token=PMXFC68dx_aoluWHb_yCHPY_WQ"}}}
401 Unauthorized
// Status 401 Unauthorized{"errors":[{"code":"Unauthorized","status":"401","title":"Unauthorized to access the resource"}]}
403 Forbidden
// Status 403 Forbidden{"errors":[{"code":"Forbidden","status":"403","title":"Access to the resource is forbidden"}]}
404 Not Found
// Status 404 Not Found{"errors":[{"code":"NotFound","status":"404","title":"The survey is not found by provided id"}]}
409 Conflict
// Status 409 Conflict{"errors":[{"code":"Conflict","status":"409","title":"The survey associated with this survey response has been disabled"}]}
Submit Survey Response
POST /api/v2/guide/survey_responses/{id}
Submit the answers for the specified survey response.
This endpoint supports signed-in users only.
The links from the Create Survey Response endpoint can be shared with the responder, who can then submit a survey response without requiring authentication.
Allowed for
Admins (responders only)
Agents (responders only)
End users (responders only)
Parameters
Name
Type
In
Required
Description
id
string
Path
true
The survey response id
Example body
{"survey_response":{"answers":[{"question_id":"01J1WBE8QR0YQVE373K2JDJR0F","rating":1,"type":"rating_scale"},{"question_id":"01J1WBGX1BR4ECKTS87CRJTXSF","selections":[{"type":"pre_defined","value":"01JPHV4BSAH0V4552NM24FQ384"}],"type":"closed_ended"},{"question_id":"01J1WBNS76ZC4TTFWP9RCNQ1S8","type":"open_ended","value":"Some other feedback"},{"question_id":"01J1WBSAZWVY2XR1EFZKS3CM13","type":"skipped"}],"locale":"en-us"}}
var axios =require('axios');var data =JSON.stringify({"survey_response":{"answers":[{"question_id":"01J1WBE8QR0YQVE373K2JDJR0F","rating":1,"type":"rating_scale"},{"question_id":"01J1WBGX1BR4ECKTS87CRJTXSF","selections":[{"type":"pre_defined","value":"01JPHV4BSAH0V4552NM24FQ384"}],"type":"closed_ended"},{"question_id":"01J1WBNS76ZC4TTFWP9RCNQ1S8","type":"open_ended","value":"Some other feedback"},{"question_id":"01J1WBSAZWVY2XR1EFZKS3CM13","type":"skipped"}],"locale":"en-us"}});var config ={ method:'POST', url:'https://your_account_subdomain.zendesk.com/api/v2/api/v2/guide/survey_responses/01GFYBENPDGN1R6NAA4WRDNVFR', headers:{'Content-Type':'application/json','Authorization':'Basic <auth-value>',// Base64 encoded "{email_address}/token:{api_token}"}, data : data,};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
// Status 200 OK{"survey_response":{"answers":[{"created_at":"2024-08-14T12:00:00.000Z","question":{"id":"01J1WBE8QR0YQVE373K2JDJR0F","sub_type":"customer_satisfaction","type":"rating_scale_numeric"},"rating":1,"rating_category":"bad","type":"rating_scale","updated_at":"2024-08-14T12:00:00.000Z"},{"created_at":"2024-08-14T12:00:00.000Z","question":{"id":"01J1WBGX1BR4ECKTS87CRJTXSF","type":"closed_ended"},"selections":[{"option_id":"01J1WBKRG57E6M8C1145EXJ535","type":"predefined"}],"type":"closed_ended","updated_at":"2024-08-14T12:00:00.000Z"},{"created_at":"2024-08-14T12:00:00.000Z","question":{"id":"01J1WBNS76ZC4TTFWP9RCNQ1S8","type":"open_ended"},"type":"open_ended","updated_at":"2024-08-14T12:00:00.000Z","value":"I had to repeatedly answer the same questions."},{"created_at":"2024-08-14T12:00:00.000Z","question":{"id":"01J1WBSAZWVY2XR1EFZKS3CM13","type":"open_ended"},"type":"skipped","updated_at":"2024-08-14T12:00:00.000Z"}],"expires_at":"2024-08-14T12:00:00.000Z","id":"01GFYBENPDGN1R6NAA4WRDNVFR","responder_id":4398080151295,"subject_zrns":["zen:ticket:99"],"subjects":[{"id":"99","type":"ticket","zrn":"zen:ticket:99"}],"survey":{"id":"01J58KJ9RAE0D2EK7HRVM7Z8F2","state":"enabled","version":3}}}
401 Unauthorized
// Status 401 Unauthorized{"errors":[{"code":"Unauthorized","status":"401","title":"Unauthorized to access the resource"}]}
403 Forbidden
// Status 403 Forbidden{"errors":[{"code":"Forbidden","status":"403","title":"Access to the resource is forbidden"}]}
404 Not Found
// Status 404 Not Found{"errors":[{"code":"NotFound","status":"404","title":"The survey response could not be found"}]}
409 Conflict
// Status 409 Conflict{"errors":[{"code":"Conflict","status":"409","title":"The survey associated with this survey response has been disabled"}]}
Show Survey Response
GET /api/v2/guide/{locale}/survey_responses/{id}
Shows information about the specified survey response.
Allowed for
Admins
End users (responders only)
Parameters
Name
Type
In
Required
Description
id
string
Path
true
The survey response id
locale
string
Path
true
The locale used for the display of the corresponding survey questions and options
// Status 200 OK{"survey_response":{"answers":[{"created_at":"2024-08-14T12:00:00.000Z","question":{"alias":"customer satisfaction rating","headline":{"key":"dc.surveys.customer_satisfaction.questions.rating","type":"dynamic","value":"How would you rate your experience?"},"id":"01J1WBE8QR0YQVE373K2JDJR0F","options":[{"label":{"key":"dc.surveys.customer_satisfaction.question.rating.options.bad_rating","type":"dynamic","value":"Bad"},"rating":1},{"label":{"key":"dc.surveys.customer_satisfaction.question.rating.options.good_rating","type":"dynamic","value":"Good"},"rating":2}],"sub_type":"customer_satisfaction","type":"rating_scale_numeric"},"rating":1,"rating_category":"bad","type":"rating_scale","updated_at":"2024-08-14T12:00:00.000Z"},{"created_at":"2024-08-14T12:00:00.000Z","question":{"alias":"reason","headline":{"key":"dc.surveys.customer_satisfaction.questions.reason","type":"dynamic","value":"Select a reason for your experience"},"id":"01J1WBGX1BR4ECKTS87CRJTXSF","options":[{"id":"01J1WBKRG57E6M8C1145EXJ535","label":{"key":"dc.surveys.customer_satisfaction.question.reason.options.too_long","type":"dynamic","value":"The issue took too long to resolve"}}],"type":"closed_ended"},"selections":[{"option_id":"01J1WBKRG57E6M8C1145EXJ535","type":"predefined"}],"type":"closed_ended","updated_at":"2024-08-14T12:00:00.000Z"},{"created_at":"2024-08-14T12:00:00.000Z","question":{"alias":"comment","headline":{"key":"dc.surveys.customer_satisfaction.questions.comment","type":"dynamic","value":"Share your thoughts on the support you received"},"id":"01J1WBNS76ZC4TTFWP9RCNQ1S8","type":"open_ended"},"type":"open_ended","updated_at":"2024-08-14T12:00:00.000Z","value":"I had to repeatedly answer the same questions."},{"created_at":"2024-08-14T12:00:00.000Z","question":{"alias":"additional comment","headline":{"type":"static","value":"A question to demonstrate a static headline"},"id":"01J1WBSAZWVY2XR1EFZKS3CM13","type":"open_ended"},"type":"skipped","updated_at":"2024-08-14T12:00:00.000Z"}],"expires_at":"2024-08-14T12:00:00.000Z","id":"01J1WB51MG6HXTYWE6Q0C93RNW","responder_id":4398080151295,"subject_zrns":["zen:ticket:99"],"subjects":[{"id":"99","type":"ticket","zrn":"zen:ticket:99"}],"survey":{"id":"01J58KJ9RAE0D2EK7HRVM7Z8F2","state":"enabled","version":3}}}
404 Not Found
// Status 404 Not Found{"errors":[{"code":"NotFound","status":"404","title":"The survey response could not be found"}]}