Skip to main content
POST
Update Loyalty Rule

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string<uuid>
required

Body

application/json

Body

name
string
required

Name of the loyalty rule

Minimum string length: 1
Example:

"Daily Rewards Program"

startTime
string<date-time>
required

Start time for the loyalty rule

Example:

"2024-01-01T00:00:00Z"

endTime
string<date-time> | null
required

End time for the loyalty rule

Example:

"2024-12-31T23:59:00Z"

amount
any | null
required

Reward amount for the loyalty rule

Example:

"10.5"

description
string

Optional description of the loyalty rule

Example:

"This rule rewards users daily for specific actions."

effectiveStartTime

Effective start time of the rule

Example:

"2024-01-01T00:00:00Z"

effectiveEndTime

Effective end time of the rule

Example:

"2024-12-31T23:59:00Z"

customRewardsCsvUrl
string<uri> | null

URL for uploading custom rewards via CSV

Example:

"https://example.com/rewards.csv"

customRewardsApiUrl
string<uri> | null

API URL for custom rewards integration

Example:

"https://api.example.com/rewards"

subscriptionId
string | null

Optional stratus subscription id for the rule

Example:

"sub12345"

functionId
string | null

Optional stratus function id for the rule

Example:

"func12345"

metadata
Metadata · object

Additional metadata for the loyalty rule

network
enum<string>
default:mainnet

Blockchain network where the rule will apply

Available options:
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
Example:

"mainnet"

collectionAddress
string | null

Blockchain address of the associated collection

Example:

"0x1234567890abcdef1234567890abcdef12345678"

collections
Collections · object[] | null

List of associated collections

hideInUi
boolean
default:false

Whether to hide this rule in the user interface

Example:

false

showBeforeStart
boolean
default:false

Whether to show this rule before the start time

Example:

false

trackProgress
boolean

Flag indicating if the progress is tracked. If enabled, the rule can only be completed once the progress is 100%.

Example:

true

progressType
enum<string> | null

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.

Available options:
counter,
percentage
Example:

"percentage"

isRequired
boolean
default:false

Whether this rule is required for participation

Example:

true

oauthCredentialsId
string<uuid> | null

ID for associated OAuth credentials

Example:

"123e4567-e89b-12d3-a456-426614174000"

rewardType
enum<string>
default:points

Type of reward issued by this rule

Available options:
points,
multiplier,
badge,
token
Example:

"points"

loyaltyCurrencyId
string<uuid>

Loyalty currency. Optional when rewardType is token and tokenReward is provided; backend resolves the hidden currency from the contract.

Example:

"456e1234-e89b-12d3-a456-426614174003"

tokenReward
Token Reward · object

When rewardType is token, provide relayer and either an ERC-20 contract or isNative=true to find or create the hidden loyalty currency and onchain token.

frequency
enum<string>

Frequency of the rule execution

Available options:
none,
once,
hourly,
daily,
weekly,
monthly,
immediately
Example:

"daily"

interval
enum<string>

Time interval for recurring rule execution

Available options:
hourly,
daily,
weekly,
monthly,
once,
custom,
every_message,
unlimited
Example:

"weekly"

loyaltyRuleGroupId

ID of the rule group section to associate with the rule

Example:

"123e4567-e89b-12d3-a456-426614174005"

mediaUrl
string | null

URL of the media to be displayed

Example:

"https://example.com/media.png"

maxAmountPerInterval
number | null

The maximum amount of points a user can earn per interval. Available for the smart contract and external rules.

Example:

100

maxAmountInterval
enum<string> | null

The interval for the max amount. Available for the smart contract and external rules.

Available options:
daily,
weekly,
monthly,
lifetime
Example:

"daily"

externalIntegrationId
string<uuid> | null

ID of the external integration

Example:

"123e4567-e89b-12d3-a456-426614174005"

shopifyStoreUrl
string | null

URL of the Shopify store

Example:

"https://example.com"

rewardLifetime
enum<string> | null

The lifetime of the reward

Available options:
permanent,
dynamic
Example:

"permanent"

claimType
enum<string> | null

The type of claim for the reward

Available options:
manual,
auto
Example:

"auto"

contractIds
string[] | null

The IDs of the contracts

Example:
dappDeployedWithin
enum<string> | null

Filter dApps by deployment age before ranking.

Available options:
daily,
weekly,
monthly
Example:

"daily"

dappDataWindow
enum<string> | null

Reward based on data usage within the last day, week, or month. Leave it empty for all time usage.

Available options:
daily,
weekly,
monthly
Example:

"daily"

deletedAt
string<date-time> | null

Timestamp when the loyalty rule was deleted. Set to null to restore a deleted rule.

Example:

null

Response

200

id
string<uuid>
required
name
string
required

Name of the loyalty rule

Minimum string length: 1
Example:

"Daily Rewards Program"

startTime
string<date-time>
required

Start time for the loyalty rule

Example:

"2024-01-01T00:00:00Z"

endTime
string<date-time> | null
required

End time for the loyalty rule

Example:

"2024-12-31T23:59:00Z"

amount
any | null
required

Reward amount for the loyalty rule

Example:

"10.5"

description
string

Optional description of the loyalty rule

Example:

"This rule rewards users daily for specific actions."

effectiveStartTime

Effective start time of the rule

Example:

"2024-01-01T00:00:00Z"

effectiveEndTime

Effective end time of the rule

Example:

"2024-12-31T23:59:00Z"

customRewardsCsvUrl
string<uri> | null

URL for uploading custom rewards via CSV

Example:

"https://example.com/rewards.csv"

customRewardsApiUrl
string<uri> | null

API URL for custom rewards integration

Example:

"https://api.example.com/rewards"

subscriptionId
string | null

Optional stratus subscription id for the rule

Example:

"sub12345"

functionId
string | null

Optional stratus function id for the rule

Example:

"func12345"

metadata
Metadata · object

Additional metadata for the loyalty rule

network
enum<string>
default:mainnet

Blockchain network where the rule will apply

Available options:
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
Example:

"mainnet"

collectionAddress
string | null

Blockchain address of the associated collection

Example:

"0x1234567890abcdef1234567890abcdef12345678"

collections
Collections · object[] | null

List of associated collections

hideInUi
boolean
default:false

Whether to hide this rule in the user interface

Example:

false

showBeforeStart
boolean
default:false

Whether to show this rule before the start time

Example:

false

trackProgress
boolean

Flag indicating if the progress is tracked. If enabled, the rule can only be completed once the progress is 100%.

Example:

true

progressType
enum<string> | null

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.

Available options:
counter,
percentage
Example:

"percentage"

isRequired
boolean
default:false

Whether this rule is required for participation

Example:

true

oauthCredentialsId
string<uuid> | null

ID for associated OAuth credentials

Example:

"123e4567-e89b-12d3-a456-426614174000"

rewardType
enum<string>
default:points

Type of reward issued by this rule

Available options:
points,
multiplier,
badge,
token
Example:

"points"

loyaltyCurrencyId
string<uuid>

Loyalty currency. Optional when rewardType is token and tokenReward is provided; backend resolves the hidden currency from the contract.

Example:

"456e1234-e89b-12d3-a456-426614174003"

tokenReward
Token Reward · object

When rewardType is token, provide relayer and either an ERC-20 contract or isNative=true to find or create the hidden loyalty currency and onchain token.

frequency
enum<string>

Frequency of the rule execution

Available options:
none,
once,
hourly,
daily,
weekly,
monthly,
immediately
Example:

"daily"

interval
enum<string>

Time interval for recurring rule execution

Available options:
hourly,
daily,
weekly,
monthly,
once,
custom,
every_message,
unlimited
Example:

"weekly"

loyaltyRuleGroupId

ID of the rule group section to associate with the rule

Example:

"123e4567-e89b-12d3-a456-426614174005"

mediaUrl
string | null

URL of the media to be displayed

Example:

"https://example.com/media.png"

maxAmountPerInterval
number | null

The maximum amount of points a user can earn per interval. Available for the smart contract and external rules.

Example:

100

maxAmountInterval
enum<string> | null

The interval for the max amount. Available for the smart contract and external rules.

Available options:
daily,
weekly,
monthly,
lifetime
Example:

"daily"

externalIntegrationId
string<uuid> | null

ID of the external integration

Example:

"123e4567-e89b-12d3-a456-426614174005"

shopifyStoreUrl
string | null

URL of the Shopify store

Example:

"https://example.com"

rewardLifetime
enum<string> | null

The lifetime of the reward

Available options:
permanent,
dynamic
Example:

"permanent"

claimType
enum<string> | null

The type of claim for the reward

Available options:
manual,
auto
Example:

"auto"

contractIds
string[] | null

The IDs of the contracts

Example:
dappDeployedWithin
enum<string> | null

Filter dApps by deployment age before ranking.

Available options:
daily,
weekly,
monthly
Example:

"daily"

dappDataWindow
enum<string> | null

Reward based on data usage within the last day, week, or month. Leave it empty for all time usage.

Available options:
daily,
weekly,
monthly
Example:

"daily"

deletedAt
string<date-time> | null

Timestamp when the loyalty rule was deleted. Set to null to restore a deleted rule.

Example:

null