Okta.Sdk.Api.HookKeyApi

October 22, 2025 ยท View on GitHub

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

MethodHTTP requestDescription
CreateHookKeyPOST /api/v1/hook-keysCreate a key
DeleteHookKeyDELETE /api/v1/hook-keys/{id}Delete a key
GetHookKeyGET /api/v1/hook-keys/{id}Retrieve a key by ID
GetPublicKeyGET /api/v1/hook-keys/public/{keyId}Retrieve a public key
ListHookKeysGET /api/v1/hook-keysList all keys
ReplaceHookKeyPUT /api/v1/hook-keys/{id}Replace a key

CreateHookKey

DetailedHookKeyInstance CreateHookKey (KeyRequest keyRequest)

Create a key

Creates a key for use with other parts of the application, such as inline hooks > Note: Use the key name to access this key for inline hook operations. The total number of keys that you can create in an Okta org is limited to 50. The response is a Key object that represents the key that you create. The id property in the response serves as the unique ID for the key, which you can specify when invoking other CRUD operations. The keyId provided in the response is the alias of the public key that you can use to get details of the public key data in a separate call. > Note: The keyId is the alias of the public key that you can use to retrieve the public key.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class CreateHookKeyExample
    {
        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 HookKeyApi(config);
            var keyRequest = new KeyRequest(); // KeyRequest | 

            try
            {
                // Create a key
                DetailedHookKeyInstance result = apiInstance.CreateHookKey(keyRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.CreateHookKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
keyRequestKeyRequest

Return type

DetailedHookKeyInstance

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

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

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

DeleteHookKey

void DeleteHookKey (string id)

Delete a key

Deletes a key by id. After being deleted, the key is unrecoverable. As a safety precaution, only keys that aren't being used are eligible for deletion.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class DeleteHookKeyExample
    {
        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 HookKeyApi(config);
            var id = XreKU5laGwBkjOTehusG;  // string | ID of the Hook Key

            try
            {
                // Delete a key
                apiInstance.DeleteHookKey(id);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.DeleteHookKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
idstringID of the Hook Key

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-
403Forbidden-
404Not Found-
429Too Many Requests-

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

GetHookKey

HookKey GetHookKey (string id)

Retrieve a key by ID

Retrieves the public portion of the Key object using the id parameter >Note: The ?expand=publickey query parameter optionally returns the full object including the details of the public key in the response body's _embedded property.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class GetHookKeyExample
    {
        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 HookKeyApi(config);
            var id = XreKU5laGwBkjOTehusG;  // string | ID of the Hook Key

            try
            {
                // Retrieve a key by ID
                HookKey result = apiInstance.GetHookKey(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.GetHookKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
idstringID of the Hook Key

Return type

HookKey

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

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

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

GetPublicKey

Embedded GetPublicKey (string keyId)

Retrieve a public key

Retrieves a public key by keyId >Note: keyId is the alias of the public key.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class GetPublicKeyExample
    {
        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 HookKeyApi(config);
            var keyId = FcH2P9Eg7wr0o8N2FuV0;  // string | id\" of the Public Key

            try
            {
                // Retrieve a public key
                Embedded result = apiInstance.GetPublicKey(keyId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.GetPublicKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
keyIdstringid" of the Public Key

Return type

Embedded

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

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

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

ListHookKeys

List<HookKey> ListHookKeys ()

List all keys

Lists all keys

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class ListHookKeysExample
    {
        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 HookKeyApi(config);

            try
            {
                // List all keys
                List<HookKey> result = apiInstance.ListHookKeys().ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.ListHookKeys: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List<HookKey>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200Success-
403Forbidden-
429Too Many Requests-

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

ReplaceHookKey

DetailedHookKeyInstance ReplaceHookKey (string id, KeyRequest keyRequest)

Replace a key

Replaces a key by id This request replaces existing properties after passing validation. > Note: The only parameter that you can update is the name of the key, which must be unique at all times.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class ReplaceHookKeyExample
    {
        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 HookKeyApi(config);
            var id = XreKU5laGwBkjOTehusG;  // string | ID of the Hook Key
            var keyRequest = new KeyRequest(); // KeyRequest | 

            try
            {
                // Replace a key
                DetailedHookKeyInstance result = apiInstance.ReplaceHookKey(id, keyRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.ReplaceHookKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

NameTypeDescriptionNotes
idstringID of the Hook Key
keyRequestKeyRequest

Return type

DetailedHookKeyInstance

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]