Overview

The POST /api/users/metadatas allows you to create user account objects in Snag’s system which can then be used to migrate users from your existing system. This also allows you to attach useful metadata to new and existing users, such as their social network handle, which can be used for a more seamless user experience in-app and for use in the loyalty program.

Steps to create a user

Example use-case

For the case where you are migrating your users from an existing system to Snag, you would loop over each of your users and, for each, hit the POST /api/users/metadatas endpoint with their wallet address and any metadata you wish to attach. Below is an example request which creates a user account for the given wallet address and attaches various social network handles.

Example Request

{
  "walletAddress": "0x1...",
  "discordUser": "discord-user",
  "twitterUser": "twitter-user",
  "emailAddress": "email-address",
  "telegramUsername": "telegram-user",
  "displayName": "profile-name",
  "logoUrl": "https://...png"
}
  • Note: only the walletAddress property is required as this is the identifier for the user being created.

Example Response

{
  "id": "your-user-id",
  "walletAddress": "0x1...",
  "discordUser": "discord-user",
  "twitterUser": "twitter-user",
  "emailAddress": "email-address",
  "telegramUsername": "telegram-user",
  "displayName": "profile-name",
  "logoUrl": "https://...png"
}