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

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

        await client.Connections.Keys.RotateAsync(
            id: "id",
            request: new RotateConnectionKeysRequestContent()
        );
    }

}
package example

import (
    context "context"

    management "github.com/auth0/go-auth0/management/management"
    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &management.RotateConnectionKeysRequestContent{}
    client.Connections.Keys.Rotate(
        context.TODO(),
        "id",
        request,
    )
}
package com.example.usage;

import com.auth0.client.mgmt.ManagementApi;
import java.util.Optional;

public class Example {
    public static void main(String[] args) {
        ManagementApi client = ManagementApi
            .builder()
            .token("<token>")
            .build();

        client.connections().keys().rotate(
            "id",
            Optional.empty()
        );
    }
}
<?php

namespace Example;

use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Types\RotateConnectionKeysRequestContent;

$client = new Management(
    token: '<token>',
);
$client->connections->keys->rotate(
    'id',
    new RotateConnectionKeysRequestContent([]),
);
from auth0.management import ManagementClient, RotateConnectionKeysRequestContent

client = ManagementClient(
    token="<token>",
)

client.connections.keys.rotate(
    id="id",
    request=RotateConnectionKeysRequestContent(),
)
require "auth0"

client = Auth0::Management.new(token: "<token>")

client.connections.keys.rotate(
  id: "id",
  request: {}
)
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.connections.keys.rotate("id", {});
}
main();
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.connections.keys.rotate("id", {});
}
main();
curl --request POST \
  --url https://{tenantDomain}/api/v2/connections/{id}/keys/rotate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "kid": "<string>",
  "cert": "-----BEGIN CERTIFICATE-----\r\nMIIDDTCCA...YiA0TQhAt8=\r\n-----END CERTIFICATE-----",
  "fingerprint": "CC:FB:DD:D8:9A:B5:DE:1B:F0:CC:36:D2:99:59:21:12:03:DD:A8:25",
  "thumbprint": "CCFBDDD89AB5DE1BF0CC36D29959211203DDA825",
  "pkcs": "-----BEGIN PKCS7-----\r\nMIIDPA....t8xAA==\r\n-----END PKCS7-----",
  "next": true,
  "algorithm": "<string>",
  "subject_dn": "<string>"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

ID of the connection

Body

signing_alg
enum<string>

Selected Signing Algorithm

Available options:
RS256,
RS384,
RS512,
PS256,
PS384,
ES256,
ES384

Response

Connection keys successfully rotated.

kid
string
required

The key id of the signing key

Maximum string length: 255
cert
string
default:-----BEGIN CERTIFICATE----- MIIDDTCCA...YiA0TQhAt8= -----END CERTIFICATE-----
required

The public certificate of the signing key

Maximum string length: 4096
fingerprint
string
default:CC:FB:DD:D8:9A:B5:DE:1B:F0:CC:36:D2:99:59:21:12:03:DD:A8:25
required

The cert fingerprint

thumbprint
string
default:CCFBDDD89AB5DE1BF0CC36D29959211203DDA825
required

The cert thumbprint

Maximum string length: 255
pkcs
string
default:-----BEGIN PKCS7----- MIIDPA....t8xAA== -----END PKCS7-----

The public certificate of the signing key in pkcs7 format

Maximum string length: 4096
next
boolean

True if the key is the the next key

algorithm
string

Signing key algorithm

key_use
enum<string>

Signing key use, whether for encryption or signing

Available options:
encryption,
signing
subject_dn
string
Maximum string length: 132