Update the Content Language With the User API

Learn how to update user content Language via the User API.

Employee App
Front Door Intranet

In this article, we’ll look at how to update user content Language via the User API .

You have invited a large number of users to the Staffbase platform and want to update their content language, for example, to Dutch. In this case, you can bulk update the language locale for these users to set their content language to Dutch.

Learn more about our languages and locale codes.

  • You have already created an API token with administrative access via the Staffbase Studio. Learn more.
  • You have either the externalID or id of the users’ profiles you want to update.

Make a PUT request to the endpoint /users/{userID} and in the request body schema, set the locale parameter to nl_NL, the locale code for Dutch.

Terminal window
export USERID="5db0221d0a09a219c4ce9218"
export AUTH="Basic TOKEN"
curl "https://exampleapp.staffbase.com/api/users/$userID" \
-X PUT \
-H "Authorization: $AUTH" \
-H "Content-Type: application/json" \
--data-raw '{
"config": {
"locale": "nl_NL"
},
}' \
--compressed | json_pp

You have updated the content language setting for a user. To bulk update the content language for multiple users, add a function to loop through all users to perform your requests.