Update username with Okta API

I need to update the username value of a user using the API. Searching on the web I found this link:

It takes me to the API documentation, which have this method

However, this method is not on the Postman API collection of users and I cannot do the update. I also tried with the API Call “Update App Credentials for Assigned User” of the Apps collection, but its not working.

Any help is appreciated.

use this as an example - https://developer.okta.com/docs/reference/api/users/?_ga=2.13663796.2030790437.1601820794-1034218225.1579645140#update-profile-with-id

Hi,

Even though that endpoint it is on the documentation, its not on the Users API Collection, so I cannot call it.

What stops you from creating a Postman entry for it?

Hi @evitoria,

As suggested in https://developer.okta.com/docs/reference/api/users/#update-current-user-s-profile, you could use POST /Users/{userId} to do partial update to the user profile.

An example to update only the username would be to do:

POST https://{oktaOrg}/api/v1/users/{userId}
{
“profile”: {
“login”: “username_updated@mailinator.com
}
}

CURL command:
curl --location --request POST ‘https://dev-634981.oktapreview.com/api/v1/users/00ug93psg5p7tFIhj0h7
–header ‘Accept: application/json’
–header ‘Content-Type: application/json’
–header ‘Authorization: SSWS {apiToken}’
–data-raw ‘{
“profile”: {
“login”: “username_updated@mailinator.com
}
}’

If you would like to use PUT /Users/{userId} as suggested in https://developer.okta.com/docs/reference/api/users/#update-user, all profile properties must be specified. Any property not specified in the request is deleted.

Hi,

Thanks @gpadma and @phi1ipp. You were right, I added the request manually in Postman and was able to do the change.