Skip to main content
POST
https://{tenantDomain}/api/v2
/
keys
/
encryption
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using Auth0.ManagementApi.Keys;

public partial class Examples
{
    public async Task Example() {
        var client = new ManagementClient(
            token: "<token>"
        );

        await client.Keys.Encryption.CreateAsync(
            new CreateEncryptionKeyRequestContent {
                Type = CreateEncryptionKeyType.CustomerProvidedRootKey
            }
        );
    }

}
{
  "kid": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "parent_kid": "<string>",
  "public_key": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

type
enum<string>
required

Type of the encryption key to be created.

Available options:
customer-provided-root-key,
tenant-encryption-key

Response

The key was successfully created.

Encryption key

kid
string
required

Key ID

type
enum<string>
required

Key type

Available options:
customer-provided-root-key,
environment-root-key,
tenant-master-key,
tenant-encryption-key
state
enum<string>
required

Key state

Available options:
pre-activation,
active,
deactivated,
destroyed
created_at
string<date-time>
required

Key creation timestamp

updated_at
string<date-time>
required

Key update timestamp

parent_kid
string | null

ID of parent wrapping key

public_key
string | null

Public key in PEM format