Overview
ThePOST /api/users/metadatas endpoint allows you to create or update user objects in Snag’s system. This is essential for migrating users from your existing system or adding new users to your loyalty program.
Only the
walletAddress property is required as this is the unique identifier for the user being created.Wallet Address Requirements
A wallet address is required for creating a Snag user. We currently support the following wallet types:- EVM - Ethereum and EVM-compatible chains (Polygon, BSC, etc.)
- SVM - Solana Virtual Machine
- TON - The Open Network
- SUI - Sui blockchain
- Cosmos - Cosmos ecosystem chains
Creating a User
Basic User Creation
Here’s how to create a user with just the required wallet address:User with Metadata
You can also include additional metadata when creating a user:Using the Snag SDK
External Identifier
TheexternalIdentifier field allows you to maintain your own user ID system while using Snag. This is particularly useful when migrating from an existing system:
Updating User Metadata
The same endpoint can be used to update existing user metadata. Simply provide the wallet address and the fields you want to update:The endpoint is idempotent - calling it multiple times with the same wallet address will update the user rather than create duplicates.
Next Steps
Now that you can create users, learn how to:Generate Wallet Addresses
Learn how to programmatically generate wallet addresses for users who don’t have them.
Migrate Users
Step-by-step guide for migrating your existing user base to Snag.
Manage User Groups
Learn how to connect multiple wallets to a single user using user groups.
Connect Social Accounts
Integrate social media platforms with your users for enhanced loyalty features.