
yc954 (yc954) asked a question.
I tried to change an existing user password using /api/v1/users/ end point and got the following error. What is the actual cause of the error ?
{
"errorCode": "E0000001",
"errorSummary": "Api validation failed: password",
"errorLink": "E0000001",
"errorId": "oae5RivB-NyRO2JD_aCEim6ug",
"errorCauses": [
{
"errorSummary": "password: Password"
}
]
}

@yc954 (yc954) - API validation failed typically indicates a problem with the payload. For example if you have a missing attribute when an attribute is expected.
So for example from the API documentation for change_password you can see it requires 3 key:value pairs at the top level and old/new password objects need a key:value pair of value:xxxx
curl -i -X POST \
'https://subdomain.okta.com/api/v1/users/{userId}/credentials/change_password' \
-H 'Authorization: YOUR_AUTH_INFO_HERE' \
-H 'Content-Type: application/json' \
-d '{
"oldPassword": {
"value": "tlpWENT2m"
},
"newPassword": {
"value": "uTVM,TPw55"
},
"revokeSessions": true
}'
Here's a screenshot leveraging Okta Workflows using "Expire with temp pass" + Update Password which allows you as an admin to set any password you want. The final object Construct is the body used to update the password