Okta.Sdk.Api.RealmAssignmentApi
October 22, 2025 ยท View on GitHub
All URIs are relative to https://subdomain.okta.com
| Method | HTTP request | Description |
|---|---|---|
| ActivateRealmAssignment | POST /api/v1/realm-assignments/{assignmentId}/lifecycle/activate | Activate a realm assignment |
| CreateRealmAssignment | POST /api/v1/realm-assignments | Create a realm assignment |
| DeactivateRealmAssignment | POST /api/v1/realm-assignments/{assignmentId}/lifecycle/deactivate | Deactivate a realm assignment |
| DeleteRealmAssignment | DELETE /api/v1/realm-assignments/{assignmentId} | Delete a realm assignment |
| ExecuteRealmAssignment | POST /api/v1/realm-assignments/operations | Execute a realm assignment |
| GetRealmAssignment | GET /api/v1/realm-assignments/{assignmentId} | Retrieve a realm assignment |
| ListRealmAssignmentOperations | GET /api/v1/realm-assignments/operations | List all realm assignment operations |
| ListRealmAssignments | GET /api/v1/realm-assignments | List all realm assignments |
| ReplaceRealmAssignment | PUT /api/v1/realm-assignments/{assignmentId} | Replace a realm assignment |
ActivateRealmAssignment
void ActivateRealmAssignment (string assignmentId)
Activate a realm assignment
Activates a realm assignment
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ActivateRealmAssignmentExample
{
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 RealmAssignmentApi(config);
var assignmentId = rul2jy7jLUlnO3ng00g4; // string | ID of the realm assignment
try
{
// Activate a realm assignment
apiInstance.ActivateRealmAssignment(assignmentId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RealmAssignmentApi.ActivateRealmAssignment: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| assignmentId | string | ID of the realm assignment |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | No Content | - |
| 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]
CreateRealmAssignment
RealmAssignment CreateRealmAssignment (CreateRealmAssignmentRequest body)
Create a realm assignment
Creates a new realm assignment
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class CreateRealmAssignmentExample
{
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 RealmAssignmentApi(config);
var body = new CreateRealmAssignmentRequest(); // CreateRealmAssignmentRequest |
try
{
// Create a realm assignment
RealmAssignment result = apiInstance.CreateRealmAssignment(body);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RealmAssignmentApi.CreateRealmAssignment: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateRealmAssignmentRequest |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | Created | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeactivateRealmAssignment
void DeactivateRealmAssignment (string assignmentId)
Deactivate a realm assignment
Deactivates a realm assignment
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class DeactivateRealmAssignmentExample
{
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 RealmAssignmentApi(config);
var assignmentId = rul2jy7jLUlnO3ng00g4; // string | ID of the realm assignment
try
{
// Deactivate a realm assignment
apiInstance.DeactivateRealmAssignment(assignmentId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RealmAssignmentApi.DeactivateRealmAssignment: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| assignmentId | string | ID of the realm assignment |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | No Content | - |
| 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]
DeleteRealmAssignment
void DeleteRealmAssignment (string assignmentId)
Delete a realm assignment
Deletes a realm assignment
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class DeleteRealmAssignmentExample
{
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 RealmAssignmentApi(config);
var assignmentId = rul2jy7jLUlnO3ng00g4; // string | ID of the realm assignment
try
{
// Delete a realm assignment
apiInstance.DeleteRealmAssignment(assignmentId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RealmAssignmentApi.DeleteRealmAssignment: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| assignmentId | string | ID of the realm assignment |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | No Content | - |
| 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]
ExecuteRealmAssignment
OperationResponse ExecuteRealmAssignment (OperationRequest body)
Execute a realm assignment
Executes a realm assignment
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ExecuteRealmAssignmentExample
{
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 RealmAssignmentApi(config);
var body = new OperationRequest(); // OperationRequest |
try
{
// Execute a realm assignment
OperationResponse result = apiInstance.ExecuteRealmAssignment(body);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RealmAssignmentApi.ExecuteRealmAssignment: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| body | OperationRequest |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | Created | - |
| 400 | Bad Request | - |
| 403 | Forbidden | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetRealmAssignment
RealmAssignment GetRealmAssignment (string assignmentId)
Retrieve a realm assignment
Retrieves a realm assignment
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class GetRealmAssignmentExample
{
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 RealmAssignmentApi(config);
var assignmentId = rul2jy7jLUlnO3ng00g4; // string | ID of the realm assignment
try
{
// Retrieve a realm assignment
RealmAssignment result = apiInstance.GetRealmAssignment(assignmentId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RealmAssignmentApi.GetRealmAssignment: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| assignmentId | string | ID of the realm assignment |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | 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]
ListRealmAssignmentOperations
List<OperationResponse> ListRealmAssignmentOperations (int? limit = null, string after = null)
List all realm assignment operations
Lists all realm assignment operations. The upper limit is 200 and operations are sorted in descending order from most recent to oldest by ID.
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListRealmAssignmentOperationsExample
{
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 RealmAssignmentApi(config);
var limit = 20; // int? | A limit on the number of objects to return (optional) (default to 20)
var after = "after_example"; // string | The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)
try
{
// List all realm assignment operations
List<OperationResponse> result = apiInstance.ListRealmAssignmentOperations(limit, after).ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RealmAssignmentApi.ListRealmAssignmentOperations: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int? | A limit on the number of objects to return | [optional] [default to 20] |
| after | string | The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See Pagination. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 403 | Forbidden | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListRealmAssignments
List<RealmAssignment> ListRealmAssignments (int? limit = null, string after = null)
List all realm assignments
Lists all realm assignments
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ListRealmAssignmentsExample
{
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 RealmAssignmentApi(config);
var limit = 20; // int? | A limit on the number of objects to return (optional) (default to 20)
var after = "after_example"; // string | The cursor used for pagination. It represents the priority of the last realm assignment returned in the previous fetch operation. (optional)
try
{
// List all realm assignments
List<RealmAssignment> result = apiInstance.ListRealmAssignments(limit, after).ToListAsync();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RealmAssignmentApi.ListRealmAssignments: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int? | A limit on the number of objects to return | [optional] [default to 20] |
| after | string | The cursor used for pagination. It represents the priority of the last realm assignment returned in the previous fetch operation. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | OK | - |
| 403 | Forbidden | - |
| 429 | Too Many Requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReplaceRealmAssignment
RealmAssignment ReplaceRealmAssignment (string assignmentId, UpdateRealmAssignmentRequest body)
Replace a realm assignment
Replaces a realm assignment
Example
using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;
namespace Example
{
public class ReplaceRealmAssignmentExample
{
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 RealmAssignmentApi(config);
var assignmentId = rul2jy7jLUlnO3ng00g4; // string | ID of the realm assignment
var body = new UpdateRealmAssignmentRequest(); // UpdateRealmAssignmentRequest |
try
{
// Replace a realm assignment
RealmAssignment result = apiInstance.ReplaceRealmAssignment(assignmentId, body);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling RealmAssignmentApi.ReplaceRealmAssignment: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| assignmentId | string | ID of the realm assignment | |
| body | UpdateRealmAssignmentRequest |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | 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]