Quests

The Quest object


id - String

ID of the quest


name - String

Name of the quest


communityId - String

Your community ID


categoryId - String

Category (module) ID of the quest.


sprintId - String

Sprint ID of the quest


conditions - Array of object

List of conditions that define the user access to a quest. There are five types of conditions:

TypeDescriptionValueOperators

role

Compare a user discord role with the target value

Discord Role ID

=, !=

quest

Compare the IDs of the quests a user completed with the target value

Quest ID

isCompleted, isNotCompleted

date

Compare the current date with the target value

ISO string date

<, >

nft

Check if a user hold a NFT

Number of NFT the user should hold

No operators

level

Compare a user level with the target value

Number

<, >

twitterFollowers

Compare the number of twitter followers with the target value

Number

<,>


conditionOperator - Enum (OR, AND)

This field defines the operator that is applied to link each condition. If it's AND, the user need to fulfill all the conditions to access the quest. If it's OR, fulfilling one condition is enough to access the quest.


recurrence - Enum (once, daily, weekly, monthly)

Defines how often a quest can be completed


retryAfter - Number

Number of seconds a user needs to wait after a quest has been failed


rewards - Array of objects

Rewards associated with a quest. There is 3 types of rewards:

TypeDescriptionValue

role

Discord role

Discord role ID

xp

XP of the quest

Number

other

Custom reward

String

An optional reward method can be associated to a reward:

Reward method typeDescriptionSettings

all

Default reward method

fcfs

First Come First Serve

{max: number, up to 1000}

raffle

Raffle

{amount: number, up to 1000}


tasks - Array of objects

This field contains the different tasks that compose the quest. You can learn more about the different types of tasks in our product documentation.


description - Object

TipTap document that describes the quest


autoValidate - Boolean

Boolean that defines if a quest requires a review or is automatically validated. The value of this field is automatically generated depending on the tasks that compose the quest.


deleted - Boolean

Defines if the quest is deleted


claimLimit - Number

Defines if the quest can be claimed a maximum number of times


archived - Boolean

Defines if the quest is archived


published - Boolean

Defines if the quest is visible for the members


API Reference

Create quest in a community

POSThttps://api-v2.zealy.io/public/communities/{subdomain}/quests
Path parameters
subdomain*string
Header parameters
Body

Body

categoryId*string (uuid)
name*string
published*boolean
recurrence*enum
dailyweeklymonthlyonce
conditionOperator*enum
ANDOR
retryAfternullable one of
description*nullable object
conditions*array of one of
positionnumber
claimLimitnumber
sprintIdstring (uuid)
tasks*array of one of
rewards*array of all of
Response

200

Body
id*string (uuid)
name*string
recurrence*enum
dailyweeklymonthlyonce
description*nullable object
retryAfter*nullable number
archived*boolean
published*boolean
communityId*string (uuid)
categoryId*string (uuid)
conditionOperator*enum
ANDOR
conditions*array of one of
rewards*array of one of
tasks*array of all of
claimLimit*number
Request
const response = await fetch('https://api-v2.zealy.io/public/communities/{subdomain}/quests', {
    method: 'POST',
    headers: {
      "x-api-key": "text",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "categoryId": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "published": false,
      "recurrence": "daily",
      "conditionOperator": "AND",
      "description": {
        "type": "text"
      },
      "conditions": [
        {
          "type": "quest",
          "operator": "isCompleted",
          "value": "123e4567-e89b-12d3-a456-426614174000"
        }
      ],
      "tasks": [
        {
          "type": "partnership",
          "settings": {
            "subdomain": "text"
          }
        }
      ],
      "rewards": [
        {
          "type": "xp"
        }
      ]
    }),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "recurrence": "daily",
  "description": {},
  "retryAfter": 0,
  "archived": false,
  "published": false,
  "communityId": "123e4567-e89b-12d3-a456-426614174000",
  "categoryId": "123e4567-e89b-12d3-a456-426614174000",
  "conditionOperator": "AND",
  "conditions": [
    {
      "type": "quest",
      "operator": "isCompleted",
      "value": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "rewards": [
    {
      "type": "xp"
    }
  ],
  "tasks": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "type": "partnership",
      "settings": {
        "subdomain": "text"
      }
    }
  ],
  "claimLimit": 0
}

List quests in a community

GEThttps://api-v2.zealy.io/public/communities/{subdomain}/quests
Path parameters
subdomain*string
Header parameters
Response

200

Body
description*nullable object
id*string
name*string
deletedboolean
communityIdstring
categoryIdstring
createdAtstring (date-time)
updatedAtstring (date-time)
archived*nullable boolean
autoValidateboolean
conditionOperator*nullable enum
ANDOR
conditions*array of object
published*boolean
recurrence*enum
dailyweeklymonthlyonce
retryAfter*nullable number
rewards*nullable array of object
tasks*array of all of
claimLimitnullable number
claimCounternullable number
Request
const response = await fetch('https://api-v2.zealy.io/public/communities/{subdomain}/quests', {
    method: 'GET',
    headers: {
      "x-api-key": "text"
    },
});
const data = await response.json();
Response
[
  {
    "description": {
      "type": "text",
      "text": "text",
      "attrs": {},
      "marks": [
        {
          "type": "text",
          "attrs": {
            "href": "text",
            "target": "_blank",
            "class": "text"
          }
        }
      ]
    },
    "id": "text",
    "name": "text",
    "deleted": false,
    "communityId": "text",
    "categoryId": "text",
    "createdAt": "2024-09-11T13:39:22.593Z",
    "updatedAt": "2024-09-11T13:39:22.593Z",
    "archived": false,
    "autoValidate": false,
    "conditionOperator": "AND",
    "conditions": [
      {
        "type": "level",
        "value": "text",
        "operator": "="
      }
    ],
    "published": false,
    "recurrence": "daily",
    "retryAfter": 0,
    "rewards": [
      {
        "type": "xp",
        "operator": "=",
        "value": "text",
        "chain": "polygon",
        "collection": "text",
        "contractAddress": "text"
      }
    ],
    "tasks": [
      {
        "id": "text",
        "type": "api",
        "settings": {
          "title": "text",
          "description": "text",
          "endpoint": "https://example.com",
          "apiKey": "text",
          "identifications": [
            "email"
          ],
          "network": "eth-mainnet",
          "redirectUrl": "text"
        }
      }
    ],
    "claimLimit": 0,
    "claimCounter": 0
  }
]

Last updated