Webhooks
Manage real-time event updates by subscribing to specific user activities through webhooks.POST /hook
Register a webhook URL to receive notifications when specific user events occur on the platform. Example request:scope: The type of event you want to track. Useuser_activityto receive updates on user actions such as referrals, task completions, or deposits.uri: The full URL where claimr should send the webhook notifications. This must be a valid HTTPS endpoint you control.secret: A string used to verify the authenticity of webhook requests.hook_id: A custom ID you assign to the webhook. Helps you manage multiple environments.pids: A list of campaign IDs. If provided, notifications will be limited to the specified campaigns. Leave empty to subscribe to all campaigns.
DELETE /hook
Unregister an existing webhook to stop receiving notifications for a given scope and hook ID. Example request:scope: The same scope you used when registering the webhook.hook_id: The ID of the webhook you want to remove.
User token
Generate a permanent token to authenticate users in the claimr widget.GET /token
Create or retrieve a user token. If the user doesn’t exist, they’ll be registered automatically. Example request:account: Unique identifier of the user (e.g., wallet address, email, or internal ID).platform: Platform name associated with the account (e.g., discord, email, internal).name: Display name for the user. If not set, defaults to the account value.
- Production: Add the token to the
data-user-tokenattribute in the embed script. - Development: Append it as a
user_tokenquery parameter in the widget preview URL.
User
Manage referral data, activity, and rewards.GET /user/ref_id
Fetch a user’s referral ID and create a referral link if it doesn’t already exist. Query parameters:account: The user’s unique identifier (email, nickname, or internal ID).platform: The platform name (e.g., web3, email, internal).pid: The campaign ID where the referral link should be created.
POST /user/ref_id
Set a user’s referral ID to track who referred them. Example request:account: The referred user’s unique ID.platform: The referred user’s platform.pid: The campaign ID.ref_id: The referral ID of the user who referred them.
POST /user/referrer
Manually set the referrer of a user using the referrer’s account information. Example request:account: The referred user’s ID.platform: The referred user’s platform.pid: The campaign ID.ref_account: The referrer’s user ID.ref_platform: The referrer’s platform.
GET /user/activity
Fetch a full list of completed items by a user, including tasks, quests, rewards, and XP earned. Query parameters:account: The user’s ID.platform: The user’s platform.pid: The campaign ID.
GET /user/progress
Get a full overview of a user’s progress, including both completed and pending tasks and quests. Query parameters:account: The user’s ID.platform: The user’s platform.pid: The campaign ID.env(optional): Set todevto preview unpublished changes.
GET /user/referrals
Return a list of users referred by a specific user and their referral impact. Query parameters:account: The user’s ID.platform: The user’s platform.pid: The campaign ID.env(optional): Usedevto preview unpublished campaign data.
GET /user/balance
Check a user’s current XP balance, including XP from tasks, referrals, and UGC. Query parameters:account: The user’s ID.platform: The user’s platform.pid: The campaign ID.
POST /user/reward
Reward a user for an off-platform action (e.g. within your app) by adding XP to their balance. Example request:account: The user’s ID.platform: The user’s platform.pid: The campaign ID.id: A unique identifier for this reward transaction.xp: XP points to add to the user.
POST /user/withdraw
Deduct XP points from a user’s balance (e.g. to revoke a reward). Example request:account: The user’s ID.platform: The user’s platform.pid: The campaign ID.id: A unique identifier for the withdrawal.xp: XP points to subtract from the user.strict: If true, prevents the user’s balance from going negative.
Tasks
Trigger specific actions and reward users by defining task types and their completion criteria within a campaign.POST /action/value
Set or update a numeric attribute of a user’s action (e.g., likes, followers). Use this method to record a value for a specific user action within a campaign quest. Validates user login, campaign bundle, and quest group before executing the task. Used with API Number Value tasks. Example request:account: Unique user identifier (e.g., email, nickname, or internal ID).platform: Platform the user belongs to (e.g., steam, email, web3).pid: Campaign ID where the quest is configured.cid: Quest ID where the action is located.aid: Action ID to be updated.value: Numeric value you want to assign to the user’s action.env(optional): Usedevto target draft campaign versions.
POST /stream/value
Accumulate numeric attributes associated with user actions (e.g., total transactions). Use this method to push a value to all API stream tasks within a campaign that match the specified stream name. It automatically finds and triggers all quests and tasks configured for the given stream across all campaign schemes and groups. Used with API Stream Value tasks. Example request:account: Unique user identifier (e.g., email, nickname, or internal ID).platform: Platform the user belongs to (e.g., steam, email, web3).pid: Campaign ID where the stream tasks are configured.stream: Stream name used in the task setup.value: Numeric value to accumulate.env(optional): Usedevto target draft campaign versions.
Events
Track custom user actions by pushing event data to claimr. Events can be used to trigger task completions based on user behavior.POST /event
Creates a custom event record associated with a user for tracking and triggering downstream processes. Events are stored with optional categorization and custom data payload. Example request:account: A unique identifier for the user (e.g., email, nickname, or internal user ID).platform: Platform where the user originates (e.g., web3, steam).pid: Campaign ID the event is associated with.name: Name of the event (e.g., level_completed, liked_post).id: Custom ID of the event. Can be used to track or filter it later.category: Optional category name to group events (e.g., gameplay, transaction).data: Custom payload with any relevant attributes (e.g., score, time, level).ts: Client-side timestamp of when the event occurred.
GET /events
Retrieves all custom events associated with a user for tracking and triggering downstream processes. Events are stored with optional categorization and custom data payload. Results can be filtered by category and name. Query parameters:account: User account identifier.platform: Platform identifier.pid: Campaign ID.name: Event name for filtering (e.g., level_completed).category: Event category for filtering (e.g., gameplay).
Connecting events to tasks
When you create a task in claimr with the type Events, claimr listens forPOST /event calls matching the criteria you define.
- Events count task: For an “Events count” task, claimr tracks how many times an event with a specific category and name occurs. For example, if you set up a task to reward users after they achieve 10 likes, claimr counts each incoming like event via
POST /event. Once the count reaches 10, the reward is automatically triggered. - User identification: claimr identifies the user associated with the event using the
accountandplatformfields in the payload. For example, if a user logs in with Web3 (using their wallet), claimr uses the wallet address to link the event to the correct user. This ensures that points and completions are attributed accurately.
Campaign
Access campaign-level data, including task structure, season progress, and participation statistics. Useful for both live and development environments.GET /campaign/info
Returns detailed campaign information including all tasks and quests. Supports both published and development environments. Query parameters:pid: Campaign ID to retrieve information for.env(optional): Set todevto fetch unpublished campaign changes.
GET /campaign/points
Returns campaign points and season information. Calculates season progression based on configured thresholds. Query parameters:pid: Campaign ID to retrieve points information for.
GET /campaign/stats
Returns comprehensive campaign statistics including points awarded and participation metrics. Useful for analytics and reporting. Query parameters:pid: Campaign ID to retrieve statistics for.
Invite codes
Control access to your campaign by issuing, assigning, and managing invite codes linked to user identifiers.GET /code
Retrieves information about an invite code, including which users have used it. Query parameters:code: The invite code to check.pid: Campaign/Project ID associated with the invite code.
used_by: An array of user identifiers who have used this invite code. If empty, the code hasn’t been used.
POST /code
Assigns an invite code to a user (identified by wallet address). This also handles user registration if the address is new, creates campaign entries, and marks the invite code as used. Example request:code: The invite code being claimed.pid: The campaign ID the code belongs to.used_by: The wallet address of the user who is using the code.
DELETE /code
Releases an invite code that was previously assigned to a user, making it available again. Theused_by field is optional and can be used to specify the user to remove the code from.
Example request:
code: The invite code to release.pid: The campaign ID the code belongs to.used_by: The user (wallet address) the code was associated with (optional).
Wallets
Use these endpoints to award or withdraw XP, track referrals, and manage invite codes based on user wallet addresses. This is especially useful for blockchain-based campaigns where users interact via Web3 wallets.GET /wallet/code
Returns the invite code used by a specific wallet. This endpoint retrieves the invite code associated with a wallet address in a specific campaign. If no code was used, the response returns an empty string. Query parameters:address– The wallet address to check.pid– The campaign ID.
GET /wallet/ref_id
Returns a wallet’s referral ID for a specific campaign. Use this endpoint to retrieve the referral ID generated for a wallet. If no referral was generated, or the wallet is unregistered, an error will be returned. Query parameters:address– The wallet address.pid– The campaign ID.
GET /wallet/referrals
Returns all referrals made by a wallet address. This endpoint lists all wallets that were referred by a specific wallet within a campaign, along with the number of points earned per referral. Query parameters:address– The referrer’s wallet address.pid– The campaign ID.
POST /wallet/reward
Award XP reward to a wallet. This method assigns XP to a user’s wallet address for actions performed outside claimr. Used to register off-platform events and update the wallet balance. Request body:POST /wallet/withdraw
Withdraw XP points from a wallet. Use this to deduct XP from a wallet’s balance. Useful for processing point spending or reversing incorrect rewards. Thestrict flag determines whether to enforce a minimum balance.
Request body:
Leaderboard
Track user performance and rank participants based on the points they’ve earned in your campaign. The leaderboard helps you highlight top contributors, motivate engagement, and display rankings in real time.GET /leaderboard
Retrieve leaderboard data for a specific campaign. Supports both v1 and v2 leaderboard formats based on campaign type. The v1 format is a basic version available for all campaigns. It returns a ranked list of up to 100–150 users based on their XP. The v2 format is an advanced, unlimited version available with selected packages. It allows access to the full leaderboard. Query parameters:pid: Campaign ID.account: User’s account identifier (required for v2 campaigns).platform: Account’s platform (required for v2 campaigns when account is provided).
rank: The position of the user on the leaderboard.score: The total points (XP) the user has earned.user: User details associated with this leaderboard entry.id: The internal user ID.name: The user’s display name.avatar: URL to the user’s profile picture (if available).
live: Indicates if the leaderboard is actively updating.rank(outside leaderboard array): The personal rank of the user if the account was specified.