Okta.Sdk.Api.HookKeyApi
October 22, 2025 ยท View on GitHub
All URIs are relative to https://subdomain.okta.com
| Method | HTTP request | Description |
|---|---|---|
| CreateHookKey | POST /api/v1/hook-keys | Create a key |
| DeleteHookKey | DELETE /api/v1/hook-keys/{id} | Delete a key |
| GetHookKey | GET /api/v1/hook-keys/{id} | Retrieve a key by ID |
| GetPublicKey | GET /api/v1/hook-keys/public/{keyId} | Retrieve a public key |
| ListHookKeys | GET /api/v1/hook-keys | List all keys |
| ReplaceHookKey | PUT /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
| Name | Type | Description | Notes |
|---|---|---|---|
| keyRequest | KeyRequest |
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 | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | ID of the Hook Key |
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 | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 429 | Too 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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | ID of the Hook Key |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| 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]
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
| Name | Type | Description | Notes |
|---|---|---|---|
| keyId | string | id" of the Public Key |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| 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]
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
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| 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]
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
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | ID of the Hook Key | |
| keyRequest | KeyRequest |
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]