Skip to main content
POST
/
actions
Create a new action
curl --request POST \
  --url https://{subdomain}.nudj.cx/api/v2/admin/actions \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '{
  "communityId": "<string>",
  "allocationId": "<string>",
  "allocatedTo": "achievement",
  "category": "nudj",
  "key": "facebook-comment",
  "attributes": "<any>",
  "progressPeriod": "daily",
  "maxCompletionsPerPeriod": 1,
  "isGlobalTemplate": true,
  "availableAsTemplateForOrganisations": [
    "<string>"
  ],
  "videoMetadata": {
    "startsAtMs": 1,
    "shouldPause": true,
    "validatesAtMs": 1,
    "endsAtMs": 1
  },
  "details": {
    "title": "<string>",
    "description": "<string>",
    "light": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    },
    "dark": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    }
  },
  "config": {
    "isOptional": true,
    "socialValidation": "validation-on",
    "prerequisites": {
      "requiredActionCount": 123,
      "actionIds": [
        "<string>"
      ]
    },
    "requiresCorrectAnswer": true
  }
}'
{
  "id": "<string>",
  "organisationId": "<string>",
  "communityId": "<string>",
  "allocationId": "<string>",
  "allocatedTo": "achievement",
  "actionGroupId": "<string>",
  "actionGroupIndex": 123,
  "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": "<any>",
  "config": {
    "isOptional": true,
    "socialValidation": "validation-on",
    "prerequisites": {
      "requiredActionCount": 123,
      "actionIds": [
        "<string>"
      ]
    },
    "requiresCorrectAnswer": true
  },
  "videoMetadata": {
    "startsAtMs": 1,
    "shouldPause": true,
    "validatesAtMs": 1,
    "endsAtMs": 1
  },
  "createdAt": "<string>",
  "availableAsTemplateForOrganisations": [
    "<string>"
  ],
  "isGlobalTemplate": true,
  "createdBy": "<string>",
  "updatedAt": "<string>",
  "updatedBy": "<string>"
}

Authorizations

x-api-token
string
header
required

Body

application/json

The input required to create an action

communityId
string
required

The community that the action belongs to

allocationId
string | null
required

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

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,
post,
reward,
reward-asset,
reward-entry
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
attributes
object
required

The attributes of an action 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.

  • Multiple Choice Question
  • Open Ended Question
  • Rate Your Experience Question
  • Secret Access Code Question
  • Select From Images Question
  • Select From List Question
  • Single Fixed Answer Question
  • Vote Question
  • Select A Date Question
  • Select Value In Range Question
  • Engage With Content Interaction
  • Action Attributes
  • Spot Object Action
  • Object Detection Action Attributes
  • Receipt Detection Action Attributes
  • Facebook Comment Action Attributes
  • Facebook Follow Action Attributes
  • Facebook Like Action Attributes
  • Instagram Follow Action Attributes
  • Instagram Like Action Attributes
  • Instagram Comment Action Attributes
  • Instagram Share Action Attributes
  • Instagram Post Action Attributes
  • Comment On Post Action Attributes
  • Complete Achievement Action Attributes
  • Generative Action Attributes
  • Like Post Action Attributes
  • Play Game Action Attributes
  • Validate Event Action Attributes
  • Spotify Follow Action Attributes
  • Spotify Listen Action Attributes
  • Spotify Save Action Attributes
  • Youtube Comment Action Attributes
  • Youtube Subscribe Action Attributes
  • Youtube Like Action Attributes
  • TikTok Follow Action Attributes
  • TikTok Post Video With Hashtag Action Attributes
  • TikTok Watch Video Action Attributes
details
object
required

Input for creating entity details with required title

progressPeriod
enum<string>

The progress period of the action

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

The maximum number of completions per period for the action

Required range: x >= 0
isGlobalTemplate
boolean | null

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

availableAsTemplateForOrganisations
string[] | null

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

videoMetadata
object | null

Video metadata for actions with video content

config
object

Used to configure an action

Response

Successful response

An action

id
string
required

The id of the action

organisationId
string
required

The organisation that the action belongs to

communityId
string
required

The community that the action belongs to

allocationId
string | null
required

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

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,
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
object
required

Used to describe an entity 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
object
required

The attributes of an action 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.

  • Multiple Choice Question
  • Open Ended Question
  • Rate Your Experience Question
  • Secret Access Code Question
  • Select From Images Question
  • Select From List Question
  • Single Fixed Answer Question
  • Vote Question
  • Select A Date Question
  • Select Value In Range Question
  • Engage With Content Interaction
  • Action Attributes
  • Spot Object Action
  • Object Detection Action Attributes
  • Receipt Detection Action Attributes
  • Facebook Comment Action Attributes
  • Facebook Follow Action Attributes
  • Facebook Like Action Attributes
  • Instagram Follow Action Attributes
  • Instagram Like Action Attributes
  • Instagram Comment Action Attributes
  • Instagram Share Action Attributes
  • Instagram Post Action Attributes
  • Comment On Post Action Attributes
  • Complete Achievement Action Attributes
  • Generative Action Attributes
  • Like Post Action Attributes
  • Play Game Action Attributes
  • Validate Event Action Attributes
  • Spotify Follow Action Attributes
  • Spotify Listen Action Attributes
  • Spotify Save Action Attributes
  • Youtube Comment Action Attributes
  • Youtube Subscribe Action Attributes
  • Youtube Like Action Attributes
  • TikTok Follow Action Attributes
  • TikTok Post Video With Hashtag Action Attributes
  • TikTok Watch Video Action Attributes
config
object
required

Used to configure an action The configuration settings for this action

videoMetadata
object | null
required

Video metadata for actions with video content

createdAt
string
required

The date when this action was created

createdBy
string
required
actionGroupId
string | null

The action group this action belongs to

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

isGlobalTemplate
boolean | null

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

updatedAt
string | null
updatedBy
string | null
I