Skip to content

Submit NPS response

POST
/nps/{id}/response
curl --request POST \
--url https://app.surveyrock.com/api/v1/nps/example/response \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "respondentId": "example", "surveyId": "example", "value": 1, "recommendationSubject": "example" }'

Submit an NPS response with validation

id
required
string
>= 16 characters <= 16 characters

NPS element ID

NPS response data

Media typeapplication/json
object
respondentId
required

Respondent ID

string
>= 16 characters <= 16 characters
surveyId
required

Survey ID

string
>= 16 characters <= 16 characters
value
required

NPS score (0-10)

integer
<= 10
recommendationSubject

Optional recommendation subject

string
nullable
Examplegenerated
{
"respondentId": "example",
"surveyId": "example",
"value": 1,
"recommendationSubject": "example"
}

NPS response submitted successfully

Media typeapplication/json
object
success
boolean
data
object
value
integer
type
string
recommendationSubject
string
nullable
submittedAt
string format: date-time
meta

Standard response metadata

object
timestamp

Response timestamp in ISO 8601 format

string format: date-time
version

API version

string
requestId

Unique request identifier

string
Example
{
"success": true,
"data": {
"type": "nps"
},
"meta": {
"version": "3.0"
}
}

Validation failed

Media typeapplication/json

Validation error response with field-specific errors

object
success
boolean
error
object
code
string
message
string
suggestion
string
retryable
boolean
details

Field-specific validation errors

object
key
additional properties
Array<string>
meta

Standard response metadata

object
timestamp

Response timestamp in ISO 8601 format

string format: date-time
version

API version

string
requestId

Unique request identifier

string
Example
{
"success": false,
"error": {
"code": "validation_failed",
"message": "Validation failed",
"suggestion": "Fix the fields listed in details and re-submit.",
"retryable": false
},
"meta": {
"version": "3.0"
}
}