> ## Documentation Index
> Fetch the complete documentation index at: https://docs.claimr.io/llms.txt
> Use this file to discover all available pages before exploring further.

# API methods: how claimr's API is organized

> A conceptual guide to claimr's API methods, organized by category. For exact parameters, request bodies, and live testing, use the API Playground.

This page groups claimr's API methods by what they're used for. For the full request/response schema of any method and to try it live, open its page in the [API Playground](/api-reference).

## Webhooks

Manage real-time event updates by subscribing to specific user activities through webhooks.

* [Set Webhook](/api-reference/webhooks/set-webhook) — register a webhook URL to receive notifications when specific user events occur on the platform.
* [Remove Webhook](/api-reference/webhooks/remove-webhook) — unregister an existing webhook to stop receiving notifications for a given scope and hook ID.

## User token

Generate a permanent token to authenticate users in the claimr widget.

* [Get User Token](/api-reference/user-token/get-user-token) — create or retrieve a user token. If the user doesn't exist, they'll be registered automatically.

Usage:

* **Production**: Add the token to the `data-user-token` attribute in the embed script.
* **Development**: Append it as a `user_token` query parameter in the widget preview URL.

## User

Manage referral data, activity, and rewards.

* [Get Referral ID](/api-reference/user/get-referral-id) — fetch a user's referral ID and create a referral link if it doesn't already exist.
* [Set Referrer ID](/api-reference/user/set-referrer-id) — set a user's referral ID to track who referred them.
* [Set Referrer](/api-reference/user/set-referrer) — manually set the referrer of a user using the referrer's account information.
* [Get User Activity](/api-reference/user/get-user-activity) — fetch a full list of completed items by a user, including tasks, quests, rewards, and XP earned.
* [Get User Progress](/api-reference/user/get-user-progress) — get a full overview of a user's progress, including both completed and pending tasks and quests.
* [Get Referral Data](/api-reference/user/get-referral-data) — return a list of users referred by a specific user and their referral impact.
* [Get XP Balance](/api-reference/user/get-xp-balance) — check a user's current XP balance, including XP from tasks, referrals, and UGC.
* [Award XP Reward](/api-reference/user/award-xp-reward) — reward a user for an off-platform action (e.g. within your app) by adding XP to their balance.
* [Withdraw User Points](/api-reference/user/withdraw-user-points) — deduct XP points from a user's balance (e.g. to revoke a reward).

All information about the points for each user can be checked in Analytics. To find out more, read our article [User information](/data-analytics/user-information).

## Tasks

Trigger specific actions and reward users by defining task types and their completion criteria within a campaign.

* [Set Task Value](/api-reference/tasks/set-task-value) — set or update a numeric attribute of a user's action (e.g., likes, followers). Used with [API Number Value tasks](/tasks/api-tasks).
* [Push Stream Value](/api-reference/tasks/push-stream-value) — accumulate numeric attributes associated with user actions (e.g., total transactions) across all matching stream tasks in a campaign. Used with [API Stream Value tasks](/tasks/api-tasks).

## Events

Track custom user actions by pushing event data to claimr. Events can be used to trigger task completions based on user behavior.

* [Push Custom Event](/api-reference/events/push-custom-event) — create a custom event record associated with a user for tracking and triggering downstream processes, with optional categorization and a custom data payload.
* [Get Custom Events](/api-reference/events/get-custom-events) — retrieve all custom events associated with a user, filterable by category and name.

### Connecting events to tasks

When you create a task in claimr with the type Events, claimr listens for `POST /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 `account` and `platform` fields 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.

For more information about configuration, read our article on Events tasks.

## Campaign

Access campaign-level data, including task structure, season progress, and participation statistics. Useful for both live and development environments.

* [Get Campaign Info](/api-reference/campaign/get-campaign-info) — returns detailed campaign information including all tasks and quests, for both published and development environments.
* [Get Campaign Points](/api-reference/campaign/get-campaign-points) — returns campaign points and season information, calculating season progression based on configured thresholds.
* [Get Campaign Stats](/api-reference/campaign/get-campaign-stats) — returns comprehensive campaign statistics including points awarded and participation metrics.

## Invite codes

Control access to your campaign by issuing, assigning, and managing invite codes linked to user identifiers.

* [Get Invite Code Status](/api-reference/invite-codes/get-invite-code-status) — retrieve information about an invite code, including which users have used it.
* [Use Invite Code](/api-reference/invite-codes/use-invite-code) — assign 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 code as used.
* [Release Invite Code](/api-reference/invite-codes/release-invite-code) — release an invite code that was previously assigned to a user, making it available again.

## Wallets

Use these endpoints to award or withdraw XP 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 Invite Code](/api-reference/wallets/get-wallet-invite-code) — returns the invite code used by a specific wallet.
* [Get Wallet Referral ID](/api-reference/wallets/get-wallet-referral-id) — returns a wallet's referral ID for a specific campaign.
* [Award Wallet XP](/api-reference/wallets/award-wallet-xp) — award an XP reward to a wallet for actions performed outside claimr.
* [Withdraw Wallet Points](/api-reference/wallets/withdraw-wallet-points) — withdraw XP points from a wallet's balance.

## 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](/api-reference/leaderboard/get-leaderboard) — retrieve leaderboard data for a specific campaign. Supports both the v1 format (a basic version available for all campaigns, returning a ranked list of up to 100–150 users) and the v2 format (an advanced, unlimited version available with selected packages).

## Custom API methods and integrations

claimr offers extensive flexibility beyond its standard API methods, allowing for seamless integration with your proprietary systems.

If your project requires unique data handling or custom API endpoints tailored to your specific needs, we can create these custom API methods upon request. Contact our support team to enable this advanced feature.
