All URIs are relative to https://subdomain.okta.com
Method | HTTP request | Description |
---|---|---|
AssignRoleToClient | POST /oauth2/v1/clients/{clientId}/roles | Assign Role to Client |
AssignRoleToGroup | POST /api/v1/groups/{groupId}/roles | Assign a Role to a Group |
AssignRoleToUser | POST /api/v1/users/{userId}/roles | Assign a Role to a User |
DeleteRoleFromClient | DELETE /oauth2/v1/clients/{clientId}/roles/{roleId} | Unassign a Role from a Client |
GetGroupAssignedRole | GET /api/v1/groups/{groupId}/roles/{roleId} | Retrieve a Role assigned to Group |
GetUserAssignedRole | GET /api/v1/users/{userId}/roles/{roleId} | Retrieve a Role assigned to a User |
ListAssignedRolesForUser | GET /api/v1/users/{userId}/roles | List all Roles assigned to a User |
ListGroupAssignedRoles | GET /api/v1/groups/{groupId}/roles | List all Assigned Roles of Group |
ListRolesForClient | GET /oauth2/v1/clients/{clientId}/roles | List all Roles for a Client |
ListUsersWithRoleAssignments | GET /api/v1/iam/assignees/users | List all Users with Role Assignments |
RetrieveClientRole | GET /oauth2/v1/clients/{clientId}/roles/{roleId} | Retrieve a Client Role |
UnassignRoleFromGroup | DELETE /api/v1/groups/{groupId}/roles/{roleId} | Unassign a Role from a Group |
UnassignRoleFromUser | DELETE /api/v1/users/{userId}/roles/{roleId} | Unassign a Role from a User |
ModelClient AssignRoleToClient (string clientId, AssignRoleToClientRequest assignRoleToClientRequest)
Assign Role to Client
Assigns a Role to a Client
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class AssignRoleToClientExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var clientId = 52Uy4BUWVBOjFItcg2jWsmnd83Ad8dD; // string | `client_id` of the app
var assignRoleToClientRequest = new AssignRoleToClientRequest(); // AssignRoleToClientRequest |
try
{
// Assign Role to Client
ModelClient result = apiInstance.AssignRoleToClient(clientId, assignRoleToClientRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.AssignRoleToClient: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
clientId | string | `client_id` of the app | |
assignRoleToClientRequest | AssignRoleToClientRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Role AssignRoleToGroup (string groupId, AssignRoleRequest assignRoleRequest, bool? disableNotifications = null)
Assign a Role to a Group
Assigns a role to a group
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class AssignRoleToGroupExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var groupId = 00g1emaKYZTWRYYRRTSK; // string | The `id` of the group
var assignRoleRequest = new AssignRoleRequest(); // AssignRoleRequest |
var disableNotifications = true; // bool? | Setting this to `true` grants the group third-party admin status (optional)
try
{
// Assign a Role to a Group
Role result = apiInstance.AssignRoleToGroup(groupId, assignRoleRequest, disableNotifications);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.AssignRoleToGroup: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
groupId | string | The `id` of the group | |
assignRoleRequest | AssignRoleRequest | ||
disableNotifications | bool? | Setting this to `true` grants the group third-party admin status | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
201 | Success | - |
400 | Bad Request | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Role AssignRoleToUser (string userId, AssignRoleRequest assignRoleRequest, bool? disableNotifications = null)
Assign a Role to a User
Assigns a role to a user identified by userId
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class AssignRoleToUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var userId = "userId_example"; // string | ID of an existing Okta user
var assignRoleRequest = new AssignRoleRequest(); // AssignRoleRequest |
var disableNotifications = true; // bool? | Setting this to `true` grants the user third-party admin status (optional)
try
{
// Assign a Role to a User
Role result = apiInstance.AssignRoleToUser(userId, assignRoleRequest, disableNotifications);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.AssignRoleToUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | string | ID of an existing Okta user | |
assignRoleRequest | AssignRoleRequest | ||
disableNotifications | bool? | Setting this to `true` grants the user third-party admin status | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
400 | Bad Request | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void DeleteRoleFromClient (string clientId, string roleId)
Unassign a Role from a Client
Unassigns a Role from a Client
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class DeleteRoleFromClientExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var clientId = 52Uy4BUWVBOjFItcg2jWsmnd83Ad8dD; // string | `client_id` of the app
var roleId = 3Vg1Pjp3qzw4qcCK5EdO; // string | `id` of the Role
try
{
// Unassign a Role from a Client
apiInstance.DeleteRoleFromClient(clientId, roleId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.DeleteRoleFromClient: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
clientId | string | `client_id` of the app | |
roleId | string | `id` of the Role |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Role GetGroupAssignedRole (string groupId, string roleId)
Retrieve a Role assigned to Group
Retrieves a role identified by roleId
assigned to group identified by groupId
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class GetGroupAssignedRoleExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var groupId = 00g1emaKYZTWRYYRRTSK; // string | The `id` of the group
var roleId = 3Vg1Pjp3qzw4qcCK5EdO; // string | `id` of the Role
try
{
// Retrieve a Role assigned to Group
Role result = apiInstance.GetGroupAssignedRole(groupId, roleId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.GetGroupAssignedRole: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
groupId | string | The `id` of the group | |
roleId | string | `id` of the Role |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Role GetUserAssignedRole (string userId, string roleId)
Retrieve a Role assigned to a User
Retrieves a role identified by roleId
assigned to a user identified by userId
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class GetUserAssignedRoleExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var userId = "userId_example"; // string | ID of an existing Okta user
var roleId = 3Vg1Pjp3qzw4qcCK5EdO; // string | `id` of the Role
try
{
// Retrieve a Role assigned to a User
Role result = apiInstance.GetUserAssignedRole(userId, roleId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.GetUserAssignedRole: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | string | ID of an existing Okta user | |
roleId | string | `id` of the Role |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<Role> ListAssignedRolesForUser (string userId, string expand = null)
List all Roles assigned to a User
Lists all roles assigned to a user identified by userId
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListAssignedRolesForUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var userId = "userId_example"; // string | ID of an existing Okta user
var expand = "expand_example"; // string | (optional)
try
{
// List all Roles assigned to a User
List<Role> result = apiInstance.ListAssignedRolesForUser(userId, expand).ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.ListAssignedRolesForUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | string | ID of an existing Okta user | |
expand | string | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<Role> ListGroupAssignedRoles (string groupId, string expand = null)
List all Assigned Roles of Group
Lists all assigned roles of group identified by groupId
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListGroupAssignedRolesExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var groupId = 00g1emaKYZTWRYYRRTSK; // string | The `id` of the group
var expand = "expand_example"; // string | (optional)
try
{
// List all Assigned Roles of Group
List<Role> result = apiInstance.ListGroupAssignedRoles(groupId, expand).ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.ListGroupAssignedRoles: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
groupId | string | The `id` of the group | |
expand | string | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ModelClient ListRolesForClient (string clientId)
List all Roles for a Client
Lists all Roles by clientId
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListRolesForClientExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var clientId = 52Uy4BUWVBOjFItcg2jWsmnd83Ad8dD; // string | `client_id` of the app
try
{
// List all Roles for a Client
ModelClient result = apiInstance.ListRolesForClient(clientId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.ListRolesForClient: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
clientId | string | `client_id` of the app |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RoleAssignedUsers ListUsersWithRoleAssignments (string after = null, int? limit = null)
List all Users with Role Assignments
Lists all users with Role Assignments
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListUsersWithRoleAssignmentsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var after = "after_example"; // string | (optional)
var limit = 100; // int? | Specifies the number of results returned. Defaults to `100`. (optional) (default to 100)
try
{
// List all Users with Role Assignments
RoleAssignedUsers result = apiInstance.ListUsersWithRoleAssignments(after, limit);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.ListUsersWithRoleAssignments: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
after | string | [optional] | |
limit | int? | Specifies the number of results returned. Defaults to `100`. | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
403 | Forbidden | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ModelClient RetrieveClientRole (string clientId, string roleId)
Retrieve a Client Role
Retrieves a Client Role
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class RetrieveClientRoleExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var clientId = 52Uy4BUWVBOjFItcg2jWsmnd83Ad8dD; // string | `client_id` of the app
var roleId = 3Vg1Pjp3qzw4qcCK5EdO; // string | `id` of the Role
try
{
// Retrieve a Client Role
ModelClient result = apiInstance.RetrieveClientRole(clientId, roleId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.RetrieveClientRole: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
clientId | string | `client_id` of the app | |
roleId | string | `id` of the Role |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void UnassignRoleFromGroup (string groupId, string roleId)
Unassign a Role from a Group
Unassigns a role identified by roleId
assigned to group identified by groupId
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class UnassignRoleFromGroupExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var groupId = 00g1emaKYZTWRYYRRTSK; // string | The `id` of the group
var roleId = 3Vg1Pjp3qzw4qcCK5EdO; // string | `id` of the Role
try
{
// Unassign a Role from a Group
apiInstance.UnassignRoleFromGroup(groupId, roleId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.UnassignRoleFromGroup: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
groupId | string | The `id` of the group | |
roleId | string | `id` of the Role |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void UnassignRoleFromUser (string userId, string roleId)
Unassign a Role from a User
Unassigns a role identified by roleId
from a user identified by userId
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class UnassignRoleFromUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.OktaDomain = "https://subdomain.okta.com";
// Configure API key authorization: apiToken
config.Token ="YOUR_API_KEY";
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new RoleAssignmentApi(config);
var userId = "userId_example"; // string | ID of an existing Okta user
var roleId = 3Vg1Pjp3qzw4qcCK5EdO; // string | `id` of the Role
try
{
// Unassign a Role from a User
apiInstance.UnassignRoleFromUser(userId, roleId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RoleAssignmentApi.UnassignRoleFromUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | string | ID of an existing Okta user | |
roleId | string | `id` of the Role |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
403 | Forbidden | - |
404 | Not Found | - |
429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]