Skip to main content
You can add custom fields to user profiles and use them across your website and APIs.
Custom attributes are ideal for capturing structured data like “Favorite Team” or “External Profile Link” that isn’t part of the default profile.

Where custom attributes come from

  • You can define attributes in Admin → Customization → User Profiles.
  • Or you can create them via API.
1

Create a custom user attribute (UI or API)

If you’re using the Admin UI, add a new field in the User Profiles section. To use the API, create attributes with a label that users will see.
You should see the new attribute in Admin → Customization → User Profiles.
You must include a valid X-API-KEY. Missing or invalid keys result in 403 Forbidden.
2

Let users edit attributes in the profile modal

In Snag’s template, custom attributes appear as editable fields in the Edit Profile modal automatically. No extra code is required after you create the attributes.
Field order and labels come from how you configured attributes in Admin or via the API.
3

Fetch users along with their attribute values

Use the Users API to retrieve users and their saved values for any defined attributes.
Confirm the response includes each user and their stored values for the attributes you defined.
4

Save or update a user's attribute value via API

When a user edits their profile (or when you set values server-side), upsert attribute values using the attribute values endpoint.
Re-fetch the user and verify the updated value appears.
  • Cause: Missing or invalid X-API-KEY, or insufficient permissions.
  • Fix: Provide a valid API key with permission to write attributes/values for the given websiteId and organizationId.
  • Cause: Missing required fields (websiteId, organizationId, data), or invalid IDs. - Fix: Ensure all IDs are valid UUIDs and the data array has the correct shape.
  • Cause: Value upsert succeeded, but UI cache not refreshed.
  • Fix: Re-fetch the user or invalidate client cache after saving.
Use consistent labels and avoid storing secrets or sensitive PII in custom attributes.