Skip to main content
POST
/
rewards
Create a reward
curl --request POST \
  --url https://{subdomain}.nudj.cx/api/v2/admin/rewards \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '{
  "communityId": "<string>",
  "assetPointsPrice": 1,
  "entryPointsPrice": 1,
  "allocationsType": "assets-only",
  "redemptionConfig": {
    "instructions": "<string>",
    "instructionsImageUrl": "<string>",
    "supportEmail": "jsmith@example.com",
    "supportPhoneNumber": "<string>",
    "supportUrl": "<string>",
    "type": "<string>",
    "additionalInformation": [
      {
        "variableConfigId": "<string>",
        "required": true,
        "position": 2
      }
    ],
    "redeemByDate": "<string>",
    "autoRedeem": false,
    "content": "<string>"
  },
  "details": {
    "title": "<string>",
    "description": "<string>",
    "light": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    },
    "dark": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    }
  },
  "status": "archived",
  "additionalCommunityIds": [
    "<string>"
  ],
  "assetsSupply": 1,
  "entriesSupply": 1,
  "maxAssetsPerUser": 2,
  "maxEntriesPerUser": 2,
  "allocations": [
    {
      "id": "<string>",
      "supply": 1,
      "amountToDistribute": 2,
      "isShop": true,
      "isLive": true
    }
  ],
  "isSharedAssetsSupply": true,
  "isSharedEntriesSupply": true,
  "tags": [
    "<string>"
  ],
  "campaigns": [
    "<string>"
  ],
  "featured": true,
  "startsAt": "<string>",
  "expiresAt": "<string>",
  "drawsAt": "<string>",
  "isManualGiveaway": true,
  "isGlobalTemplate": true,
  "availableAsTemplateForOrganisations": [
    "<string>"
  ],
  "metadata": {}
}'
{
  "id": "<string>",
  "organisationId": "<string>",
  "communityId": "<string>",
  "additionalCommunityIds": [
    "<string>"
  ],
  "details": {
    "title": "<string>",
    "description": "<string>",
    "light": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    },
    "dark": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    }
  },
  "assetPointsPrice": 1,
  "assetPointsSwapValue": 1,
  "entryPointsPrice": 1,
  "assetsSupply": 1,
  "entriesSupply": 1,
  "maxAssetsPerUser": 2,
  "maxEntriesPerUser": 2,
  "allocationsType": "assets-only",
  "isSharedAssetsSupply": true,
  "isSharedEntriesSupply": true,
  "allocations": [
    {
      "id": "<string>",
      "allocationType": "assets",
      "supply": 1,
      "amountToDistribute": 2,
      "distributed": 1,
      "isShop": true,
      "isLive": true
    }
  ],
  "redemptionConfig": {
    "instructions": "<string>",
    "instructionsImageUrl": "<string>",
    "supportEmail": "jsmith@example.com",
    "supportPhoneNumber": "<string>",
    "supportUrl": "<string>",
    "type": "<string>",
    "additionalInformation": [
      {
        "variableConfigId": "<string>",
        "required": true,
        "position": 2
      }
    ],
    "redeemByDate": "<string>",
    "autoRedeem": false,
    "content": "<string>"
  },
  "featured": true,
  "tags": [
    "<string>"
  ],
  "campaigns": [
    "<string>"
  ],
  "status": "archived",
  "drawsAt": "<string>",
  "startsAt": "<string>",
  "expiresAt": "<string>",
  "isManualGiveaway": true,
  "availableAsTemplateForOrganisations": [
    "<string>"
  ],
  "isGlobalTemplate": true,
  "metadata": {},
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "createdBy": "<string>",
  "updatedBy": "<string>"
}

Authorizations

x-api-token
string
header
required

Body

application/json

The input required to create a reward

communityId
string
required

The community this reward belongs to

assetPointsPrice
number
required

The points cost to acquire one asset of this reward. Must be > 0 if allocationsType is assets-only or assets-and-entries.

Required range: x >= 0
entryPointsPrice
number
required

The points cost to acquire one entry for this reward. Must be > 0 if allocationsType is entries-only or assets-and-entries.

Required range: x >= 0
allocationsType
enum<string>
required

The type of allocations for this reward. assets-only means only assets are allocable, entries-only means only entries are allocable, and assets-and-entries means both assets and entries are allocable.

Available options:
assets-only,
entries-only,
assets-and-entries
redemptionConfig
object
required

A reward redemption config A reward redemption config rich text

  • RewardRedemptionConfigRichText
  • RewardRedemptionConfigCode
  • Reward Redemption Config Badge
details
object
required

Input for creating entity details with required title

assetsSupply
required
Required range: x >= 0
entriesSupply
required
Required range: x >= 0
status
enum<string>

Set the reward status, by default will be set to draft if not provided

Available options:
archived,
draft,
expired,
live,
scheduled
additionalCommunityIds
string[]

The additional communities this reward is available in

maxAssetsPerUser

Maximum number of assets a single user can acquire through any distribution. Must be > 0 if allocationsType is assets-only or assets-and-entries. Optional, defaults to Infinity on Create.

Required range: x >= 1
maxEntriesPerUser

Maximum number of entries a single user can acquire through any distribution. Must be > 0 if allocationsType is entries-only or assets-and-entries. Optional, defaults to Infinity on Create.

Required range: x >= 1
allocations
object[] | null
isSharedAssetsSupply
boolean

Whether the assets supply is shared across allocations. If true, the total supply of assets across all allocations will be capped at the value set here. If false, each allocation will use its own supply value.

isSharedEntriesSupply
boolean

Whether the entries supply is shared across allocations. If true, the total supply of entries across all allocations will be capped at the value set here. If false, each allocation will use its own supply value.

tags
string[]

Tags associated with this reward

campaigns
string[]

Campaigns this reward is part of

Whether this reward is featured

startsAt
string | null

When this reward becomes available

expiresAt
string | null

When this reward expires (or giveaway takes place)

drawsAt
string | null

When this reward giveaway will be drawn

isManualGiveaway
boolean

Whether the giveaway should be manual (true) or automatic (false)

isGlobalTemplate
boolean

Whether the reward is a global template

availableAsTemplateForOrganisations
string[]

The organisations that the reward is available as a template for

metadata
object | null

Additional metadata to store with the reward

Response

Successful response

A reward

id
string
required

The unique identifier of the reward

organisationId
string
required

The organisation this reward belongs to

communityId
string
required

The community this reward belongs to

additionalCommunityIds
string[]
required

The additional communities this reward is available in

details
object
required

Used to describe an entity

assetPointsPrice
number
required

The points cost to acquire one asset of this reward. Must be > 0 if allocationsType is assets-only or assets-and-entries.

Required range: x >= 0
assetPointsSwapValue
number
required

[Not yet implemented] The points value received when swapping this reward asset back. If 0, asset cannot be swapped.

Required range: x >= 0
entryPointsPrice
number
required

The points cost to acquire one entry for this reward. Must be > 0 if allocationsType is entries-only or assets-and-entries.

Required range: x >= 0
assetsSupply
required

The total supply of assets available for this reward. Must be > 0 if allocationsType is assets-only or assets-and-entries.

Required range: x >= 0
entriesSupply
required

The total supply of entries available for this reward. Must be > 0 if allocationsType is entries-only or assets-and-entries.

Required range: x >= 0
maxAssetsPerUser
required

Maximum number of assets a single user can acquire through any distribution. Must be > 0 if allocationsType is assets-only or assets-and-entries.

Required range: x >= 1
maxEntriesPerUser
required

Maximum number of entries a single user can acquire through any distribution. Must be > 0 if allocationsType is entries-only or assets-and-entries.

Required range: x >= 1
allocationsType
enum<string>
required

The type of allocations for this reward. assets-only means only assets are allocable, entries-only means only entries are allocable, and assets-and-entries means both assets and entries are allocable.

Available options:
assets-only,
entries-only,
assets-and-entries
isSharedAssetsSupply
boolean
required

Whether the assets supply is shared across allocations. If true, the total supply of assets across all allocations will be capped at the value set here. If false, each allocation will use its own supply value.

isSharedEntriesSupply
boolean
required

Whether the entries supply is shared across allocations. If true, the total supply of entries across all allocations will be capped at the value set here. If false, each allocation will use its own supply value.

allocations
RewardAllocation · object[]
required

The allocations configured for this reward

redemptionConfig
object
required

A reward redemption config A reward redemption config rich text

  • RewardRedemptionConfigRichText
  • RewardRedemptionConfigCode
  • Reward Redemption Config Badge
tags
string[]
required

Tags associated with this reward

campaigns
string[]
required

Campaigns this reward is part of

status
enum<string>
required

The current status of this reward

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

Whether the giveaway should be manual (true) or automatic (false)

availableAsTemplateForOrganisations
string[]
required

The organisations that the reward is available as a template for

isGlobalTemplate
boolean
required

Whether the reward is a global template

metadata
object
required

Additional metadata for the reward

createdAt
string
required

When this reward was created

updatedAt
string
required

When this reward was last updated

createdBy
string
required

The user who created this reward

updatedBy
string
required

The user who last updated this reward

Whether this reward is featured

drawsAt
string | null

When this reward giveaway will be drawn

startsAt
string | null

When this reward becomes available

expiresAt
string | null

When this reward expires (or giveaway takes place)

I