Skip to main content
PATCH
/
actions
/
reorder
Reorder actions in a challenge
curl --request PATCH \
  --url https://{subdomain}.nudj.cx/api/v2/admin/actions/reorder \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '
{
  "allocationId": "<string>",
  "actionIds": [
    "<string>"
  ]
}
'
[
  {
    "id": "<string>",
    "organisationId": "<string>",
    "communityId": "<string>",
    "allocationId": "<string>",
    "allocatedTo": "achievement",
    "position": 123,
    "category": "nudj",
    "key": "facebook-comment",
    "details": {
      "title": "<string>",
      "description": "<string>",
      "light": {
        "primaryImageUrl": "<string>",
        "secondaryImageUrl": "<string>"
      },
      "dark": {
        "primaryImageUrl": "<string>",
        "secondaryImageUrl": "<string>"
      }
    },
    "progressPeriod": "daily",
    "maxCompletionsPerPeriod": 1,
    "attributes": {
      "key": "<string>",
      "question": "<string>",
      "options": [
        {
          "id": "<string>",
          "label": "<string>"
        }
      ],
      "minimumNumberOfAnswersRequired": 2,
      "maximumNumberOfAnswersAllowed": 2,
      "correctAnswers": [
        "<string>"
      ]
    },
    "config": {
      "isOptional": true,
      "socialValidation": "validation-on",
      "prerequisites": {
        "requiredActionCount": 123,
        "actionIds": [
          "<string>"
        ]
      },
      "requiresCorrectAnswer": true
    },
    "xpConfig": {
      "total": 1,
      "knowledge": 1,
      "creativity": 1,
      "loyalty": 1,
      "influence": 1,
      "participation": 1,
      "contribution": 1
    },
    "videoMetadata": {
      "startsAtMs": 1,
      "shouldPause": true,
      "validatesAtMs": 1,
      "endsAtMs": 1
    },
    "createdAt": "<string>",
    "rewardDistribution": {
      "points": 1,
      "xp": 1,
      "rewardSelectionMethod": "all",
      "distributionEventId": "<string>",
      "rewardAllocations": [
        {
          "rewardId": "<string>",
          "allocationId": "<string>",
          "allocationType": "assets",
          "amountToDistribute": 2
        }
      ],
      "numberOfRewardsToReceive": 1
    },
    "createdBy": "<string>",
    "actionGroupId": "<string>",
    "actionGroupIndex": 123,
    "availableAsTemplateForOrganisations": [
      "<string>"
    ],
    "isGlobalTemplate": true,
    "updatedAt": "<string>",
    "updatedBy": "<string>"
  }
]

Authorizations

x-api-token
string
header
required

Body

application/json

The input required to reorder actions for a challenge

allocationId
string
required

The allocation ID (challenge) containing the actions to reorder

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

Array of action IDs in the desired order

Minimum array length: 1
Pattern: ^[0-9a-fA-F]{24}$

Response

Successful response

id
string
required

The id of the action

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

The organisation that the action belongs to

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

The community that the action belongs to

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

The allocation this action is assigned to. When null, indicates this is a template action.

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

The entity type this action is allocated to. This can be set to a 'challenge' only at the moment.

Available options:
achievement,
action,
community,
challenge,
leaderboard,
post,
reward,
reward-asset,
reward-entry
position
number
required

The display position of this action

category
enum<string>
required

The category of this action

Available options:
nudj,
discord,
facebook,
imageAnalysis,
instagram,
interaction,
linkedin,
question,
platform,
spotify,
tiktok,
twitter,
youtube
key
enum<string>
required

The specific type of this action

Available options:
facebook-comment,
facebook-follow,
facebook-like,
image-analysis-object-detection,
image-analysis-receipt-detection,
instagram-follow,
instagram-like,
instagram-comment,
instagram-share,
instagram-post,
interaction-engage-with-content,
interaction-external-link,
interaction-image-upload,
interaction-spot-object,
platform-comment-on-post,
platform-complete-achievement,
platform-generative-action,
platform-like-post,
platform-play-game,
platform-validate-event,
question-multiple-choice,
question-open-ended,
question-rate-your-experience,
question-secret-access-code,
question-select-date,
question-select-from-images,
question-select-value-in-range,
question-select-from-list,
question-closed-ended,
question-vote,
spotify-follow,
spotify-listen,
spotify-save,
tiktok-follow,
tiktok-watch,
tiktok-post,
youtube-like,
youtube-comment,
youtube-subscribe
details
Details · object
required

The details of this action such as title, description, bannerUrl, logoUrl

progressPeriod
enum<string>
required

The progress period of the action

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

The maximum number of completions per period for the action

Required range: x >= 0
attributes
Multiple Choice Question · object
required

A multiple choice question with configurable options and correct answer validation. The question text is stored in the details.title field of the action, while technical configuration remains in attributes.

config
ActionConfig · object
required

The configuration settings for this action

xpConfig
User XP Breakdown · object
required

XP breakdown for this action. Can be customized per action or set to match platform config defaults.

videoMetadata
Video Metadata · object
required

Video metadata for actions with video content

createdAt
string
required

The date when this action was created

rewardDistribution
Entity Reward Distribution · object
required

Reward distribution information for this action

createdBy
string
required
actionGroupId
string | null

The action group this action belongs to

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

The index of this action within its action group

availableAsTemplateForOrganisations
string[] | null

List of organisation IDs that can use this action as a template

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

Indicates if this action is available as a template globally across all organisations

updatedAt
string | null
updatedBy
string | null