Loyi API Reference
  1. Quest
Loyi API Reference
  • Getting Started
  • Architecture
  • User
    • Users Overview
    • Create user
      POST
    • Get users
      GET
    • Get user
      GET
    • Update user
      PUT
    • Delete user
      DELETE
  • Reward
    • Rewards Overview
    • Create reward
      POST
    • Get rewards
      GET
    • Delete reward
      DELETE
    • Create entry pass code
      POST
    • Get entry pass code
      GET
    • Airdrop reward
      PUT
    • Award reward
      POST
    • Redeem rewards
      GET
  • Collection
    • Collection Overview
    • Create collection
    • Get collections
    • Get collection
    • Update collection
    • Delete collection
    • Get rewards
  • Collectible
    • Claim collectible
    • Get collectibles
  • Quest
    • Quest Overview
    • Create quest
      POST
    • Get quests
      GET
    • Get quest
      GET
    • Update quest
      PUT
    • Delete quest
      DELETE
    • Get participants
      GET
    • Accept quest
      POST
    • Submit answers
      POST
    • Get answers
      GET
  • Leaderboard
    • Leaderboard Overview
    • Get leaderboard
  • Leveling
    • Get leveling configuration
    • Configure leveling
    • Get milestone levels
    • Create milestone level
    • Get milestone level
    • Update milestone level
    • Delete milestone level
  1. Quest

Submit answers

Staging
https://testserver.loyi.io/public/api
Staging
https://testserver.loyi.io/public/api
POST
/quest/{id}/submit-answers
Quest
Submits user answers for the a quest of type quiz or
questionnaire. Sending this request again will re-evalute
the answers and update the status of the user's quiz.
Questionnaires always return a status of passed once the answers
have been submitted.

Request

Authorization
Add parameter in header
x-api-key
Example:
x-api-key: ********************
Path Params
id
string <uuid>
required
Quest ID
Header Params
Origin
string 
required
The value must be one of the whitelisted domains. You can whitelist domain URLs on your Loyi dashboard.
Default:
<WHITELISTED_URL>
Example:
https://example.com
Body Params application/json
userId
string <uuid>
required
ID of the user that submitted the answers.
answers
array[object (QuizAnswer) {3}] 
required
Answers that the user has provided for the quiz or questionnaire.
questionId
string <uuid>
required
ID of the question that the answer belongs to
choiceId
string <uuid>
optional
ID of the choice that represents the answer
value
string 
optional
Value of the answer.
Example
{
    "userId": "123e4567-e89b-12d3-a456-426614174000",
    "answers": [
        {
            "questionId": "12345678-1234-1234-1234-123456789012",
            "choiceId": "12345678-1234-1234-1234-123456789013"
        },
        {
            "questionId": "12345678-1234-1234-1234-123456789019",
            "value": "lorum ipsum dolor sit amet"
        }
    ]
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://testserver.loyi.io/public/api/quest//submit-answers' \
--header 'Origin;' \
--header 'Content-Type: application/json' \
--header 'x-api-key;' \
--data-raw '{
    "userId": "123e4567-e89b-12d3-a456-426614174000",
    "answers": [
        {
            "questionId": "12345678-1234-1234-1234-123456789012",
            "choiceId": "12345678-1234-1234-1234-123456789013"
        },
        {
            "questionId": "12345678-1234-1234-1234-123456789019",
            "value": "lorum ipsum dolor sit amet"
        }
    ]
}'

Responses

🟢200OK
application/json
Ok
Body
userId
string <uuid>
required
questId
string <uuid>
required
result
enum<string> 
required
Allowed values:
passedfailed
submittedAt
string <date-time>
required
Date when the answers were submitted.
Example
{
    "userId": "123e4567-e89b-12d3-a456-426614174000",
    "questId": "123e4567-e89b-12d3-a456-426614174000",
    "status": "passed",
    "submittedAt": "2022-01-01T00:00:00.000Z"
}
🟠400Bad Request
🟠401Unauthorized
Modified at 2025-06-19 21:23:41
Previous
Accept quest
Next
Get answers
Built with