User Account Lock

POST {{apiPath}}/environments/{{envID}}/users/{{userID}}

The POST /environments/{{envID}}/users/{{userID}} endpoint is called by an administrator or an application to lock a user's account. This operation uses the application/vnd.pingidentity.account.lock+json custom media type as the content type in the request header.

The sample shows the POST /environments/{{envID}}/users/{{userID}} operation to lock an account for the user identified by the user ID and environment ID. This operation takes an optional unlockAt property to include a timestamp that specifies when the user account will be unlocked automatically. If unlockAt is not set or is in the past, the user account is not locked.

This POST request returns a 200 OK message when successful and generates a USER.LOCKED event. When unlockAt expires, the user is unlocked but this action does not generate a USER.UNLOCKED event.

Prerequisites

Request Body

{"unlockAt"=>"2023-06-07T23:59:59Z"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{"_links":{"self":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1"},"environment":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"population":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/populations/d997657f-38c4-435f-b85e-efb71799ea34"},"devices":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1/devices"},"roleAssignments":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1/roleAssignments"},"password":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1/password"},"password.reset":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1/password"},"password.set":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1/password"},"password.check":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1/password"},"password.recover":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1/password"},"linkedAccounts":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1/linkedAccounts"},"account.unlock":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1"},"account.sendVerificationCode":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1"},"memberOfGroups":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/users/5282e30d-6e05-499c-ae68-0069fba776f1/memberOfGroups"}},"id":"5282e30d-6e05-499c-ae68-0069fba776f1","environment":{"id":"abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"account":{"canAuthenticate":false,"lockedAt":"2023-06-06T22:11:15.400Z","secondsUntilUnlock":92923,"status":"LOCKED","unlockAt":"2023-06-07T23:59:59.000Z"},"createdAt":"2023-02-17T20:44:27.905Z","email":"marysample@example.com","enabled":true,"identityProvider":{"type":"PING_ONE"},"lifecycle":{"status":"ACCOUNT_OK"},"mfaEnabled":false,"name":{"given":"Mary","family":"Sample"},"population":{"id":"d997657f-38c4-435f-b85e-efb71799ea34"},"updatedAt":"2023-06-06T22:11:15.401Z","username":"marysample","verifyStatus":"NOT_INITIATED"}