<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 Assign Users to Apps Using Okta APIs
Okta Classic Engine
Okta Identity Engine
Lifecycle Management
Overview

This article describes how to assign Okta users to applications using Okta APIs.

Applies To
  • Okta APIs
  • User Lifecycle Management
  • Rockstar Browser Extension
Solution

When assigning a user to an app via API call, the following parameters will be needed:

Method is POST with the following call /api/v1/apps/{appId}/users.

See below a request sample:

curl -i -X POST \
  'https://subdomain.okta.com/api/v1/apps/{appId}/users' \
  -H 'Authorization: YOUR_AUTH_INFO_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "00ud4tVDDXYVKPXKVLCO",
    "scope": "USER",
    "credentials": {
      "userName": "rae.cloud@example.com"
    }
  }'

 

This can be done using a third-party tool such as Rockstar or Postman. In the following steps, we will use Rockstar since the API explorer makes this easy.

 
Steps:
  1. Open the application page in Okta.
  2. Open the Rockstar Browser Extension and click on the API Explorer.
  3. Select Post and from the dropdown /api/v1/apps/${appId}/users.
  4. Fill in the body with the following request example, like below:
{

"id": "00ur4avh58WRo4O9i417",
"scope": "USER",
"credentials": {
"userName": "rae.cloud@example.com"
}

}

API explorer

  

  1. Click Send. The response should be Status: 200 success to show the request was completed successfully.

API

Related References

Loading
How to Assign Users to Apps Using Okta APIs