Skip to content

Area: Developers

POST

Submit survey answers

Path
/surveys/{token}/submissions
Auth
None · a public or signed link
POST
/surveys/{token}/submissions
curl --request POST \
--url https://releva.ai/api/v0/surveys/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/submissions \
--header 'Content-Type: application/json' \
--data '{ "iv": "9f2b6c1d0e3a4b5c6d7e8f9011223344", "encryptedProfileId": "rlv1.Q2hhbmdlTWVJc0FuRXhhbXBsZVZhbHVl", "linkToken": "11111111-2222-4333-8444-555555555555", "data": { "satisfaction": 5, "reason": "Delivery", "improve": "More colours", "please.": null } }'

Records a surveySubmission event with the answers and marks the survey as submitted for this respondent. Identity rules are the same as for opening the survey. When the survey merges the e-mail or phone number into the profile, the first e-mail (inputType: email) or phone (inputType: tel) text answer is merged asynchronously; on a public survey, an address that already belongs to another profile attributes the event to that profile without changing it. There is no duplicate check: “Once per link” is enforced by the survey app in the respondent’s browser. Not affected by a value-delivery pause. JSON only; the whole body must fit in 800 KB.

token
required
string format: uuid

Survey token (UUID; in the survey link as token=). A value that is not a UUID answers 500.

Media typeapplication/json
object
data
required

Answers keyed by question name (the SurveyJS result). Not checked against the survey.

object
key
additional properties
any
iv

Personal link iv. Send together with encryptedProfileId.

string
encryptedProfileId

Personal link profileId. Send together with iv.

string
anonymousId

Identity from the open response of a public survey.

string
linkToken

Accepted and not used.

string

Examples

{
"iv": "9f2b6c1d0e3a4b5c6d7e8f9011223344",
"encryptedProfileId": "rlv1.Q2hhbmdlTWVJc0FuRXhhbXBsZVZhbHVl",
"linkToken": "11111111-2222-4333-8444-555555555555",
"data": {
"satisfaction": 5,
"reason": "Delivery",
"improve": "More colours",
"please.": null
}
}

Accepted for asynchronous processing.

Media typeapplication/json
object
0

Example

{}

Validation error, broken personal link or unknown survey.

Media typeapplication/json
object
message
required

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

string

Examples

{
"message": "The 'data' 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 survey has no public link and the request carries no personal link.

Media typeapplication/json
object
message
required

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

string

Example

{
"message": "This survey can only be opened through a personal link."
}

Body larger than 800 KB.

Media typeapplication/json
object
message
required

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

string

Example

{
"message": "request entity too large"
}

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."
}