This article describes how to change an Okta User's attribute(s) or password via API.
- Okta API
- Users
- Universal Directory
Admins may leverage Postman, copy the body and URL, and get to POST-ing. To start this, please follow the steps for setting up the environment and getting the Okta API collections.
- This guide is based on the Update User API call, but instead of using POST, use PUT:
- If Admins do not define the required attributes and use POST, Admins will receive a 400 Bad Request error:
If errors are thrown, please:
- Check if attributes are editable in Okta. If the user has another profile master other than Okta, the application must edit their profiles.
- Retrieve the variable name that Admins want to modify. This can be done through API or just by checking the Okta Profile in the Profile editor (Admin Dashboard > Directory > Profile Editor > Okta Profile (default)).
- Format the URL and headers just like in the image below:
- Modify the body for the Admin's use case. The password will not be displayed in the response.
- Here is how it would look for a single attribute change or multiple:
Body:
{
"profile": {
"department" : "HR",
"firstName": "John",
"lastName" : "Smith"
},
"credentials": {
"password": "Supersecretp@ssword123"
}
}
- Click Send. If a 200 OK response is received, congratulations!
- Here is a before and after example of the attribute(s) being modified.
