
p1mah (p1mah) asked a question.
Hello,
We use custom email templates for some actions in the lifecycle, with different translations, and we want to update the language of our users when they change it in our application, so they will receive the emails in the correct language.
I send a POST request to endpoint "/api/v1/users/{userId}", with in the "profile" part of the body, the field "locale" in the correct format (xx_XX) and the field "preferredLanguage" in different format (tried "xx" and "xx-XX") according to the doc (Users | Okta Developer)
When visiting my profile, I can see that it added some parts in it: the "locale" field added a "regionnal parameters" field and the "preferredLanguage" added a preffered language field. My problem is it doesn't change the section just below, the "Language" part. It also doesn't change the language of the emails sent. (see picture below)
But if I change manually by editing the profile from the web, the emails are in the correct language.
My question is: how can I change the end user language using the API please ?
Thank you
Max

Hello,
Thank you for reaching out to the Okta Community!
The User's API documentation should provide additional insight into things:
https://developer.okta.com/docs/api/resources/users
The only way to change the language via API is by changing the "locale" attribute.
There is no way to change the displayed language by API.
There is an already posted Idea for this feature.
We do have some information available regarding prioritizing of languages in general:
https://help.okta.com/en/prod/Content/Topics/Settings/display-language.htm - this does indicate that the user's Display Language is prioritized over the "locale" attribute.
If you need more information on this matter is suggest opening a Support case on this issue.
Regards,
Ovidiu Mihalache
Technical Support Engineer
Okta Global Customer Care