Learn how to populate the user reference input type for profile fields using the User API.
In this article, you will learn how to update the user reference field of a large number of users. For example, their manager field. In that case, you can bulk update the manager profile field for these users using the User API.
Copy the base URL from the API token page in the Staffbase Studio before you begin.
id
or externalID
of the userYou need to first retrieve the user ID or the identifier of the user’s profile field you want to update.
GET
request to the endpoint /users
to list all users.id
or externalID
of the user.You have the user ID or the identifier of the user’s profile field you want to update.
Make a PUT
request to the endpoint /users/{userID}
and in the request body schema, set the manager parameter with an identifier or the User ID of the user.
You have updated the user reference input type profile field of a user. To bulk update this profile field, add a function to loop through all users to perform your requests.