Appearance
Post Answers
Submit a single quiz answer for a user.
Overview
This endpoint allows submitting a single answer to a quiz question. Use this for question-by-question submission flow. It returns the updated answer object with the current progress.
Method: POST
Endpoints by Quiz Type
| Quiz Type | Endpoint |
|---|---|
| Anonymous | /api/v1/namespaces/:namespaceId/quizzes/:quizId/users/anonymous/answers |
| In-App | /api/v1/namespaces/:namespaceId/quizzes/:quizId/users/inapp/answers |
| Invited | /api/v1/namespaces/:namespaceId/quizzes/:quizId/users/:invitedUserUUID/answers |
See Quiz Types to understand the differences between anonymous, in-app, and invited quizzes.
Request
Path Parameters
| Parameter | Type | Required | Quiz Type | Description |
|---|---|---|---|---|
namespaceId | string | ✅ | All | Namespace unique ID |
quizId | string | ✅ | All | Quiz unique ID |
invitedUserUUID | string | ✅ | Invited | Invited user unique ID |
Body Parameters
| Field | Type | Required | Quiz Type | Description |
|---|---|---|---|---|
anonymousUserId | string | ✅ | Anonymous | Anonymous user identifier |
sessionId | string | ✅ | In-App | In-app session identifier |
questionId | string | ✅ | All | ID of the question being answered |
answer | string | ✅ | All | Answer ID (UUID) from the question's answer options |
language | string | ✅ | All | Language code (en for English, es for Spanish) |
customParams | string | ❌ | All | Optional custom parameters |
Finding Answer IDs: Use the Get Quiz Public Info endpoint to retrieve the quiz's questions and their available answer options. Each answer option includes an
id(UUID) that should be used as the value when submitting answers.
Example Request Bodies
json
{
"anonymousUserId": "anon_12345",
"questionId": "fhn1",
"answer": "4b7e6d70-fd93-494a-874d-ea783f825289",
"language": "en"
}json
{
"sessionId": "session_abc123",
"questionId": "fhn1",
"answer": "4b7e6d70-fd93-494a-874d-ea783f825289",
"language": "en"
}json
{
"questionId": "fhn1",
"answer": "4b7e6d70-fd93-494a-874d-ea783f825289",
"language": "en"
}Response
Example Responses
json
{
"answers": {
"id": "quiz1234-anon_12345",
"userId": "anon_12345",
"quizId": "quiz1234",
"qAnswers": {
"fhn1": "4b7e6d70-fd93-494a-874d-ea783f825289"
},
"completionStatus": 2,
"isAnonymous": true
},
"anonymousUserId": "anon_12345"
}json
{
"answers": {
"id": "quizid1234-session_abc123",
"userId": "session_abc123",
"quizId": "quizid1234",
"qAnswers": {
"fhn1": "4b7e6d70-fd93-494a-874d-ea783f825289"
},
"completionStatus": 2,
"isAnonymous": false
}
}json
{
"answers": {
"id": "abcd12345-user_abcd12345",
"userId": "user_abcd12345",
"quizId": "abcd12345",
"qAnswers": {
"fhn1": "4b7e6d70-fd93-494a-874d-ea783f825289"
},
"completionStatus": 2,
"isAnonymous": false
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique answer document ID (format: quizId-userId) |
userId | string | User identifier |
quizId | string | Quiz identifier |
qAnswers | object | Object containing submitted answers (questionId → answerId) |
completionStatus | number | 1 = initialized, 2 = in progress, 3 = completed |
isAnonymous | boolean | true for anonymous quizzes, false for invited |
inapp | boolean | true for in-app quizzes (only present for in-app type) |
anonymousUserId | string | Returned only for anonymous quizzes |
Note: Since this is an unauthenticated endpoint, the response only includes non-identifiable question data (e.g.,
fhnprefixed questions). Questions containing personally identifiable information are excluded from the response.
Error Responses
400 Bad Request– If the quiz has ended
json
{
"error": "quiz has ended",
"errorCode": "quiz/ended"
}400 Bad Request– If the quiz type doesn't match the endpoint
json
{
"error": "quiz only takes non anonymous submissions",
"errorCode": "quiz/not_anonymous"
}404 Not Found– If the namespace does not exist
json
{
"error": "namespace not found",
"errorCode": "namespace/not_found"
}404 Not Found– If the quiz does not exist
json
{
"error": "quiz not found",
"errorCode": "quiz/not_found"
}404 Not Found– If the answer document doesn't exist (user must call initQuiz first)
json
{
"error": "Answer document not found. User must call initQuiz first.",
"errorCode": "request/not_found"
}404 Not Found– If the invited user does not exist (for invited quizzes)
json
{
"error": "user does not exist",
"errorCode": "users/not_found"
}403 Forbidden– If the invited user is not part of the quiz (for invited quizzes)
json
{
"error": "user is not part of the quiz",
"errorCode": "users/unauthorized"
}422 Unprocessable Entity– If required parameters are missing or validation fails
json
{
"validationErrors": {
"body": {
"questionId": {
"message": "\"questionId\" is required"
}
}
}
}