<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
How to Use Delete User API (OAuth 2) via Postman
Lifecycle Management
API Access Management
Okta Classic Engine
Okta Identity Engine
Overview

This article describes how to delete a user via Postman with the Okta API call.

 

This is an optional step for customers who want to bypass the manual click action away from the Okta admin console.
 

Applies To
  • API (OAuth 2)
  • User-Based Mode
  • Postman
  • User Administration
Solution

Prerequisites

  • Okta admin or developer will have to set up or configure the Postman app Environment with Okta org/tenant details beforehand! 
  • If this action is used on an active Okta user, the user will first be deactivated, and a second Delete User action is necessary to delete the user.
  • This action cannot be recovered!

NOTE: Okta does not recommend using the Okta-proprietary SSWS API token authentication scheme. 

Steps

This API token scheme allows access to a broad range of APIs because there is no scope associated with the token. Access to the APIs depends on the privileges of the user who created the API token. The API token also has a fixed expiry date.

For more details, please check here and start using the OAuth 2.0 Authorization Code grant flow instead:

  1. Please complete the following steps from the Developer docs:
    1. User-based API access setup.
    2. Service-based API access setup.
    3. Send a request.
    4. Get an access token and make a request.
  2. Then, only make a request with the access token (that was generated from the User-based or Service-based API above). 

 

Below are the steps that need to be taken in order to run a deletion of users via Postman:

  • NOTE: Admins will need to find out or have the selected Okta userID handy as well in order to match the variable {{userId}}.

The call to delete a user is:

DELETE {{url}}/api/v1/users/{{userId}}

Again, the user will first be deactivated, and a second "Delete User" action is necessary to delete the user.

 

Also, make sure to have the following Headers (no more Authorization SSWS key) under this API Call collection:

  • Key: Accept
    • Value: application/json
  • Key: Content-Type
    • Value: application/json

keys and values


Once successful, the admin will receive an http code with 200 or 204 on the Postman client (example) for the User Deletion action:

200 code

 

NOTE: The lifetime of the JWT tokens is hard-coded to the following values:

  • ID token: 60 minutes
  • Access token: 60 minutes
  • Refresh token: 90 days
Loading
How to Use Delete User API (OAuth 2) via Postman