Skip to content

Area: Developers

POST

Submit an NPS answer

Path
/nps/{token}/submissions
Auth
None · a public or signed link
POST
/nps/{token}/submissions
curl --request POST \
--url https://releva.ai/api/v0/nps/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/submissions \
--header 'Content-Type: application/json' \
--data '{ "profileId": null, "deviceId": "demo-device-1", "sessionId": "demo-session-1", "score": 9, "comment": "Fast delivery and friendly support." }'

Records an npsSubmission event (score 0-10, category, optional comment), starts the survey’s cooldown for this respondent and writes nps_score, nps_category, nps_survey_id and nps_last_answered to the profile. The JavaScript SDK calls it from the NPS widget; call it yourself from an app or custom widget that renders the nps object of the page push. The respondent is profileId, or deviceId when profileId is blank. The survey must be active. No duplicate check. Not affected by a value-delivery pause.

token
required
string format: uuid

NPS survey token (nps.token in the page push). A value that is not a UUID answers 500.

object
profileId

Releva profile id. Blank or whitespace counts as absent.

string | null
deviceId
required

Device id; the respondent when profileId is absent. One of the two must be non-blank.

string
sessionId
required
string
score
required

9-10 promoter, 7-8 passive, 0-6 detractor.

integer
<= 10
comment

Answer to the follow-up question.

string

Example

{
"profileId": null,
"deviceId": "demo-device-1",
"sessionId": "demo-session-1",
"score": 9,
"comment": "Fast delivery and friendly support."
}

Accepted for asynchronous processing.

Media typeapplication/json
object
0

Example

{}

Validation error or unknown survey.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Examples

{
"message": "The 'deviceId' field is required. The 'sessionId' field is required. The 'score' field is required."
}

The domain is switched off.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "Shop is disabled. Please reach out to support@releva.ai to enable it."
}

The NPS survey is a draft or inactive.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "Survey not found."
}

Unexpected server error.

Media typeapplication/json
object
message
required

Human-readable error. Several validation errors are joined with a space.

string

Example

{
"message": "An internal error occurred."
}