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.
- API: See Create a new website user attribute.
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.
- API: See Get users.
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.
403 Forbidden
403 Forbidden
- 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
andorganizationId
.
400 Validation error
400 Validation error
- Cause: Missing required fields (
websiteId
,organizationId
,data
), or invalid IDs. - Fix: Ensure all IDs are valid UUIDs and thedata
array has the correct shape.
User not updated after save
User not updated after save
- Cause: Value upsert succeeded, but UI cache not refreshed.
- Fix: Re-fetch the user or invalidate client cache after saving.
Related APIs
- Create a new website user attribute — see API reference.
- Get users — see API reference.
- Create a new website user attribute value — see API reference.
Use consistent labels and avoid storing secrets or sensitive PII in custom
attributes.