Start domain hash key rotation
POST
/api/admin/settings/domain-hash-keys/rotate
Code sample: Shell / cURL
curl --request POST \ --url https://auth.example.com/api/admin/settings/domain-hash-keys/rotate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "new_secret": "minimum-32-byte-domain-hash-secret-value" }'Adds a new domain hash secret version to SETTINGS KV. new_secret must meet the minimum secret length.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
new_secret
required
string
key
additional properties
Example
{ "new_secret": "minimum-32-byte-domain-hash-secret-value"}Responses
Section titled “ Responses ”Domain hash key rotation started.
Media type application/json
object
new_version
integer
migration_in_progress
boolean
message
string
key
additional properties
Example
{ "new_version": 2, "migration_in_progress": true, "message": "Key rotation started. New version: 2. Users will be migrated on next login."}Error response.
Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{ "error": "example", "message": "example", "error_description": "example"}Error response.
Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{ "error": "example", "message": "example", "error_description": "example"}Error response.
Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{ "error": "example", "message": "example", "error_description": "example"}Error response.
Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{ "error": "example", "message": "example", "error_description": "example"}