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.

Prerequisites

  • 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.

1 export USERID="5db0221d0a09a219c4ce9218"
2 export AUTH="Basic TOKEN"
3
4 curl "https://exampleapp.staffbase.com/api/users/$userID" \
5 -X PUT \
6 -H "Authorization: $AUTH" \
7 -H "Content-Type: application/json" \
8 --data-raw '{
9 "config": {
10 "locale": "nl_NL"
11 },
12 }' \
13 --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.