Skip to main content
POST
/
v1
/
community
/
quests
cURL
curl --request POST \
  --url https://api.flipsuite.xyz/v1/community/quests \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "name": "Raffle Quest",
  "shortDescription": "Quest intro",
  "fullDescription": "Extra quest description and instructions",
  "recurrence": "ONCE",
  "visibility": "PUBLIC",
  "tasks": [],
  "rewards": []
}
'
import requests

url = "https://api.flipsuite.xyz/v1/community/quests"

payload = {
"name": "Raffle Quest",
"shortDescription": "Quest intro",
"fullDescription": "Extra quest description and instructions",
"recurrence": "ONCE",
"visibility": "PUBLIC",
"tasks": [],
"rewards": []
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Raffle Quest',
shortDescription: 'Quest intro',
fullDescription: 'Extra quest description and instructions',
recurrence: 'ONCE',
visibility: 'PUBLIC',
tasks: [],
rewards: []
})
};

fetch('https://api.flipsuite.xyz/v1/community/quests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flipsuite.xyz/v1/community/quests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Raffle Quest',
'shortDescription' => 'Quest intro',
'fullDescription' => 'Extra quest description and instructions',
'recurrence' => 'ONCE',
'visibility' => 'PUBLIC',
'tasks' => [

],
'rewards' => [

]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.flipsuite.xyz/v1/community/quests"

payload := strings.NewReader("{\n \"name\": \"Raffle Quest\",\n \"shortDescription\": \"Quest intro\",\n \"fullDescription\": \"Extra quest description and instructions\",\n \"recurrence\": \"ONCE\",\n \"visibility\": \"PUBLIC\",\n \"tasks\": [],\n \"rewards\": []\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.flipsuite.xyz/v1/community/quests")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Raffle Quest\",\n \"shortDescription\": \"Quest intro\",\n \"fullDescription\": \"Extra quest description and instructions\",\n \"recurrence\": \"ONCE\",\n \"visibility\": \"PUBLIC\",\n \"tasks\": [],\n \"rewards\": []\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.flipsuite.xyz/v1/community/quests")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Raffle Quest\",\n \"shortDescription\": \"Quest intro\",\n \"fullDescription\": \"Extra quest description and instructions\",\n \"recurrence\": \"ONCE\",\n \"visibility\": \"PUBLIC\",\n \"tasks\": [],\n \"rewards\": []\n}"

response = http.request(request)
puts response.read_body
{
  "id": "64a103a1-5f64-4f5c-8aa3-943595d63ccc",
  "communityId": "90895e48-0db7-4e99-b63a-b4401753da62",
  "name": "Raffle Quest",
  "shortDescription": "Quest intro",
  "fullDescription": "Extra quest description and instructions",
  "createdAt": 1783777013016,
  "startTime": 1783777013016,
  "endTime": 1784036213016,
  "status": "ACTIVE",
  "recurrence": "ONCE",
  "recurrenceInterval": 259200000,
  "visibility": "PUBLIC",
  "iteration": 1,
  "iterationCompletions": [
    23
  ],
  "totalCompletionCount": 23,
  "tasks": [
    {
      "id": "c8323dc5-7141-4e1b-aa50-b405d8b002aa",
      "type": "TWITTER_POST_INTERACTION",
      "postUrl": "https://x.com/flipsuitexyz/status/2021683679102206339",
      "isLikeRequired": true,
      "isRepostRequired": true,
      "isCommentRequired": true
    }
  ],
  "rewards": [
    {
      "id": "12ebbcaf-596c-4439-b3b1-65868841230a",
      "type": "FIXED",
      "strategy": {
        "type": "RAFFLE",
        "maxWinners": 5
      },
      "item": {
        "type": "TOKEN",
        "chain": "Base",
        "tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "amount": 1
      }
    }
  ]
}

Headers

x-api-key
string<uuid>
required

Your community API key

Body

application/json
name
string
required

Quest name.

Maximum string length: 48
shortDescription
string
required

Quest intro (plain text only).

Maximum string length: 256
fullDescription
string
required

Quest instructions (supports markdown).

Maximum string length: 4096
recurrence
enum<string>
required

Quest recurrence type.

Available options:
ONCE,
DAILY,
WEEKLY,
MONTHLY,
CUSTOM
visibility
enum<string>
required

Quest visibility type.

Available options:
PRIVATE,
PUBLIC,
SHARED
tasks
(API · object | Discord Account Age · object | Discord Server Roles · object | Discord Server Tag · object | Discord Users · object | File Upload · object | NFT Balance · object | Numeric Input · object | Points Balance · object | Points Tip · object | Poll Input · object | Quest Streak · object | Token Swap · object | Text Input · object | Token Tip · object | Token Balance · object | Top.gg Discord Bot Vote · object | Top.gg Discord Server Vote · object | X Account Age · object | Follow X Account · object | X Account Followers · object | Subscribe X Account · object | Verified X Account · object | X Post Interaction · object | Create X Post · object | Wallet Input · object)[]
required

Quest tasks and requirements.

Maximum array length: 32
rewards
(Fixed · object | Random · object | Shared · object)[]
required

Rewards that can be obtained by completing the quest.

Maximum array length: 4
bannerUrl
string<uri> | null

Link to a banner image for the quest.

recurrenceInterval
number | null

Quest interval between rounds, or its duration for ONCE recurrence type.

Required range: 3600000 <= x <= 31536000000
maxIterations
integer | null

Maximum number of quest rounds.

Required range: 1 <= x <= 9007199254740991
maxIterationCompletions
integer | null

Maximum number of completions per quest round.

Required range: 1 <= x <= 9007199254740991
maxTotalCompletions
integer | null

Maximum number of total quest completions.

Required range: 1 <= x <= 9007199254740991
status
enum<string> | null
default:ACTIVE

Status to create the quest with.

Available options:
DRAFT,
ACTIVE

Response

200 - application/json

Quest has been created

id
string
required

Unique quest ID.

status
enum<string>
required

Quest status.

Available options:
DRAFT,
TEMPLATE,
ACTIVE,
PAUSED,
REVIEW,
ENDED,
ARCHIVED
name
string
required

Quest name.

Maximum string length: 48
shortDescription
string
required

Quest intro (plain text only).

Maximum string length: 256
fullDescription
string
required

Quest instructions (supports markdown).

Maximum string length: 4096
createdAt
number
required

Quest creation UNIX timestamp.

recurrence
enum<string>
required

Quest recurrence type.

Available options:
ONCE,
DAILY,
WEEKLY,
MONTHLY,
CUSTOM
visibility
enum<string>
required

Quest visibility type.

Available options:
PRIVATE,
PUBLIC,
SHARED
iteration
integer
required

Current quest round.

Required range: 1 <= x <= 9007199254740991
iterationCompletions
number[]
required

Quest completions per iteration.

totalCompletionCount
number
required

Total quest completions count.

tasks
object[]
required

Quest tasks and requirements.

Maximum array length: 32
communityId
string
required

ID of the community this quest belongs to

rewards
(Fixed · object | Random · object | Shared · object)[]
required

Rewards that can be obtained by completing the quest.

Maximum array length: 4
versionId
string | null

ID of the latest editable quest version.

creatorId
string | null

ID of the user who created this quest.

bannerUrl
string<uri> | null

Link to a banner image for the quest.

startTime
number | null

Quest start time UNIX timestamp.

endTime
number | null

Quest end time UNIX timestamp.

recurrenceInterval
number | null

Quest interval between rounds, or its duration for ONCE recurrence type.

Required range: 3600000 <= x <= 31536000000
nextIterationAt
number | null

Next quest round start time UNIX timestamp.

maxIterations
integer | null

Maximum number of quest rounds.

Required range: 1 <= x <= 9007199254740991
maxIterationCompletions
integer | null

Maximum number of completions per quest round.

Required range: 1 <= x <= 9007199254740991
maxAllowedStreakGap
integer

Maximum number of missed quest rounds that still count toward a streak.

Required range: 0 <= x <= 9007199254740991
maxTotalCompletions
integer | null

Maximum number of total quest completions.

Required range: 1 <= x <= 9007199254740991
discordShareChannelId
string | null

Discord channel in your server where the quest is shared.

Pattern: ^\d{16,20}$
discordPingRoleIds
string[] | null

Discord roles in your server to ping when a quest is activated or resets.

Maximum array length: 16
Pattern: ^\d{16,20}$