<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z000073BlYQCA0Okta Classic EngineLifecycle ManagementAnswered2025-12-20T09:01:32.000Z2021-07-01T15:06:05.000Z2021-07-04T22:37:21.000Z

p1mah (p1mah) asked a question.

Change end user language using API

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)

 

Image is not available

 

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


  • thua9 (thua9)

    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

    Expand Post
This question is closed.
Loading
Change end user language using API