# Update campaign token unit (Admin) Update an existing token unit in campaign. Admin-only operation. Replaces PUT /campaign/admin/{id}/token-units/{tokenUnitId} Endpoint: PUT /campaign-tokens/{id}/{tokenUnitId} Version: 2.0.2 Security: tenantAdminJWT ## Path parameters: - `id` (string, required) - `tokenUnitId` (string, required) ## Request fields (application/json): - `tokenId` (string, required) Token id - `tokenMetadataIncrementalId` (number) token metadata incremental id for the token unit, this is used to identify the specific token metadata that should be minted - `amount` (number, required) Token unit amount is the amount of tokens that the user will receive when aquiring the token unit - `maxAmount` (number) Token unit max amount, this is the maximum amount of tokens that the user can receive when aquiring the token unit. This is relevant e.g. in campaigns where a user may receive token units per revenue spent etc ## Response 200 fields (application/json): - `name` (string,null, required) Campaign name - `description` (string,null, required) Campaign description - `beneficiaryAccountAddress` (string,null, required) Campaign beneficiary account address - `startDate` (string,null, required) Campaign start date, default is the current date - `endDate` (string,null, required) Campaign end date - `imageUrl` (string,null, required) img url - `externalUrl` (string,null, required) Campaign url - `id` (string, required) Campaign id - `isActive` (boolean, required) Campaign isActive - `isTestnet` (boolean) Campaign isTestnet, this means that the campaign is running on testnet, not mainnet - `trigger` (object,null, required) Campaign trigger: what triggers the campaign, and what are the conditions for the trigger to be activated - `trigger.name` (string, required) Campaign trigger name - `trigger.description` (string) Campaign trigger description - `trigger.maxPerDay` (number,null) Campaign trigger max per day - `trigger.maxPerUser` (number,null) Campaign trigger max per user - `trigger.minCooldownSeconds` (number,null) Campaign trigger min cooldown seconds - `trigger.maxGeoDistanceInMeters` (number,null) Campaign trigger max geo distance to Business in meters - `trigger.requiredUserInfo` (string) Campaign trigger required user info Enum: "id", "email", "instagramAccountId", "externalId", "firstName", "lastName", "accountAddress", "publicProfile", "customData", "isActive", "currentSigningAccountId" - `trigger.triggerType` (string) Campaign trigger type Enum: "CLAIM_BY_USER", "CLAIM_BY_SYSTEM", "CLAIM_BY_BUSINESS" - `trigger.maxMultiplier` (number,null) Campaign trigger max multiplier - `trigger.completionThreshold` (number,null) Campaign trigger completion threshold. This indicates the number of completions required before the reward is granted - `trigger.id` (string, required) Campaign trigger id - `trigger.conditions` (array, required) Campaign trigger conditions - `trigger.conditions.conditionType` (string, required) Trigger condition type Enum: "EQUALS", "NOT_EQUALS", "GREATER_THAN", "LESS_THAN", "CONTAINS", "IS_PART_OF" - `trigger.conditions.value` (object, required) Trigger condition value - `trigger.conditions.key` (string, required) Trigger condition key - `trigger.conditions.id` (string, required) - `tokenUnits` (array, required) - `tokenUnits.id` (string, required) Token unit id - `tokenUnits.token` (object, required) TokenDTO object - `tokenUnits.token.id` (string, required) Id of the token - `tokenUnits.token.contractAddress` (string, required) Address of the token - `tokenUnits.token.metadata` (array) Metadata of the token, this is optional and can be null in case of Point token - `tokenUnits.token.metadata.imageUrl` (string) This is the URL to the image of the item. Can be just about any type of image (including SVGs, which will be cached into PNGs by OpenSea), IPFS or Arweave URLs or paths. We recommend using a minimum 3000 x 3000 image. - `tokenUnits.token.metadata.externalUrl` (string) This is the URL that will appear below the asset's image - `tokenUnits.token.metadata.description` (string) A human-readable description of the item. Markdown is supported. - `tokenUnits.token.metadata.name` (string) Name of the item. - `tokenUnits.token.metadata.expiryDate` (string) expiry date in case of an utility reward - `tokenUnits.token.metadata.animationUrl` (string) A URL to a multi-media attachment for the item. The file extensions GLTF, GLB, WEBM, MP4, M4V, OGV, and OGG are supported, along with the audio-only extensions MP3, WAV, and OGA. Animation_url also supports HTML pages, allowing you to build rich experiences and interactive NFTs using JavaScript canvas, WebGL, and more. Scripts and relative paths within the HTML page are now supported. However, access to browser extensions is not supported. - `tokenUnits.token.metadata.youtubeUrl` (string) A URL to a YouTube video (only used if animation_url is not provide - `tokenUnits.token.metadata.creatorAccountAddress` (string) Creator Address - `tokenUnits.token.metadata.previewUrl` (string) Preview Url - `tokenUnits.token.metadata.id` (string, required) Token Metadata id - `tokenUnits.token.metadata.animationWeb3StorageUrl` (string) web3 storage url for the animation file - `tokenUnits.token.metadata.imageWeb3StorageUrl` (string) web3 storage url for the image - `tokenUnits.token.metadata.web3StorageUrl` (string) Storage Url - `tokenUnits.token.metadata.tokenMetadataIncrementalId` (number, required) Token Metadata Incremental Id - `tokenUnits.token.metadata.isActive` (boolean, required) Is active - `tokenUnits.token.abi` (object, required) this is the abi of the contract, this is the interface of the contract to interact with it - `tokenUnits.token.chainId` (number, required) this is the chain id of the chain where the token is deployed - `tokenUnits.token.abiUrl` (object, required) this is the url of the abi of the contract, to be used to fetch the abi of the contract - `tokenUnits.token.name` (string) this is the name of the token contract - `tokenUnits.token.symbol` (string) this is the symbol of the token contract, this is optional and can be null - `tokenUnits.token.decimals` (number) this is the decimals of the token. This is optional and only used for ERC20 tokens (Points) - `tokenUnits.token.isActive` (boolean, required) This can be used to enable or disable the token - `tokenUnits.token.isGallery` (boolean, required) This can be used to enable or disable the token for gallery - `tokenUnits.token.type` (string, required) This is the underlying web3 native type of the token contract Enum: "ERC20", "ERC1155", "ERC721" - `tokenUnits.tokenMetadataIncrementalId` (number,null) token metadata incremental id for the token unit, this is used to identify the specific token metadata that should be minted - `tokenUnits.amount` (number, required) Token unit amount is the amount of tokens that the user will receive when aquiring the token unit - `tokenUnits.maxAmount` (number,null) Token unit max amount, this is the maximum amount of tokens that the user can receive when aquiring the token unit. This is relevant e.g. in campaigns where a user may receive token units per revenue spent etc - `businessEngagements` (array, required) Campaign businesses: what businesses are involved in the campaign - `businessEngagements.id` (string, required) id - `businessEngagements.shortDescription` (number,null, required) A short description of the business engagement with indications what to do etc - `businessEngagements.businesses` (array, required) businesses - `businessEngagements.businesses.id` (string, required) The id of the business, this is unique and will be used to identify the business. - `businessEngagements.businesses.email` (object,null, required) The email of the business, this is unique and will be used to identify the business. - `businessEngagements.businesses.accountAddress` (object,null, required) The address of the business, this is the address that will be shown to the public. - `businessEngagements.businesses.businessLegalName` (object,null, required) The legal name of the business, this is the name that will be used for legal purposes. - `businessEngagements.businesses.displayName` (object,null, required) The display name of the business, this is the name that will be shown to the public. - `businessEngagements.businesses.description` (object,null, required) The description of the business, this is the description that will be shown to the public. - `businessEngagements.businesses.shortDescription` (object,null, required) The short description of the business, this is the description that will be shown to the public. - `businessEngagements.businesses.websiteUrl` (object,null, required) The website of the business, this is the website that will be shown to the public. - `businessEngagements.businesses.imageUrl` (object,null, required) The image of the business, this is the image that will be shown to the public. - `businessEngagements.businesses.streetAddress` (object,null, required) The address of the business, this is the address that will be shown to the public. - `businessEngagements.businesses.city` (object,null, required) The city of the business, this is the city that will be shown to the public. - `businessEngagements.businesses.postalCode` (object,null, required) The postal code of the business, this is the postal code that will be shown to the public. - `businessEngagements.businesses.coordsLatitude` (object,null, required) The latitude of the business, this is the latitude that will be shown to the public. - `businessEngagements.businesses.coordsLongitude` (object,null, required) The longitude of the business, this is the longitude that will be shown to the public. - `businessEngagements.businesses.businessType` (object,null, required) The business type of the business, this is the business type that will be shown to the public. - `businessEngagements.businesses.businessType.id` (number) Business type id - `businessEngagements.businesses.businessType.name` (string,null, required) Business type name - `businessEngagements.businesses.businessType.description` (string,null, required) Business type description - `businessEngagements.businesses.businessType.code` (string,null, required) Business type code - `businessEngagements.businesses.businessType.iconUrl` (string,null, required) Business type icon url - `businessEngagements.businesses.isActive` (boolean, required) The status of the business, this is the status that will be shown to the public. - `businessEngagements.businesses.canMintToken` (boolean, required) The ability to mint token for the business, this is the ability that will be shown to the public. - `businessEngagements.businesses.canChargeToken` (boolean, required) The ability to charge token for the business, this is the ability that will be shown to the public. - `businessEngagements.businesses.canManageUsers` (boolean, required) The ability to manage users for the business, this is the ability that will be shown to the public. - `businessEngagements.businesses.canReceiveDonation` (boolean, required) The ability to receive donation for the business, this is the ability that will be shown to the public. - `businessEngagements.campaignId` (string, required) Campaign id - `businessEngagements.maxPerBusiness` (number,null, required) max per business, the maximum number of times a user can engage with the buisness in the campaign - `businessEngagements.maxPerDay` (number,null, required) max per day, the maximum number of times a user can engage with the buisness in the campaign per day - `businessEngagements.externalUrl` (string,null, required) The external URL for the business engagement, e.g. a link to a website or app - `createdAt` (string, required) create date - `updatedAt` (string,null, required) update date - `order` (number, required) Campaign order - `tags` (array, required) Campaign tags - `countryCodeRestrictions` (object) Country code restrictions as an array of strings (e.g., ["NOT_ES", "FR"]) Example: ["NOT_ES","FR"]