Skip to main content
POST
/
challenges
/
{id}
Update a challenge by id
curl --request POST \
  --url https://{subdomain}.nudj.cx/api/v2/admin/challenges/{id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '
{
  "additionalCommunityIds": [
    "<string>"
  ],
  "status": "archived",
  "isSkippable": true,
  "isLinear": true,
  "enabledForSingleView": true,
  "tags": [
    "<string>"
  ],
  "campaigns": [
    "<string>"
  ],
  "startsAt": "<string>",
  "expiresAt": "<string>",
  "featured": true,
  "progressPeriod": "daily",
  "maxCompletionsPerPeriod": 1,
  "unlockPrice": 1,
  "isGlobalTemplate": true,
  "availableAsTemplateForOrganisations": [
    "<string>"
  ],
  "videoConfig": {
    "videoUrl": "<string>",
    "isVideoEnabled": true
  },
  "details": {
    "title": "<string>",
    "description": "<string>",
    "light": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    },
    "dark": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    }
  }
}
'
{
  "id": "<string>",
  "organisationId": "<string>",
  "communityId": "<string>",
  "additionalCommunityIds": [
    "<string>"
  ],
  "details": {
    "title": "<string>",
    "description": "<string>",
    "light": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    },
    "dark": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    }
  },
  "progressPeriod": "daily",
  "maxCompletionsPerPeriod": 1,
  "numberOfActions": 1,
  "actionIds": [
    "<string>"
  ],
  "actionGroups": [
    {
      "id": "<string>",
      "type": "single",
      "details": {
        "title": "<string>",
        "description": "<string>",
        "light": {
          "primaryImageUrl": "<string>",
          "secondaryImageUrl": "<string>"
        },
        "dark": {
          "primaryImageUrl": "<string>",
          "secondaryImageUrl": "<string>"
        }
      },
      "parentGroupId": "<string>",
      "displayType": "list"
    }
  ],
  "status": "archived",
  "isLinear": true,
  "unlockPrice": 1,
  "tags": [
    "<string>"
  ],
  "startedCount": 1,
  "completedCount": 1,
  "uniqueUsersStartedCount": 1,
  "uniqueUsersCompletedCount": 1,
  "campaigns": [
    "<string>"
  ],
  "availableAsTemplateForOrganisations": [
    "<string>"
  ],
  "isGlobalTemplate": true,
  "groupIds": [
    "<string>"
  ],
  "createdAt": "<string>",
  "videoConfig": {
    "videoUrl": "<string>",
    "isVideoEnabled": true
  },
  "xpConfig": {
    "total": 1,
    "knowledge": 1,
    "creativity": 1,
    "loyalty": 1,
    "influence": 1,
    "participation": 1,
    "contribution": 1
  },
  "rewardDistribution": {
    "points": 1,
    "xp": 1,
    "rewardSelectionMethod": "all",
    "distributionEventId": "<string>",
    "rewardAllocations": [
      {
        "rewardId": "<string>",
        "allocationId": "<string>",
        "allocationType": "assets",
        "amountToDistribute": 2
      }
    ],
    "numberOfRewardsToReceive": 1
  },
  "actionsRewardDistribution": {
    "points": 1,
    "xp": 1,
    "rewardAllocations": [
      {
        "rewardId": "<string>",
        "allocationId": "<string>",
        "allocationType": "assets",
        "amountToDistribute": 2
      }
    ]
  },
  "challengeType": "survey",
  "enabledForSingleView": true,
  "startDate": "<string>",
  "endDate": "<string>",
  "featured": true,
  "threadId": "<string>",
  "isSkippable": true,
  "startsAt": "<string>",
  "expiresAt": "<string>",
  "updatedAt": "<string>"
}

Authorizations

x-api-token
string
header
required

Headers

x-language
string

The language to update the challenge in. This will update the challenge's content for the specified language.

Path Parameters

id
string
required

The id of the challenge

Pattern: ^[0-9a-fA-F]{24}$

Body

application/json

The input required to update a challenge

additionalCommunityIds
string[]

The ids of any additional communities the challenge belongs to

Pattern: ^[0-9a-fA-F]{24}$
status
enum<string>

The status of the challenge

Available options:
archived,
draft,
expired,
live,
scheduled
isSkippable
boolean | null

Whether the challenge is skippable

isLinear
boolean

Whether the challenge must be completed in sequential order

enabledForSingleView
boolean | null

Whether the challenge is enabled for single view

tags
string[]

The tags of the challenge

Pattern: ^[0-9a-fA-F]{24}$
campaigns
string[]

The campaigns of the challenge

Pattern: ^[0-9a-fA-F]{24}$
startsAt
string | null

The start date of the challenge

expiresAt
string | null

The expiry date of the challenge

progressPeriod
enum<string>

The progress period of the challenge

Available options:
daily,
weekly,
monthly,
yearly,
open
maxCompletionsPerPeriod

The maximum number of completions per period for the challenge

Required range: x >= 0
unlockPrice
number

The number of keys required to unlock this challenge

Required range: x >= 0
isGlobalTemplate
boolean

Whether the challenge is a global template

availableAsTemplateForOrganisations
string[]

The organisations that the challenge is available as a template for

Pattern: ^[0-9a-fA-F]{24}$
videoConfig
Video Config · object

Video configuration for challenges with video content

details
Details Update Input · object

Input for updating entity details with all fields optional

Response

Successful response

A challenge

id
string
required

The id of the challenge

Pattern: ^[0-9a-fA-F]{24}$
organisationId
string
required

The id of the organisation the challenge belongs to

Pattern: ^[0-9a-fA-F]{24}$
communityId
string
required

The id of the community the challenge belongs to

Pattern: ^[0-9a-fA-F]{24}$
additionalCommunityIds
string[]
required

The ids of any additional communities the challenge belongs to

Pattern: ^[0-9a-fA-F]{24}$
details
Details · object
required

Used to describe an entity

progressPeriod
enum<string>
required

The progress period of the challenge

Available options:
daily,
weekly,
monthly,
yearly,
open
maxCompletionsPerPeriod
required

The maximum number of completions per period for the challenge

Required range: x >= 0
numberOfActions
number
required

The number of actions in the challenge

Required range: x >= 0
actionIds
string[]
required

The ids of the actions in the challenge

Pattern: ^[0-9a-fA-F]{24}$
actionGroups
ActionGroup · object[]
required

The action groups of the challenge

status
enum<string>
required

The status of the challenge

Available options:
archived,
draft,
expired,
live,
scheduled
isLinear
boolean
required

Whether the challenge must be completed in sequential order

unlockPrice
number
required

The number of keys required to unlock this challenge

Required range: x >= 0
tags
string[]
required

The tags of the challenge

Pattern: ^[0-9a-fA-F]{24}$
startedCount
number
required

The total number of times participants have started the challenge

Required range: x >= 0
completedCount
number
required

The total number of times participants have completed the challenge

Required range: x >= 0
uniqueUsersStartedCount
number
required

The number of distinct participants who have started the challenge

Required range: x >= 0
uniqueUsersCompletedCount
number
required

The number of distinct participants who have completed the challenge

Required range: x >= 0
campaigns
string[]
required

The campaigns of the challenge

Pattern: ^[0-9a-fA-F]{24}$
availableAsTemplateForOrganisations
string[]
required

The organisations that the challenge is available as a template for

Pattern: ^[0-9a-fA-F]{24}$
isGlobalTemplate
boolean
required

Whether the challenge is a global template

groupIds
string[]
required

The challenge groups the challenge belongs to

Pattern: ^[0-9a-fA-F]{24}$
createdAt
string
required

The creation date of the challenge

videoConfig
Video Config · object
required

Video configuration for challenges with video content

xpConfig
User XP Breakdown · object
required

XP breakdown for this challenge. This is the sum of all action xpConfigs within the challenge and is automatically calculated.

rewardDistribution
Entity Reward Distribution · object
required

Reward distribution information for the challenge completion itself

actionsRewardDistribution
Aggregated Reward Distribution · object
required

Aggregated reward distribution information from all actions within the challenge

challengeType
enum<string> | null

The type of the challenge

Available options:
survey
enabledForSingleView
boolean | null

Whether the challenge is enabled for single view

startDate
string | null

Deprecated use startsAt instead

endDate
string | null

Deprecated use expiresAt instead

threadId
string | null

The thread id of the challenge

isSkippable
boolean | null

Whether the challenge is skippable

startsAt
string | null

The start date of the challenge

expiresAt
string | null

The expiry date of the challenge

updatedAt
string | null

The update date of the challenge