Okta.Sdk.Api.RealmAssignmentApi

October 22, 2025 ยท View on GitHub

All URIs are relative to https://subdomain.okta.com

MethodHTTP requestDescription
ActivateRealmAssignmentPOST /api/v1/realm-assignments/{assignmentId}/lifecycle/activateActivate a realm assignment
CreateRealmAssignmentPOST /api/v1/realm-assignmentsCreate a realm assignment
DeactivateRealmAssignmentPOST /api/v1/realm-assignments/{assignmentId}/lifecycle/deactivateDeactivate a realm assignment
DeleteRealmAssignmentDELETE /api/v1/realm-assignments/{assignmentId}Delete a realm assignment
ExecuteRealmAssignmentPOST /api/v1/realm-assignments/operationsExecute a realm assignment
GetRealmAssignmentGET /api/v1/realm-assignments/{assignmentId}Retrieve a realm assignment
ListRealmAssignmentOperationsGET /api/v1/realm-assignments/operationsList all realm assignment operations
ListRealmAssignmentsGET /api/v1/realm-assignmentsList all realm assignments
ReplaceRealmAssignmentPUT /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

NameTypeDescriptionNotes
assignmentIdstringID of the realm assignment

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
204No Content-
400Bad Request-
403Forbidden-
404Not Found-
429Too 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

NameTypeDescriptionNotes
bodyCreateRealmAssignmentRequest

Return type

RealmAssignment

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
201Created-
400Bad Request-
403Forbidden-
429Too 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

NameTypeDescriptionNotes
assignmentIdstringID of the realm assignment

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
204No Content-
400Bad Request-
403Forbidden-
404Not Found-
429Too 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

NameTypeDescriptionNotes
assignmentIdstringID of the realm assignment

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
204No Content-
400Bad Request-
403Forbidden-
404Not Found-
429Too 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

NameTypeDescriptionNotes
bodyOperationRequest

Return type

OperationResponse

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
201Created-
400Bad Request-
403Forbidden-
429Too 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

NameTypeDescriptionNotes
assignmentIdstringID of the realm assignment

Return type

RealmAssignment

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Success-
400Bad Request-
403Forbidden-
404Not Found-
429Too 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

NameTypeDescriptionNotes
limitint?A limit on the number of objects to return[optional] [default to 20]
afterstringThe 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

List<OperationResponse>

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
403Forbidden-
429Too 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

NameTypeDescriptionNotes
limitint?A limit on the number of objects to return[optional] [default to 20]
afterstringThe cursor used for pagination. It represents the priority of the last realm assignment returned in the previous fetch operation.[optional]

Return type

List<RealmAssignment>

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200OK-
403Forbidden-
429Too 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

NameTypeDescriptionNotes
assignmentIdstringID of the realm assignment
bodyUpdateRealmAssignmentRequest

Return type

RealmAssignment

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-
400Bad Request-
403Forbidden-
404Not Found-
429Too Many Requests-

[Back to top] [Back to API list] [Back to Model list] [Back to README]