Change an Okta User Attribute or Password via API
Last Updated:
Overview
Administrators can change an Okta user attribute or password by executing an Okta REST API call. Use Postman to configure the API request body with the desired attribute values or new password credentials to update the user profile.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Okta REST API
- Universal Directory
- Users
Solution
What are the steps to change an Okta user attribute or password via API?
Change an Okta user attribute or password by configuring the Postman environment, formatting the API request URL and headers, and modifying the request body with the new values.
- Set up the Postman environment and import the Okta API collections by following the instructions in Test the Okta REST APIs using Postman.
- Verify the attributes are editable in Okta. If the user has a profile master other than Okta, the source application must edit the profile.
- Retrieve the variable name to modify by executing an API call or by navigating to Directory > Profile Editor > Okta Profile (default) in the Okta Admin Console.
- Format the URL and headers for the Update User API call using the
PUTmethod instead of thePOSTmethod.
NOTE: If the required attributes are not defined and thePOSTmethod is used, Okta returns a 400 Bad Request error.
Format the URL and headers as shown in the following example. - Modify the request body for the specific use case to change a single attribute or multiple attributes. The password does not display in the response.
{
"profile": {
"department" : "HR",
"firstName": "John",
"lastName" : "Smith"
},
"credentials": {
"password": "Supersecretp@ssword123"
}
}
- Select Send to execute the API call. A successful update returns a 200 OK response, modifying the attributes as shown in the before and after examples.
