Create Loyalty Rule
Create a new Loyalty Rule
Create a new Loyalty Rule
Authorizations
API key passed in the header.
Body
Body
organizationIdstring<uuid>requiredUnique identifier for the organization creating the rule
websiteIdstring<uuid>requiredUnique identifier for the associated website
backgroundAssetUrlstringURL of the background asset to be displayed
namestringrequiredName of the loyalty rule
>= 1descriptionstringOptional detailed description of the rule
network"abstract" | "abstractTestnet" | "apechain" | "arbitrum" | "avalanche" | "avalancheFuji" | "base" | "baseSepolia" | "berachain" | "berachainArtio" | "berachainBepolia" | "binance" | "bscTestnet" | "campTestnet" | "fantom" | "fantomTestnet" | "flowMainnet" | "mainnet" | "nexus" | "nexusTestnet" | "optimism" | "polygon" | "polygon_mumbai" | "skaleNebula" | "skaleEuropa" | "skaleCalypso" | "solana" | "sophon" | "sophonTestnet" | "sui" | "superseed" | "superseedSepolia" | "vanar" | "xai" | "zksync" | "coti" | "cotiTestnet" | "dogeosTestnet" | "morph" | "morphTestnet" | "morphHolesky" | "ultra" | "ultraTestnet" | "nitrograph" | "sepolia" | "optimism_sepolia" | "arbitrumSepolia" | "goerli" | "optimism_goerli" | "arbitrumGoerli" | "basecamp" | "somnia" | "zkverify" | "polkadot" | "kusama" | "horizen" | "horizenTestnet" | "robinhoodChain" | "robinhoodChainTestnet" | "flow_cadence"Blockchain network where the rule will apply
"abstract" | "abstractTestnet" | "apechain" | "arbitrum" | "avalanche" | "avalancheFuji" | "base" | "baseSepolia" | "berachain" | "berachainArtio" | "berachainBepolia" | "binance" | "bscTestnet" | "campTestnet" | "fantom" | "fantomTestnet" | "flowMainnet" | "mainnet" | "nexus" | "nexusTestnet" | "optimism" | "polygon" | "polygon_mumbai" | "skaleNebula" | "skaleEuropa" | "skaleCalypso" | "solana" | "sophon" | "sophonTestnet" | "sui" | "superseed" | "superseedSepolia" | "vanar" | "xai" | "zksync" | "coti" | "cotiTestnet" | "dogeosTestnet" | "morph" | "morphTestnet" | "morphHolesky" | "ultra" | "ultraTestnet" | "nitrograph" | "sepolia" | "optimism_sepolia" | "arbitrumSepolia" | "goerli" | "optimism_goerli" | "arbitrumGoerli" | "basecamp" | "somnia" | "zkverify" | "polkadot" | "kusama" | "horizen" | "horizenTestnet" | "robinhoodChain" | "robinhoodChainTestnet" | "flow_cadence""mainnet"type"Bonus" | "BoughtOn" | "BoughtWithRoyalties" | "DiscordMessages" | "Listing" | "Lodging" | "PoapClaim" | "SnagSocialsConnected" | "SnapshotFullset" | "SnapshotHold" | "SoldWithRoyalties" | "TwitterBio" | "TwitterHashTagPost" | "MintOn" | "SoldOn" | "TokenHold" | "Retweet" | "check_in" | "code_entry" | "connect_wallet" | "connected_discord" | "connected_email" | "connected_epic" | "connected_github" | "connected_steam" | "connected_telegram" | "connected_twitter" | "create_partner_account" | "discord_member" | "drip_x_follow" | "drip_x_new_tweet" | "drip_x_text_in_bio" | "drip_x_text_in_comment" | "drip_x_text_in_name" | "drip_x_tweet" | "external_rule" | "link_click" | "manual_upload" | "profile_completed" | "referred_user" | "smart_contract_event" | "snapshot_governance" | "telegram_join" | "telegram_messages" | "text_input" | "token_hold_erc20" | "tweet_liked_by_project" | "twitter_comment" | "twitter_follow" | "twitter_followers" | "twitter_like" | "twitter_post_hashtag" | "quiz" | "poll" | "steam_wishlist" | "liquidity_uniswap_v2" | "liquidity_uniswap_v3" | "points_airdrop" | "youtube_subscribers" | "youtube_comment" | "shopify_spend" | "swap" | "tiktok_post" | "post_impressions" | "discord_join" | "connected_youtube" | "stratus_function" | "connected_tiktok" | "tiktok_follow" | "github_repo_star" | "github_repo_fork" | "github_repo_collaborator" | "github_merge_PR" | "discord_role_grant" | "connected_reddit" | "reddit_comment" | "robinhood_token_hold" | "connected_instagram" | "instagram_post" | "instagram_follow" | "connected_phone" | "dapps_by_gas_spent" | "dapps_by_active_users" | "dapps_by_new_users" | "dapps_by_transaction_count" | "dapps_by_user_retention"requiredType of loyalty rule being created
"Bonus" | "BoughtOn" | "BoughtWithRoyalties" | "DiscordMessages" | "Listing" | "Lodging" | "PoapClaim" | "SnagSocialsConnected" | "SnapshotFullset" | "SnapshotHold" | "SoldWithRoyalties" | "TwitterBio" | "TwitterHashTagPost" | "MintOn" | "SoldOn" | "TokenHold" | "Retweet" | "check_in" | "code_entry" | "connect_wallet" | "connected_discord" | "connected_email" | "connected_epic" | "connected_github" | "connected_steam" | "connected_telegram" | "connected_twitter" | "create_partner_account" | "discord_member" | "drip_x_follow" | "drip_x_new_tweet" | "drip_x_text_in_bio" | "drip_x_text_in_comment" | "drip_x_text_in_name" | "drip_x_tweet" | "external_rule" | "link_click" | "manual_upload" | "profile_completed" | "referred_user" | "smart_contract_event" | "snapshot_governance" | "telegram_join" | "telegram_messages" | "text_input" | "token_hold_erc20" | "tweet_liked_by_project" | "twitter_comment" | "twitter_follow" | "twitter_followers" | "twitter_like" | "twitter_post_hashtag" | "quiz" | "poll" | "steam_wishlist" | "liquidity_uniswap_v2" | "liquidity_uniswap_v3" | "points_airdrop" | "youtube_subscribers" | "youtube_comment" | "shopify_spend" | "swap" | "tiktok_post" | "post_impressions" | "discord_join" | "connected_youtube" | "stratus_function" | "connected_tiktok" | "tiktok_follow" | "github_repo_star" | "github_repo_fork" | "github_repo_collaborator" | "github_merge_PR" | "discord_role_grant" | "connected_reddit" | "reddit_comment" | "robinhood_token_hold" | "connected_instagram" | "instagram_post" | "instagram_follow" | "connected_phone" | "dapps_by_gas_spent" | "dapps_by_active_users" | "dapps_by_new_users" | "dapps_by_transaction_count" | "dapps_by_user_retention"frequency"none" | "once" | "hourly" | "daily" | "weekly" | "monthly" | "immediately"requiredExecution frequency of the loyalty rule
"none" | "once" | "hourly" | "daily" | "weekly" | "monthly" | "immediately"interval"hourly" | "daily" | "weekly" | "monthly" | "once" | "custom" | "every_message" | "unlimited"requiredInterval between rule executions
"hourly" | "daily" | "weekly" | "monthly" | "once" | "custom" | "every_message" | "unlimited"startTimestring<date-time>requiredWhen the rule becomes active
endTimestring<date-time>requiredWhen the rule becomes inactive
effectiveStartTimeanyrequiredThe effective start time of the rule
effectiveEndTimeanyrequiredThe effective end time of the rule
amountanyrequiredReward amount associated with the rule
customRewardsCsvUrlstring<uri>URL for uploading custom rewards via CSV
customRewardsApiUrlstring<uri>URL for fetching custom rewards
subscriptionIdstringOptional stratus subscription id for the rule
functionIdstringOptional stratus function id for the rule
metadataobjectrequiredAdditional metadata for the loyalty rule
metadata.isCheckInOnEveryTxnbooleanIf enabled, the first transaction done on the platform will complete this rule
metadata.hasPaidFullRoyaltybooleanIndicates if the full royalty has been paid for items.
metadata.royaltyAddressstringWallet address of the user can only be used if userId is not provided
metadata.royaltyPercentagenumberRoyalty percentage of the item.
x >= 1, x <= 100metadata.hasVerifiedTwitterbooleanIndicates if the user has a verified Twitter account.
metadata.onlyRewardExistingUserbooleanIndicates if only existing users are rewarded.
metadata.hasNeverSoldbooleanIndicates if the item has never been sold.
metadata.onlyNativebooleanFlag indicating whether to include only native tokens.
metadata.hasFillSourcebooleanFlag indicating whether the fill source is included.
metadata.fillSourcestringFill source of the order for the token sale
metadata.liquidityobjectLiquidity pool details.
metadata.twitterUsernamestringTwitter username of the user.
metadata.twitterUserIdstringUnique identifier of the Twitter user.
metadata.twitterHashtagstringHashtag associated with the Twitter post.
metadata.enableVerifiedMultiplierbooleanFlag indicating whether the verified multiplier is enabled.
metadata.verifiedMultipliernumberMultiplier applied to rewards for verified users.
metadata.isMultiplierAppliedbooleanIndicates if the multiplier has been applied to rewards.
metadata.onlyKnownUsersbooleanFlag indicating whether to include only known users.
metadata.firstReferralRewardnumberPercentage reward given to a user for their first referral.
metadata.referrerRewardnumberLump sum reward given to a referrer.
metadata.referrerRewardLoyaltyCurrencyIdstringLoyalty currency ID of the referrer reward.
metadata.secondReferralRewardnumberPercentage reward given for a second-level referral.
metadata.enableStreaksbooleanFlag indicating whether streaks are enabled.
metadata.promoCodestringPromotional code associated with the rule.
metadata.promoCodeType"code" | "csv" | "generate"Type of the promotional code.
"code" | "csv" | "generate"metadata.promoCodeLengthnumberNumbers of the promotional code to be generated.
metadata.promoCodeCsvUrlstringURL of the CSV file containing promo codes.
metadata.enableJoinDiscordServersbooleanFlag indicating whether joining Discord servers is required.
metadata.discordServersToJoinarray<object>Array of Discord servers, channels, and roles to join.
metadata.streakArrayarray<object>Array of streak milestones and corresponding rewards.
metadata.dripQuestsToCompletearray<object>Array of drip quests required to complete the rule.
metadata.collectionarray<object>Array of collections associated with the rule.
metadata.rangearray<object>Array defining ranges and corresponding rewards.
metadata.customRewardsApiKeystringAPI key for custom rewards integration.
metadata.linkstringOptional link associated with the metadata.
metadata.socialPlatform"Custom" | "Discord" | "EpicGames" | "Instagram" | "Phone" | "Steam" | "Telegram" | "TikTok" | "Twitch" | "X(Twitter)" | "YouTube" | "Google" | "GitHub" | "Reddit"Social media platform associated with the rule.
"Custom" | "Discord" | "EpicGames" | "Instagram" | "Phone" | "Steam" | "Telegram" | "TikTok" | "Twitch" | "X(Twitter)" | "YouTube" | "Google" | "GitHub" | "Reddit"metadata.socialPlatformNamestringName of the social platform.
metadata.socialPlatformLogostringURL of the social platform's logo.
metadata.rewardPerImpressionbooleanFlag indicating if rewards are given per impression.
metadata.snapshotProposalsarray<object>Array of snapshot proposals for the rule.
metadata.ctaobjectObject containing details for the call-to-action.
metadata.hasSaleCurrencybooleanFlag indicating if the sale currency is included.
metadata.isTokenHoldMultiplierbooleanFlag indicating if the token hold multiplier is applied.
metadata.saleCurrencystringCurrency associated with sales.
metadata.isRetroactivebooleanFlag indicating if rewards are applied retroactively.
metadata.timeDelayToVerifySecondsanyTime delay in seconds to verify actions.
metadata.referralRequirementsobjectObject defining referral requirements.
metadata.multiplierLoyaltyCurrencyIdsarray<string>Array of loyalty currency IDs used for multipliers.
metadata.verifyPlaceHolderTextstringPlaceholder text for verification input fields.
metadata.verificationTextMinimumLengthintegerMinimum length of the verification text.
metadata.buttonTextstringText displayed on the action button.
metadata.telegramChannelIdstringID of the Telegram channel.
metadata.twitterAccountUrlstringURL of the associated Twitter account.
metadata.twitterPostUrlstringURL of the associated Twitter post.
metadata.checkLikebooleanFlag indicating if liking the post is required.
metadata.checkRepostbooleanFlag indicating if reposting is required.
metadata.checkCommentbooleanFlag indicating if commenting is required.
metadata.maxLikesintegerReaction limit for likes. Once the post reaches this many likes, the Like requirement is hidden from users. Likes are never verified server-side, so this only controls display.
x >= 1metadata.maxRepostsintegerReaction limit for reposts. Once the post reaches this many reposts, the Repost requirement is hidden and no longer verified.
x >= 1metadata.maxCommentsintegerReaction limit for comments. Once the post reaches this many comments, the Comment requirement is hidden and no longer verified.
x >= 1metadata.reactionStatsobjectLatest scraped public reaction counts for the post, written back from social-service (throttled). Drives which reaction requirements are hidden once they hit their configured limit. Not admin-editable.
metadata.checkTextanyText to check in the Twitter post, username, or bio.
metadata.requirePostLinkbooleanFlag indicating if the post link is required.
metadata.requirePostMediaLinkbooleanFlag indicating if media metadata is required.
metadata.preGeneratedPostTextstringPre-generated text template that will be used to prefill the post content.
metadata.rewardCriteria"IMPRESSIONS_COUNT" | "ELIGIBLE_POST"Criteria to evaluate the reward.
"IMPRESSIONS_COUNT" | "ELIGIBLE_POST"metadata.smartContractobjectObject containing details of the associated smart contract.
metadata.walletType"evm" | "solana" | "imx" | "sui" | "ton" | "cosmos" | "ultra" | "agw" | "flow_cadence" | "substrate"Type of wallet associated with the rule.
"evm" | "solana" | "imx" | "sui" | "ton" | "cosmos" | "ultra" | "agw" | "flow_cadence" | "substrate"metadata.imageUrlstringURL of the image associated with the rule.
metadata.onlyRewardSingleTokenOwnershipbooleangive points for only one token ownership per contract
metadata.skipMultiplierbooleanFlag indicating if the multiplier is skipped.
metadata.completeProfileConditionsobjectConditions for completing the profile.
metadata.steamAppIdstringID of the Steam app.
metadata.githubRepoUrlstringURL of the GitHub repository to check for star.
metadata.githubBranchNamestringName of the GitHub branch to check for PR merge.
metadata.resetProgressOnClaimbooleanIf enabled, the progress tracking row will be deleted after a successful claim, allowing the user to re-earn the rule.
metadata.rewardPerActionbooleanFlag indicating if the reward is rewarded per action.
metadata.rewardByBatchbooleanFlag indicating if the reward is rewarded by batch.
metadata.batchSizenumberNumber of tokens per batch.
metadata.youtubeVideoIdstringID of the Youtube video.
metadata.youtubeChannelIdstringID of the Youtube channel.
metadata.redditPostIdstringID of the Reddit post.
metadata.isRestrictedToNewUsersbooleanFlag indicating if the rule is restricted to new users.
metadata.allowMultipleRedemptionsbooleanFlag indicating if the rule allows multiple redemptions. Applies to Enter a Code only.
metadata.rewardBadgePerRangebooleanFlag indicating if the rule can also reward badges per range.
metadata.swapobjectMetadata for swap loyalty rules
metadata.rewardPerValuebooleanFlag indicating if the rule should reward based on value of traded tokens instead of count.
metadata.conditionDescriptionstringDescription of the external rule condition (only for external rules)
metadata.directRpcbooleanFlag indicating if the rule should use direct RPC to get the balance of tokens.
metadata.erc20Type"erc20" | "native"Type of ERC20 token for the loyalty rule.
"erc20" | "native"metadata.rewardQualityPostsbooleanFlag indicating if the rule should reward quality posts.
metadata.minimumFollowerCountnumberMinimum follower count for the rule. Accepts both number and string values.
metadata.autoCheckInRuleIdsarray<any>Array of loyalty rule IDs that count as check-in when completed. If ["any"] then any rule completions count as check-in.
metadata.robinhoodSymbolsarray<string>collectionAddressstringBlockchain address of the associated collection
collectionsarray<object>List of associated collections
collections.addressstringrequiredBlockchain address of the collection
collections.network"abstract" | "abstractTestnet" | "apechain" | "arbitrum" | "avalanche" | "avalancheFuji" | "base" | "baseSepolia" | "berachain" | "berachainArtio" | "berachainBepolia" | "binance" | "bscTestnet" | "campTestnet" | "fantom" | "fantomTestnet" | "flowMainnet" | "mainnet" | "nexus" | "nexusTestnet" | "optimism" | "polygon" | "polygon_mumbai" | "skaleNebula" | "skaleEuropa" | "skaleCalypso" | "solana" | "sophon" | "sophonTestnet" | "sui" | "superseed" | "superseedSepolia" | "vanar" | "xai" | "zksync" | "coti" | "cotiTestnet" | "dogeosTestnet" | "morph" | "morphTestnet" | "morphHolesky" | "ultra" | "ultraTestnet" | "nitrograph" | "sepolia" | "optimism_sepolia" | "arbitrumSepolia" | "goerli" | "optimism_goerli" | "arbitrumGoerli" | "basecamp" | "somnia" | "zkverify" | "polkadot" | "kusama" | "horizen" | "horizenTestnet" | "robinhoodChain" | "robinhoodChainTestnet" | "flow_cadence"requiredBlockchain network for the collection
"abstract" | "abstractTestnet" | "apechain" | "arbitrum" | "avalanche" | "avalancheFuji" | "base" | "baseSepolia" | "berachain" | "berachainArtio" | "berachainBepolia" | "binance" | "bscTestnet" | "campTestnet" | "fantom" | "fantomTestnet" | "flowMainnet" | "mainnet" | "nexus" | "nexusTestnet" | "optimism" | "polygon" | "polygon_mumbai" | "skaleNebula" | "skaleEuropa" | "skaleCalypso" | "solana" | "sophon" | "sophonTestnet" | "sui" | "superseed" | "superseedSepolia" | "vanar" | "xai" | "zksync" | "coti" | "cotiTestnet" | "dogeosTestnet" | "morph" | "morphTestnet" | "morphHolesky" | "ultra" | "ultraTestnet" | "nitrograph" | "sepolia" | "optimism_sepolia" | "arbitrumSepolia" | "goerli" | "optimism_goerli" | "arbitrumGoerli" | "basecamp" | "somnia" | "zkverify" | "polkadot" | "kusama" | "horizen" | "horizenTestnet" | "robinhoodChain" | "robinhoodChainTestnet" | "flow_cadence"collections.symbolstringSymbol of the collection.
hideInUibooleanWhether to hide this rule in the user interface
falsetrackProgressbooleanFlag indicating if the progress is tracked. If enabled, the rule can only be completed once the progress is 100%.
progressType"counter" | "percentage"How tracked progress is interpreted. "percentage" counts 0-100 and is shown as a percentage. "counter" counts up to the highest reward range end and is shown as a raw count.
"counter" | "percentage"showBeforeStartbooleanWhether to show this rule before the start time
falseisRequiredbooleanWhether this rule is mandatory
falseoauthCredentialsIdstring<uuid>OAuth credentials associated with the rule
loyaltyCurrencyIdstring<uuid>Unique identifier for the loyalty currency. Optional when rewardType is token and tokenReward is provided; backend will find or create the currency from the selected contract.
tokenRewardobjectWhen rewardType is token, provide relayer and either an ERC-20 contract or isNative=true to find or create loyalty currency and onchain token.
tokenReward.relayerIdstring<uuid>requiredStratus relayer for token distribution (same network as contract)
tokenReward.contractIdstring<uuid>ERC-20 contract to reward with; must match relayer network. Required unless isNative is true.
tokenReward.isNativebooleanWhen true, reward is the chain native gas token (ETH, MATIC, BNB, …) and contractId is omitted.
loyaltyRuleGroupIdanyUnique identifier for the loyalty rule group
rewardType"points" | "multiplier" | "badge" | "token"Type of reward issued by the rule
"points" | "multiplier" | "badge" | "token""points"loyaltyBadgeIdstring<uuid>Unique identifier for the loyalty badge
mediaUrlstringURL of the media to be displayed
loyaltyUserAllotmentCsvUrlstring<uri>URL for uploading loyalty user allotment via CSV
maxAmountPerIntervalnumberThe maximum amount of points a user can earn per interval. Available for the smart contract and external rules.
maxAmountInterval"daily" | "weekly" | "monthly" | "lifetime"The interval for the max amount. Available for the smart contract and external rules.
"daily" | "weekly" | "monthly" | "lifetime"shopifyStoreUrlstringURL of the Shopify store
externalIntegrationIdstring<uuid>ID of the external integration
duplicatedFromIdstring<uuid>rewardLifetime"permanent" | "dynamic"The lifetime of the reward
"permanent" | "dynamic"claimType"manual" | "auto"The type of claim for the reward
"manual" | "auto"contractIdsarray<string>The IDs of the contracts
dappDeployedWithin"daily" | "weekly" | "monthly"Filter dApps by deployment age before ranking.
"daily" | "weekly" | "monthly"dappDataWindow"daily" | "weekly" | "monthly"Reward based on data usage within the last day, week, or month. Leave it empty for all time usage.
"daily" | "weekly" | "monthly"isDappRulebooleanRoutes rule rewards to the dApp owner address (for substitution-type rules: external_rule, smart_contract_event, stratus_function) or marks the rule as a dApp-attribution rule (for the dapps_by_* family). Defaults to true at the API for the dapps_by_* family when omitted, false otherwise. Immutable after creation.
Response
200