Learn how to update user profile fields using the User API.
A user profile has many fields that store information about the user.
In this article, you will learn how to update the following user profile fields using the User API:
Header image:
A header image is an image that you can add to a user profile. It appears on the top of the user profile and visually personalizes the user’s profile. You can use the usual web formats for the header image, such as jpg and png. The image has no fixed resolution, as it has a flexible width. But the fixed height is 390px on desktop and 268px on mobile. How the header image looks varies depending on browser window size and/or display size. Learn more
Pronoun:
A pronoun field on a user profile allows users to set which pronouns they use. This shows how they want to be referred to when describing their gender identity. This helps to create a respectful and inclusive environment for your users.
Profile headline:
A profile headline is a short phrase or title that appears at the top of a user’s profile. It can be used to reflect their personality, interests, or goals.
Manager:
A manager field in the user profile is filled with the manager of the user. This is also helpful for setting up the Org Chart.
System & custom fields:
System fields are predefined profile fields in Staffbase. Custom fields can be added and maintained by administrators. Overview of Profile Fields.
You can also use this method to update other custom profile fields. If you want to update the avatar image, see Update the Avatar Using the User API.
header image
, pronoun
and profile headline
.exampleapp.domain.com
and the media server is cdn-de1.staffbase.com
, then you need to allow list cdn-de1.staffbase.com
for your app.externalID
or id
of the users’ profiles you want to update.To upload a header image, do the following:
Step 1: Get the URL to the header image.
Step 2: Update the header image of a user.
You can skip this step if you already have the URL to the header image.
POST
request to the endpoint /media
to upload the file.Learn more about our Media API.
Make a POST
request to the endpoint /users/{userID}
. In the request body schema, create an object profileHeaderImage
as shown in the example, and set the value for the url
property with the header image URL.
You have updated the header image of a user. To bulk update header images, add a function to loop through all users to perform your requests.
Make a POST
request to the endpoint /users/{userID}
. In the request body schema, create an object pronouns
as shown in the example, and set it with the user’s preferred gender pronoun.
You have updated the pronoun of a user. To bulk update pronouns, add a function to loop through all users to perform your requests.
Make a POST
request to the endpoint /users/{userID}
. In the request body schema, create an object profileHeadline
as shown in the example, and set it with a profile headline for the user.
You have updated the profile headline of a user. To bulk update profile headlines, add a function to loop through all users to perform your requests.
Make a POST
request to the endpoint /users/{userID}
. In the request body schema, create an object system_manager
as shown in the example, and set it with the userID of the user’s manager.
You have updated a user profile with the manager’s details. To bulk update manager fields for several users, add a function to loop through all users to perform your requests.
Note: This example assumes you have a custom profile field created in Staffbase with the profile field ID businessunit
.
Make a POST
request to the endpoint /users/{userID}
. In the request body schema, create an object businessunit
as shown in the example, and set it with the business unit of the user.
In addition, you can also update the department
and location
system fields as shown in the example.
You have updated a user profile with business unit, department and location details. To bulk update fields for several users, add a function to loop through all users to perform your requests.