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.
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
websiteIdandorganizationId.
400 Validation error
400 Validation error
- Cause: Missing required fields (
websiteId,organizationId,data), or invalid IDs. - Fix: Ensure all IDs are valid UUIDs and thedataarray 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.