> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nudj.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a reward

> Create a new reward.



## OpenAPI

````yaml /openapi/admin.json post /rewards
openapi: 3.1.0
info:
  title: Nudj Admin API
  version: 1.0.0
servers:
  - url: https://{subdomain}.nudj.cx/api/v2/admin
    description: Organization API Server
    variables:
      subdomain:
        description: Your organization's subdomain (required)
        default: your-org
security:
  - ApiToken: []
paths:
  /rewards:
    post:
      tags:
        - Reward
      summary: Create a reward
      description: Create a new reward.
      operationId: createReward
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                communityId:
                  type: string
                  description: The community this reward belongs to
                assetPointsPrice:
                  type: number
                  minimum: 0
                  description: >-
                    The points cost to acquire one asset of this reward. Must be
                    > 0 if allocationsType is assets-only or assets-and-entries.
                entryPointsPrice:
                  type: number
                  minimum: 0
                  description: >-
                    The points cost to acquire one entry for this reward. Must
                    be > 0 if allocationsType is entries-only or
                    assets-and-entries.
                allocationsType:
                  type: string
                  enum:
                    - assets-only
                    - entries-only
                    - assets-and-entries
                  description: >-
                    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.
                redemptionConfig:
                  $ref: '#/components/schemas/RewardRedemptionConfig'
                details:
                  $ref: '#/components/schemas/DetailsCreateInput'
                status:
                  type: string
                  enum:
                    - archived
                    - draft
                    - expired
                    - live
                    - scheduled
                  description: >-
                    Set the reward status, by default will be set to draft if
                    not provided
                additionalCommunityIds:
                  type: array
                  items:
                    type: string
                  description: The additional communities this reward is available in
                assetsSupply:
                  anyOf:
                    - type: number
                      minimum: 0
                    - type: string
                      const: Infinity
                    - type: 'null'
                entriesSupply:
                  anyOf:
                    - type: number
                      minimum: 0
                    - type: string
                      const: Infinity
                    - type: 'null'
                maxAssetsPerUser:
                  anyOf:
                    - type: number
                      minimum: 1
                    - type: string
                      const: Infinity
                    - type: 'null'
                  description: >-
                    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.
                maxEntriesPerUser:
                  anyOf:
                    - type: number
                      minimum: 1
                    - type: string
                      const: Infinity
                    - type: 'null'
                  description: >-
                    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.
                allocations:
                  type:
                    - array
                    - 'null'
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The ID of this allocation
                      supply:
                        anyOf:
                          - type: number
                            minimum: 0
                          - type: string
                            const: Infinity
                        description: >-
                          The total supply of this allocation. Only used if
                          isSharedAssetsSupply or isSharedEntriesSupply is false
                          on the reward otherwise it should be 0.
                      amountToDistribute:
                        type: number
                        minimum: 1
                        description: >-
                          The quantity of this specific reward to distribute
                          when this allocation is selected. For example, if
                          amountToDistribute is 3, then 3 units of this reward
                          will be given to the recipient.
                      isShop:
                        type: boolean
                        description: Whether this allocation is for the shop
                      isLive:
                        type: boolean
                        description: Whether this allocation is live
                    required:
                      - id
                      - supply
                      - amountToDistribute
                      - isShop
                      - isLive
                isSharedAssetsSupply:
                  type: boolean
                  description: >-
                    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:
                  type: boolean
                  description: >-
                    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:
                  type: array
                  items:
                    type: string
                  description: Tags associated with this reward
                campaigns:
                  type: array
                  items:
                    type: string
                  description: Campaigns this reward is part of
                featured:
                  type:
                    - boolean
                    - 'null'
                  description: Whether this reward is featured
                startsAt:
                  type:
                    - string
                    - 'null'
                  description: When this reward becomes available
                expiresAt:
                  type:
                    - string
                    - 'null'
                  description: When this reward expires (or giveaway takes place)
                drawsAt:
                  type:
                    - string
                    - 'null'
                  description: When this reward giveaway will be drawn
                isManualGiveaway:
                  type: boolean
                  description: >-
                    Whether the giveaway should be manual (true) or automatic
                    (false)
                isGlobalTemplate:
                  type: boolean
                  description: Whether the reward is a global template
                availableAsTemplateForOrganisations:
                  type: array
                  items:
                    type: string
                  description: >-
                    The organisations that the reward is available as a template
                    for
                metadata:
                  type:
                    - object
                    - 'null'
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: number
                      - type: boolean
                      - type: array
                        items:
                          anyOf:
                            - type: string
                            - type: number
                            - type: boolean
                  description: Additional metadata to store with the reward
              required:
                - communityId
                - assetPointsPrice
                - entryPointsPrice
                - allocationsType
                - redemptionConfig
                - details
                - assetsSupply
                - entriesSupply
              description: The input required to create a reward
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reward'
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
components:
  schemas:
    RewardRedemptionConfig:
      oneOf:
        - $ref: '#/components/schemas/RewardRedemptionConfigRichText'
        - $ref: '#/components/schemas/RewardRedemptionConfigCode'
        - $ref: '#/components/schemas/RewardRedemptionConfigBadge'
        - $ref: '#/components/schemas/RewardRedemptionConfigShopify'
      discriminator:
        propertyName: type
        mapping:
          rich-text:
            $ref: '#/components/schemas/RewardRedemptionConfigRichText'
          code:
            $ref: '#/components/schemas/RewardRedemptionConfigCode'
          badge:
            $ref: '#/components/schemas/RewardRedemptionConfigBadge'
          shopify:
            $ref: '#/components/schemas/RewardRedemptionConfigShopify'
      description: A reward redemption config
      title: Reward Redemption Config
    DetailsCreateInput:
      type: object
      properties:
        title:
          type: string
          description: The title of the entity
        description:
          type:
            - string
            - 'null'
          description: The description of the entity
        light:
          type: object
          properties:
            primaryImageUrl:
              type:
                - string
                - 'null'
              description: The url of the primary image for this theme mode
            secondaryImageUrl:
              type:
                - string
                - 'null'
              description: The url of the secondary image for this theme mode
          description: Light theme images
        dark:
          type: object
          properties:
            primaryImageUrl:
              type:
                - string
                - 'null'
              description: The url of the primary image for this theme mode
            secondaryImageUrl:
              type:
                - string
                - 'null'
              description: The url of the secondary image for this theme mode
          description: Dark theme images
      required:
        - title
      description: Input for creating entity details with required title
      title: Details Create Input
    Reward:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the reward
        organisationId:
          type: string
          description: The organisation this reward belongs to
        communityId:
          type: string
          description: The community this reward belongs to
        additionalCommunityIds:
          type: array
          items:
            type: string
          description: The additional communities this reward is available in
        details:
          $ref: '#/components/schemas/Details'
        assetPointsPrice:
          type: number
          minimum: 0
          description: >-
            The points cost to acquire one asset of this reward. Must be > 0 if
            allocationsType is assets-only or assets-and-entries.
        assetPointsSwapValue:
          type: number
          minimum: 0
          description: >-
            [Not yet implemented] The points value received when swapping this
            reward asset back. If 0, asset cannot be swapped.
        entryPointsPrice:
          type: number
          minimum: 0
          description: >-
            The points cost to acquire one entry for this reward. Must be > 0 if
            allocationsType is entries-only or assets-and-entries.
        assetsSupply:
          anyOf:
            - type: number
              minimum: 0
            - type: string
              const: Infinity
          description: >-
            The total supply of assets available for this reward. Must be > 0 if
            allocationsType is assets-only or assets-and-entries.
        entriesSupply:
          anyOf:
            - type: number
              minimum: 0
            - type: string
              const: Infinity
          description: >-
            The total supply of entries available for this reward. Must be > 0
            if allocationsType is entries-only or assets-and-entries.
        maxAssetsPerUser:
          anyOf:
            - type: number
              minimum: 1
            - type: string
              const: Infinity
          description: >-
            Maximum number of assets a single user can acquire through any
            distribution. Must be > 0 if allocationsType is assets-only or
            assets-and-entries.
        maxEntriesPerUser:
          anyOf:
            - type: number
              minimum: 1
            - type: string
              const: Infinity
          description: >-
            Maximum number of entries a single user can acquire through any
            distribution. Must be > 0 if allocationsType is entries-only or
            assets-and-entries.
        allocationsType:
          type: string
          enum:
            - assets-only
            - entries-only
            - assets-and-entries
          description: >-
            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.
        isSharedAssetsSupply:
          type: boolean
          description: >-
            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:
          type: boolean
          description: >-
            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:
          type: array
          items:
            $ref: '#/components/schemas/RewardAllocation'
          description: The allocations configured for this reward
        redemptionConfig:
          $ref: '#/components/schemas/RewardRedemptionConfig'
        featured:
          type:
            - boolean
            - 'null'
          description: Whether this reward is featured
        tags:
          type: array
          items:
            type: string
          description: Tags associated with this reward
        campaigns:
          type: array
          items:
            type: string
          description: Campaigns this reward is part of
        status:
          type: string
          enum:
            - archived
            - draft
            - expired
            - live
            - scheduled
          description: The current status of this reward
        drawsAt:
          type:
            - string
            - 'null'
          description: When this reward giveaway will be drawn
        startsAt:
          type:
            - string
            - 'null'
          description: When this reward becomes available
        expiresAt:
          type:
            - string
            - 'null'
          description: When this reward expires (or giveaway takes place)
        isManualGiveaway:
          type: boolean
          description: Whether the giveaway should be manual (true) or automatic (false)
        availableAsTemplateForOrganisations:
          type: array
          items:
            type: string
          description: The organisations that the reward is available as a template for
        isGlobalTemplate:
          type: boolean
          description: Whether the reward is a global template
        metadata:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
              - type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
                    - type: boolean
          description: Additional metadata for the reward
        createdAt:
          type: string
          description: When this reward was created
        updatedAt:
          type: string
          description: When this reward was last updated
        createdBy:
          type: string
          description: The user who created this reward
        updatedBy:
          type: string
          description: The user who last updated this reward
      required:
        - id
        - organisationId
        - communityId
        - additionalCommunityIds
        - details
        - assetPointsPrice
        - assetPointsSwapValue
        - entryPointsPrice
        - assetsSupply
        - entriesSupply
        - maxAssetsPerUser
        - maxEntriesPerUser
        - allocationsType
        - isSharedAssetsSupply
        - isSharedEntriesSupply
        - allocations
        - redemptionConfig
        - tags
        - campaigns
        - status
        - isManualGiveaway
        - availableAsTemplateForOrganisations
        - isGlobalTemplate
        - metadata
        - createdAt
        - updatedAt
        - createdBy
        - updatedBy
      description: A reward
      title: Reward
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Error
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Internal server error
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Error
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
    RewardRedemptionConfigRichText:
      type: object
      properties:
        instructions:
          type:
            - string
            - 'null'
          description: Instructions for redeeming this reward. HTML is supported.
        instructionsImageUrl:
          type:
            - string
            - 'null'
          description: The URL of an image to display with the instructions
        supportEmail:
          type:
            - string
            - 'null'
          format: email
          description: The email address of the support team
        supportPhoneNumber:
          type:
            - string
            - 'null'
          description: The phone number of the support team
        supportUrl:
          type:
            - string
            - 'null'
          description: The URL of the support team
        type:
          type: string
          const: rich-text
          description: Rich text redemption config
        additionalInformation:
          type: array
          items:
            $ref: '#/components/schemas/VariableConfigReference'
          description: >-
            Configurable form fields to collect additional user information when
            user redeems the reward. Each field (e.g., email, phone, address) is
            defined by a variable config that specifies its type, validation
            rules, and display order.
        redeemByDate:
          type:
            - string
            - 'null'
          description: The date by which the reward can be redeemed
        autoRedeem:
          type: boolean
          description: Whether the reward should be automatically redeemed when claimed
          example: false
        content:
          type: string
          description: The rich text content. HTML is supported.
      required:
        - type
        - additionalInformation
        - autoRedeem
        - content
      description: A reward redemption config rich text
      title: RewardRedemptionConfigRichText
    RewardRedemptionConfigCode:
      type: object
      properties:
        instructions:
          type:
            - string
            - 'null'
          description: Instructions for redeeming this reward. HTML is supported.
        instructionsImageUrl:
          type:
            - string
            - 'null'
          description: The URL of an image to display with the instructions
        supportEmail:
          type:
            - string
            - 'null'
          format: email
          description: The email address of the support team
        supportPhoneNumber:
          type:
            - string
            - 'null'
          description: The phone number of the support team
        supportUrl:
          type:
            - string
            - 'null'
          description: The URL of the support team
        type:
          type: string
          const: code
          description: Code redemption config
        additionalInformation:
          type: array
          items:
            $ref: '#/components/schemas/VariableConfigReference'
          description: >-
            Configurable form fields to collect additional user information when
            user redeems the reward. Each field (e.g., email, phone, address) is
            defined by a variable config that specifies its type, validation
            rules, and display order.
        redeemByDate:
          type:
            - string
            - 'null'
          description: The date by which the reward can be redeemed
        autoRedeem:
          type: boolean
          description: Whether the reward should be automatically redeemed when claimed
          example: false
        prefix:
          type:
            - string
            - 'null'
        displayMode:
          type: string
          enum:
            - text
            - link
            - barcode-code128
            - barcode-code39
            - barcode-code39ext
            - barcode-upca
            - barcode-upce
            - barcode-ean13
            - barcode-ean8
            - barcode-ean5
            - barcode-ean2
            - barcode-itf14
            - barcode-interleaved2of5
            - barcode-qr
            - barcode-datamatrix
            - barcode-pdf417
            - barcode-azteccode
            - shopify-code-and-store-link
            - shopify-checkout-link
          description: Display mode for code redemption
        store:
          type: string
          enum:
            - none
            - mongodb
          description: The store where the code can be retrieved
        code:
          type:
            - string
            - 'null'
          description: The code to redeem
      required:
        - type
        - additionalInformation
        - autoRedeem
        - displayMode
        - store
      description: A reward redemption config code
      title: RewardRedemptionConfigCode
    RewardRedemptionConfigBadge:
      type: object
      properties:
        instructions:
          type:
            - string
            - 'null'
          description: Instructions for redeeming this reward. HTML is supported.
        instructionsImageUrl:
          type:
            - string
            - 'null'
          description: The URL of an image to display with the instructions
        supportEmail:
          type:
            - string
            - 'null'
          format: email
          description: The email address of the support team
        supportPhoneNumber:
          type:
            - string
            - 'null'
          description: The phone number of the support team
        supportUrl:
          type:
            - string
            - 'null'
          description: The URL of the support team
        type:
          type: string
          const: badge
          description: Badge redemption config
        additionalInformation:
          type: array
          items:
            $ref: '#/components/schemas/VariableConfigReference'
          description: >-
            Configurable form fields to collect additional user information when
            user redeems the reward. Each field (e.g., email, phone, address) is
            defined by a variable config that specifies its type, validation
            rules, and display order.
        redeemByDate:
          type:
            - string
            - 'null'
          description: The date by which the reward can be redeemed
        autoRedeem:
          type: boolean
          description: Whether the reward should be automatically redeemed when claimed
          example: false
      required:
        - type
        - additionalInformation
        - autoRedeem
      description: A reward redemption config for badges
      title: Reward Redemption Config Badge
    RewardRedemptionConfigShopify:
      type: object
      properties:
        instructions:
          type:
            - string
            - 'null'
          description: Instructions for redeeming this reward. HTML is supported.
        instructionsImageUrl:
          type:
            - string
            - 'null'
          description: The URL of an image to display with the instructions
        supportEmail:
          type:
            - string
            - 'null'
          format: email
          description: The email address of the support team
        supportPhoneNumber:
          type:
            - string
            - 'null'
          description: The phone number of the support team
        supportUrl:
          type:
            - string
            - 'null'
          description: The URL of the support team
        type:
          type: string
          const: shopify
          description: Shopify discount redemption config
        additionalInformation:
          type: array
          items:
            $ref: '#/components/schemas/VariableConfigReference'
          description: >-
            Configurable form fields to collect additional user information when
            user redeems the reward. Each field (e.g., email, phone, address) is
            defined by a variable config that specifies its type, validation
            rules, and display order.
        redeemByDate:
          type:
            - string
            - 'null'
          description: The date by which the reward can be redeemed
        autoRedeem:
          type: boolean
          description: Whether the reward should be automatically redeemed when claimed
          example: false
        displayMode:
          type: string
          enum:
            - text
            - link
            - barcode-code128
            - barcode-code39
            - barcode-code39ext
            - barcode-upca
            - barcode-upce
            - barcode-ean13
            - barcode-ean8
            - barcode-ean5
            - barcode-ean2
            - barcode-itf14
            - barcode-interleaved2of5
            - barcode-qr
            - barcode-datamatrix
            - barcode-pdf417
            - barcode-azteccode
            - shopify-code-and-store-link
            - shopify-checkout-link
          description: Display mode for Shopify discount redemption
        shopifyStoreLink:
          type: string
          description: >-
            The Shopify store URL to use for the discount redemption. Useful if
            the store has a custom domain, or you want to redirect to a specific
            product page.
        prefix:
          type: string
          description: The prefix for the Shopify discount code
        shopifyDiscountId:
          type: string
          description: The Shopify discount ID
      required:
        - type
        - additionalInformation
        - autoRedeem
        - displayMode
        - shopifyStoreLink
        - prefix
        - shopifyDiscountId
      description: A reward redemption config based on a Shopify discount
      title: RewardRedemptionConfigShopify
    Details:
      type: object
      properties:
        title:
          type: string
          description: The title of the entity
        description:
          type:
            - string
            - 'null'
          description: The description of the entity
        light:
          type: object
          properties:
            primaryImageUrl:
              type:
                - string
                - 'null'
              description: The url of the primary image for this theme mode
            secondaryImageUrl:
              type:
                - string
                - 'null'
              description: The url of the secondary image for this theme mode
          required:
            - primaryImageUrl
            - secondaryImageUrl
          description: Light theme images
        dark:
          type: object
          properties:
            primaryImageUrl:
              type:
                - string
                - 'null'
              description: The url of the primary image for this theme mode
            secondaryImageUrl:
              type:
                - string
                - 'null'
              description: The url of the secondary image for this theme mode
          required:
            - primaryImageUrl
            - secondaryImageUrl
          description: Dark theme images
      required:
        - title
        - description
        - light
        - dark
      description: Used to describe an entity
      title: Details
    RewardAllocation:
      type: object
      properties:
        id:
          type: string
          description: The ID of this allocation
        allocationType:
          type: string
          enum:
            - assets
            - entries
          description: >-
            The type of allocation, either assets or entries. If the reward has
            a type of assets-and-entries, this allocation can have both assets
            and entries. Otherwise, it can only have one type matching the
            reward's allocation type.
        supply:
          anyOf:
            - type: number
              minimum: 0
            - type: string
              const: Infinity
          description: >-
            The total supply of this allocation. Only used if
            isSharedAssetsSupply or isSharedEntriesSupply is false on the
            reward.
        amountToDistribute:
          type: number
          minimum: 1
          description: >-
            The quantity of this specific reward to distribute when this
            allocation is selected. For example, if amountToDistribute is 3,
            then 3 units of this reward will be given to the recipient.
        distributed:
          type: number
          minimum: 0
          description: The amount already distributed for this allocation
        isShop:
          type: boolean
          description: Whether this allocation is for the shop
        isLive:
          type: boolean
          description: Whether this allocation is live
      required:
        - id
        - allocationType
        - supply
        - amountToDistribute
        - distributed
        - isShop
        - isLive
      description: A reward allocation
      title: RewardAllocation
    VariableConfigReference:
      type: object
      properties:
        variableConfigId:
          type: string
          pattern: ^[0-9a-fA-F]{24}$
          description: >-
            The ID of the variable config that defines the data type, validation
            rules, and UI rendering
        required:
          type: boolean
          description: >-
            Whether this variable must be filled out by the user before
            proceeding
        position:
          type: number
          minimum: 1
          description: The display order position of this variable in the form or UI
      required:
        - variableConfigId
        - required
        - position
      title: Variable Config Reference
      description: >-
        A reference to a variable configuration that defines a form field or
        data collection point, including its display order, requirement status,
        and validation rules. Used to specify what information to collect from
        users in forms, communities, and other data collection contexts.
  securitySchemes:
    ApiToken:
      type: apiKey
      in: header
      name: x-api-token

````