Snag Docs logo

Update badge (by id)

POSThttps://admin.snagsolutions.io/api/loyalty/badges/{id}

This endpoint allows you to update an existing badge.

Loading code example
Loading code example

Authorizations

apiKeyAuthstringheaderrequired

API key passed in the header.

Path Parameters

idstring<uuid>required

UUID of the badge to update (converted to lowercase)

Body

Body

namestring

The name of the badge

descriptionstring

The description of the badge

imageUrlstring<uri>

The URL of the badge image

hideInUiboolean

Whether to hide this badge in the user interface

Default: false
rewardsarray<object>

Array of rewards granted when the badge is achieved

rewards.rewardType"points" | "multiplier" | "badge" | "token"required

Type of reward (points or multiplier)

Allowed values: "points" | "multiplier" | "badge" | "token"
rewards.loyaltyCurrencyIdstring<uuid>

UUID of the loyalty currency for this reward

rewards.loyaltyCurrencyIdsarray<string<uuid>>

Array of loyalty currency IDs for multiplier rewards (empty means all currencies)

rewards.amountnumber

Points amount to reward (for points reward type)

rewards.multipliernumber

Multiplier to reward (for multiplier reward type)

rewards.isRetroactiveboolean

Whether the multiplier should be applied to the user's existing balance

Default: false
csvFilesarray<object>
csvFiles.srcstring<uri>required
csvFiles.namestring
Length: <= 250
csvFiles.descriptionstring
Length: <= 250

Response

application/json

200

idstring<uuid>required

UUID of the badge (converted to lowercase)

namestringrequired

The name of the badge

descriptionstringrequired

The description of the badge

imageUrlstring<uri>required

The URL of the badge image

hideInUiboolean

Whether to hide this badge in the user interface

Default: false
loyaltyConditionsarray<object>required

Array of conditions of the badge

loyaltyConditions.idstring<uuid>required

UUID of the condition (converted to lowercase)

loyaltyConditions.type"rule" | "rules" | "points" | "section" | "level" | "api" | "badge" | "badges" | "csv"required

The type of the condition

Allowed values: "rule" | "rules" | "points" | "section" | "level" | "api" | "badge" | "badges" | "csv"
loyaltyConditions.descriptionstringrequired

The description of the condition

loyaltyConditions.amountnumberrequired

The amount of the condition

loyaltyConditions.repeatCountnumberrequired

The repeat count of the condition

loyaltyConditions.requiredCountnumberrequired

The required count of the condition

loyaltyConditions.loyaltyRuleGroupIdstring<uuid>required

UUID of the rule group (converted to lowercase)

loyaltyConditions.associationarray<object>required
loyaltyConditions.loyaltyCurrencyIdstring<uuid>required

UUID of the currency (converted to lowercase)

loyaltyConditions.csvUrlstring<uri>required

URL of the CSV file

loyaltyConditions.csvFilesarray<object>

Array of CSV files associated with the condition

rewardsarray<object>

Array of rewards granted when the badge is achieved

rewards.idstring<uuid>required

UUID of the badge reward

rewards.rewardType"points" | "multiplier" | "badge" | "token"required

Type of reward (points or multiplier)

Allowed values: "points" | "multiplier" | "badge" | "token"
rewards.loyaltyCurrencyIdstring<uuid>required

UUID of the loyalty currency for this reward

rewards.loyaltyCurrencyIdsarray<string<uuid>>

Array of loyalty currency IDs for multiplier rewards (empty means all currencies)

rewards.amountnumberrequired

Points amount to reward (for points reward type)

rewards.multipliernumberrequired

Multiplier to reward (for multiplier reward type)

rewards.isRetroactivebooleanrequired

Whether the multiplier should be applied to the user's existing balance

loyaltyBadgeUsersarray<object>

Array of user badges

loyaltyBadgeUsers.idstring<uuid>required

UUID of the user badge (converted to lowercase)

loyaltyBadgeUsers.userIdstring<uuid>required

UUID of the user (converted to lowercase)

loyaltyBadgeUsers.websiteIdstring<uuid>required

UUID of the website (converted to lowercase)

loyaltyBadgeUsers.organizationIdstring<uuid>required

UUID of the organization (converted to lowercase)

loyaltyBadgeUsers.hideInUiboolean

Whether to hide this badge in the user interface

Default: false
loyaltyBadgeUsers.status"active" | "inactive" | "revoked"required

The status of the badge

Allowed values: "active" | "inactive" | "revoked"
loyaltyBadgeUsers.loyaltyBadgeIdstring<uuid>required

UUID of the badge (converted to lowercase)

loyaltyBadgeUsers.progressany

Array of progress for the badge

loyaltyBadgeUsers.dismissedInUiboolean

Whether the user has dismissed the badge in the UI

loyaltyBadgeUsers.userobject

User associated with the user badge

loyaltyBadgeUsers.createdAtstring<date-time>required

The date and time the user badge was created

loyaltyBadgeUsers.completedAtstring<date-time>

The date and time the user badge was granted

loyaltyBadgeUsers.updatedAtstring<date-time>required

The date and time the user badge was updated

loyaltyRulesarray<object>

Array of loyalty rules associated with the badge

loyaltyRules.idstring<uuid>required

UUID of the loyalty rule (converted to lowercase)

loyaltyRules.namestringrequired

The name of the loyalty rule

dataJobsarray<object>

Array of data jobs associated with the badge

dataJobs.idstring<uuid>required

UUID of the data job (converted to lowercase)

dataJobs.status"pending" | "processing" | "complete" | "failed" | "cancelled"required

The status of the data job

Allowed values: "pending" | "processing" | "complete" | "failed" | "cancelled"
dataJobs.messagestring

The message associated with the data job

dataJobs.createdAtstring<date-time>required

The date and time the data job was created

dataJobs.updatedAtstring<date-time>required

The date and time the data job was updated

createdAtstring<date-time>required

The date and time the badge was created

updatedAtstring<date-time>required

The date and time the badge was updated

Update badge (by id) — Snag Docs