NPS® Responses

When a recipient responds to an NPS survey, their rating, comment, and last survey date are captured. You can export the responses for your individual NPS survey by using the Responses API. Visit the Incremental Export documentation for information on how to export all responses across surveys.

JSON Format

Responses are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
comment string false false The comment text.
created_at string true false When the response was created.
id integer true false Automatically assigned when response created.
rating integer false true The rating for the comment.
recipient_id integer true true Recipient the response belongs to.
updated_at string true false When response was last updated.
Example
{
  "comment": "It has improved the efficiency of our support department.",
  "created_at": "2013-08-29T00:00:00-07:00",
  "id": 1,
  "rating": 9,
  "recipient_id": 1,
  "updated_at": "2013-08-29T00:00:00-07:00"
}

List Responses

  • GET /api/v2/nps/surveys/{survey_id}/responses

List responses for a given survey.

Allowed for
  • Admins
Parameters
Name Type In Required Description
category string Query false Category type. Allowed values are "detractors", "passives" or "promoters".
has_comment string Query false Responses with comments. Allowed values are "false" or "true".
survey_id integer Path true ID of survey.
Using curl
curl https://{subdomain}.zendesk.com/api/v2/nps/surveys/{survey_id}/responses.json \
  -v -u {email_address}:{password}
Example Response
Status 200 OK

{
  "responses": [
    {
      "comment": "I really lke it",
      "created_at": "2020-07-01T18:00:00Z",
      "id": 1,
      "rating": 10,
      "recipient_id": 42,
      "updated_at": "2020-07-01T18:00:00Z"
    }
  ]
}

Create Response

  • POST /api/v2/nps/surveys/{survey_id}/responses

Creates a response for a given survey and recipient. If recipient already has a response, it's updated.

Allowed for
  • Admins
Parameters
Name Type In Required Description
survey_id integer Path true ID of survey.
Example Body
{
  "response": {
    "comment": "I really lke it",
    "rating": 10,
    "recipient_id": 42
  }
}
Using curl
curl \
  --data '{"response": {"comment": "I really like it", "rating": 10, "recipient_id": 42}}' \
  --header "Content-Type: application/json" \
  --request POST \
  -v -u {email_address}:{password} \
    https://{subdomain}.zendesk.com/api/v2/nps/surveys/{survey_id}/responses.json
Example Response
Status 201 Created

{
  "response": {
    "comment": "I really lke it",
    "created_at": "2020-07-01T18:00:00Z",
    "id": 1,
    "rating": 10,
    "recipient_id": 42,
    "updated_at": "2020-07-01T18:00:00Z"
  }
}

Show Response

  • GET /api/v2/nps/surveys/{survey_id}/responses/{response_id}

Shows an existing response for a survey.

Allowed for
  • Admins
Parameters
Name Type In Required Description
response_id integer Path true ID of survey response.
survey_id integer Path true ID of survey.
Using curl
curl https://{subdomain}.zendesk.com/api/v2/nps/surveys/{survey_id}/responses/{response_id}.json \
  -v -u {email_address}:{password}
Example Response
Status 200 OK

{
  "response": {
    "comment": "I really lke it",
    "created_at": "2020-07-01T18:00:00Z",
    "id": 1,
    "rating": 10,
    "recipient_id": 42,
    "updated_at": "2020-07-01T18:00:00Z"
  }
}

Update Response

  • PUT /api/v2/nps/surveys/{survey_id}/responses/{response_id}

Updates an existing response for a survey.

Allowed for
  • Admins
Parameters
Name Type In Required Description
response_id integer Path true ID of survey response.
survey_id integer Path true ID of survey.
Example Body
{
  "response": {
    "comment": "I really lke it",
    "rating": 10
  }
}
Using curl
curl \
  --data '{"response": {"comment": "I really like it", "rating": 10}}' \
  --header "Content-Type: application/json" \
  --request PUT \
  -v -u {email_address}:{password} \
    https://{subdomain}.zendesk.com/api/v2/nps/surveys/{survey_id}/responses/{response_id}.json
Example Response
Status 200 OK

{
  "response": {
    "comment": "I really lke it",
    "created_at": "2020-07-01T18:00:00Z",
    "id": 1,
    "rating": 10,
    "recipient_id": 42,
    "updated_at": "2020-07-01T18:00:00Z"
  }
}