Skip to content

Deactivate a user

Request

CORS
OAuth 2.0 scope:
  • okta.users.manage

Deactivates a user.

Perform this operation only on users that do not have a DEPROVISIONED status.

  • The user's transitioningToStatus property is DEPROVISIONED during deactivation to indicate that the user hasn't completed the asynchronous operation.
  • The user's status is DEPROVISIONED when the deactivation process is complete.

Important: Deactivating a user is a destructive operation. The user is deprovisioned from all assigned apps, which might destroy their data such as email or files. This action cannot be recovered!

You can also perform user deactivation asynchronously. To invoke asynchronous user deactivation, pass an HTTP header Prefer: respond-async with the request.

Note: Users with the DEPROVISIONED status won't have their profiles updated when running the Update a user endpoint unless you have the Edit Deactived User Profile Updates option turned on in the Admin Console. See Edit deactivated user profiles.

Path
idstringrequired

An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user

Query
sendEmailboolean

Sends a deactivation email to the admin if true

Default:false
Headers
Preferstring

Request asynchronous processing

Value:"respond-async"
curl -i -X POST \
  'https://subdomain.okta.com/api/v1/users/{id}/lifecycle/deactivate?sendEmail=false' \
  -H 'Prefer: respond-async'

Responses

OK

Response
No content