Skip to main content
POST
/
rewards
/
{id}
Update a reward by id
curl --request POST \
  --url https://{subdomain}.nudj.cx/api/v2/admin/rewards/{id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '{
  "additionalCommunityIds": [
    "<string>"
  ],
  "assetPointsPrice": 1,
  "isManualGiveaway": true,
  "entryPointsPrice": 1,
  "allocationsType": "assets-only",
  "isSharedAssetsSupply": true,
  "isSharedEntriesSupply": 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>"
  },
  "tags": [
    "<string>"
  ],
  "campaigns": [
    "<string>"
  ],
  "featured": true,
  "status": "archived",
  "startsAt": "<string>",
  "expiresAt": "<string>",
  "drawsAt": "<string>",
  "isGlobalTemplate": true,
  "availableAsTemplateForOrganisations": [
    "<string>"
  ],
  "details": {
    "title": "<string>",
    "description": "<string>",
    "light": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    },
    "dark": {
      "primaryImageUrl": "<string>",
      "secondaryImageUrl": "<string>"
    }
  },
  "assetsSupply": 1,
  "entriesSupply": 1,
  "maxAssetsPerUser": 2,
  "maxEntriesPerUser": 2,
  "allocations": [
    {
      "id": "<string>",
      "supply": 1,
      "amountToDistribute": 2,
      "isShop": true,
      "isLive": true
    }
  ],
  "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

Headers

x-language
string

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

Path Parameters

id
string
required

The id of the reward to update

Body

application/json

The input required to update a reward

additionalCommunityIds
string[]

The additional communities this reward is available in

assetPointsPrice
number

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
isManualGiveaway
boolean

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

entryPointsPrice
number

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>

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

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.

redemptionConfig
object

A reward redemption config A reward redemption config rich text

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

Tags associated with this reward

campaigns
string[]

Campaigns this reward is part of

Whether this reward is featured

status
enum<string>

The current status of this reward

Available options:
archived,
draft,
expired,
live,
scheduled
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

isGlobalTemplate
boolean

Whether the reward is a global template

availableAsTemplateForOrganisations
string[]

The organisations that the reward is available as a template for

details
object

Input for updating entity details with all fields optional

assetsSupply

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

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

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
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