Game Loom
  1. Survey
Game Loom
  • Game Loom
    • 👋 Welcome to Game Loom
  • Getting started
    • Introduction
    • 👤 Authentication
  • User Registration
    • Introduction
    • Single user registration
      POST
    • Bulk Register Users
      POST
  • Notifications
    • Overview
    • Receiving Event Notifications via Webhooks
    • Get All notifications for specific user
      GET
  • Rewards
    • Overview
    • Points
      • Record user point event
      • Get user points
      • Get Specific user point
    • Levels
      • Record user level event
      • Get user levels
      • Get Specific user level
    • Badges
      • Award badge to user
      • Get user badges
      • Get Specific user badge
  • Challenges (Gamification elements)
    • Introduction
    • Leaderboard
      • Get available leaderboards for user
      • Submit score to a leaderboard
      • Get user's leaderboard participation history
      • Get leaderboard details
      • Get leaderboard ranking
      • Get user's record for a leaderboard
      • Get user's entry history for a leaderboard
    • Survey
      • Overview
      • Get available surveys for user
        GET
      • Start a new survey participation
        POST
      • Get detailed user participation
        GET
      • Get user's survey participation history
        GET
      • Abandon survey participation
        DELETE
      • Save individual answer to survey question
        POST
      • Submit completed survey
        PUT
      • Submit Survey with answers (One-Step Submission)
        POST
    • Open Challenge
      • Overview
      • Get available open challenges for user
      • Complete an open challenge
      • Get user's open challenge participation history
      • Get user open challenge by ID
    • Schemas
      • Survey Schame
  1. Survey

Submit completed survey

PUT
api/v1/user/{userkey}/surveys/{userSurveyId}

Complete Survey Participation#

Info
Finalizes a survey participation by validating and submitting all answers, marking the survey as Completed, and triggering reward distribution if applicable.

Description#

This endpoint is used to complete a survey participation.
It performs final validation on all submitted answers, persists the results, and transitions the survey to a completed state.
If the survey is linked to a reward system, rewards are calculated and distributed automatically.

Usage Examples#

Complete survey: Submit all final answers and finish participation
Bulk submission: Send multiple answers in a single request
Final review: Complete the survey after reviewing all responses

Path Parameters#

NameTypeDescription
userKeystringUnique identifier of the user (derived from authentication context)
userSurveyIdUUIDUnique identifier of the user survey participation (retrieved from the /mine endpoint)

Response#

The response includes:
Completed survey participation with final status
All submitted answers
Completion timestamp
Reward details (if applicable)
Final progress set to 100%

Answer Validation Rules#

Validation is automatically applied based on the question type:
Text / OpenEnded
Any non-empty string
YesNo
Accepted values: "yes", "no", "true", "false" (case-insensitive)
MultipleChoice
The answer must exactly match one of the values defined in the choices field
localizedChoices are not used for validation and are intended for display purposes only
Important
When submitting answers for multiple-choice questions, always send the canonical value from the choices field, not the localized label.

Validation Rules#

All answers are validated against their respective question types
Survey ownership and access are verified
Double submission is prevented
Answer format and completeness are enforced

Common Errors#

Error CodeDescription
USER_SURVEY_NOT_FOUNDInvalid user survey ID or access denied
SURVEY_ALREADY_COMPLETEDSurvey participation has already been submitted
INVALID_ANSWER_FORMATOne or more answers do not match question type requirements
QUESTION_NOT_FOUND_IN_SURVEYA submitted question does not belong to the survey

Request

Path Params

Header Params

Body Params application/jsonRequired

Examples

Responses

🟢200Success
application/json
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request PUT 'api/v1/user/{{user-key}}/surveys/{{survey_id}}' \
--header 'x-api-key: {{api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "answers": [
        {
            "questionId": "f72d1e11-e3c3-426f-b81e-f1305ac41e79",
            "answer": "true"
        },
        {
            "questionId": "df41a808-279c-4843-a5de-aafc51cacdd3",
            "answer": "Choice 1"
        },
        {
            "questionId": "690e5f3f-cc79-471f-bc74-f1fd914154d6",
            "answer": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eget faucibus diam"
        }
    ]
}'
Response Response Example
{
    "id": "b7a2ca72-b490-4fba-8ced-f26196d4dee4",
    "surveyId": "e1acdc8b-e09c-4d4e-87e8-5361cc1685c0",
    "userKey": "1765132434113",
    "companyId": "c8e815c6-5d28-489e-a0eb-b0aa735b8c57",
    "status": 2,
    "startedAt": "2025-12-23T16:29:50.558612Z",
    "completedAt": "2025-12-23T21:48:50.7044355Z",
    "updatedDate": "2025-12-23T21:48:50.8352408Z",
    "createdDate": "2025-12-23T16:29:50.586387Z",
    "surveyName": "Test survey Name",
    "surveyDescription": "Test survey description ",
    "surveyStartDate": "2025-12-23T16:14:16.236Z",
    "surveyEndDate": null,
    "totalQuestions": 3,
    "answeredQuestions": 3,
    "progressPercentage": 100,
    "questions": [
        {
            "id": "f72d1e11-e3c3-426f-b81e-f1305ac41e79",
            "surveyId": "e1acdc8b-e09c-4d4e-87e8-5361cc1685c0",
            "questionType": 1,
            "question": "Test Yes no question",
            "orderQuestion": 1,
            "choices": [
                "Yes",
                "No"
            ],
            "createdDate": "2025-12-23T16:14:16.954642Z",
            "updatedDate": "2025-12-23T16:14:16.954642Z",
            "localizedQuestions": {
                "ar": "تجربة اسئلة نعم ولا",
                "en": "Test Yes no question"
            },
            "localizedChoices": {
                "ar": [
                    "نعم",
                    "لا"
                ],
                "en": [
                    "Yes",
                    "No"
                ]
            }
        },
        {
            "id": "df41a808-279c-4843-a5de-aafc51cacdd3",
            "surveyId": "e1acdc8b-e09c-4d4e-87e8-5361cc1685c0",
            "questionType": 2,
            "question": "Test Multiple choices question",
            "orderQuestion": 2,
            "choices": [
                "Choice 1",
                "Choice 2"
            ],
            "createdDate": "2025-12-23T16:14:16.954727Z",
            "updatedDate": "2025-12-23T16:14:16.954727Z",
            "localizedQuestions": {
                "ar": "تجربة اسئلة الخيارات المتعددة",
                "en": "Test Multiple choices question"
            },
            "localizedChoices": {
                "ar": [
                    "خيار الاول",
                    "خيار ٢"
                ],
                "en": [
                    "Choice 1",
                    "Choice 2"
                ]
            }
        },
        {
            "id": "690e5f3f-cc79-471f-bc74-f1fd914154d6",
            "surveyId": "e1acdc8b-e09c-4d4e-87e8-5361cc1685c0",
            "questionType": 3,
            "question": "Test Open-ended question",
            "orderQuestion": 3,
            "choices": [],
            "createdDate": "2025-12-23T16:14:16.954735Z",
            "updatedDate": "2025-12-23T16:14:16.954735Z",
            "localizedQuestions": {
                "ar": "تجربة السؤال المفتوح",
                "en": "Test Open-ended question"
            },
            "localizedChoices": null
        }
    ],
    "answers": [
        {
            "id": "064771d6-c990-4c53-b224-7a0af6162afb",
            "questionId": "f72d1e11-e3c3-426f-b81e-f1305ac41e79",
            "question": "Test Yes no question",
            "answer": "true",
            "answeredAt": "0001-01-01T00:00:00"
        },
        {
            "id": "551630e5-8292-4bc1-afcd-44cba2edc0f7",
            "questionId": "df41a808-279c-4843-a5de-aafc51cacdd3",
            "question": "Test Multiple choices question",
            "answer": "Choice 1",
            "answeredAt": "0001-01-01T00:00:00"
        },
        {
            "id": "e7aa8a6e-b677-49de-abbe-f1a5ef573353",
            "questionId": "690e5f3f-cc79-471f-bc74-f1fd914154d6",
            "question": "Test Open-ended question",
            "answer": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eget faucibus diam",
            "answeredAt": "0001-01-01T00:00:00"
        }
    ]
}
Modified at 2025-12-23 22:05:23
Previous
Save individual answer to survey question
Next
Submit Survey with answers (One-Step Submission)
Built with