enough-vase-33352
09/12/2025, 7:53 AMchilly-king-10285
09/12/2025, 7:53 AMchilly-king-10285
09/12/2025, 7:53 AMtraits
field. Traits are user attributes that can be updated by the identity owner (for example, via the settings flow) or by an admin using the /admin/identities
API. If your identity schema allows for multiple emails (e.g., an array of emails), you can update this array as well. However, there are known limitations and issues when updating array traits (like multiple emails) via the settings flow, and you may need to ensure your form data is structured correctly. Some users have reported that only the last email is saved or that array updates do not work as expected in the UI, so this may require additional handling or workarounds in your implementation. Direct updates via the admin API are more reliable for such cases [Customize identity schemas - Multiple emails and password](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#examples), [Cannot update array traits in settings flow](https://github.com/ory/kratos/issues/2374). As metadata: You can also store additional email addresses in the metadata_public
or metadata_admin
fields. These fields are only modifiable by an admin using the /admin/identities
API and are not user-editable via self-service flows. Metadata is not validated by the identity schema, so you can store any structure you need, such as an array of additional emails [Identity metadata & traits](https://www.ory.sh/docs/kratos/manage-identities/managing-users-identities-metadata). How to update: - To update traits (including email), use the settings flow (for user self-service) or the admin API (for programmatic/admin updates). - To update metadata, use the admin API. Example (admin API, updating traits): json { "traits": { "email": "<mailto:new@email.com|new@email.com>" } }
or, for multiple emails (if your schema supports it): json { "traits": { "emails": ["<mailto:first@email.com|first@email.com>", "<mailto:second@email.com|second@email.com>"] } }
Example (admin API, updating metadata): json { "metadata_public": { "additional_emails": ["<mailto:other@email.com|other@email.com>"] } }
In summary, both approaches are supported, but updating array traits via self-service flows may require extra care due to current limitations in form handling and UI rendering [Cannot update array traits in settings flow](https://github.com/ory/kratos/issues/2374), [Identity metadata & traits](https://www.ory.sh/docs/kratos/manage-identities/managing-users-identities-metadata).