Skip to content
PaloNexus
Request access Request

Rotate Key

POST
/v1/keys/{key_id}/rotate
curl --request POST \
--url https://example.com/v1/keys/example/rotate \
--header 'Content-Type: application/json' \
--data '{ "by": "example" }'

Issue a new secret for an existing key; the prior secret stops working immediately. Plaintext returned ONCE.

key_id
required
Key Id
string
Media type application/json
RotateKeyRequest
object
by
Any of:
string
Example generated
{
"by": "example"
}

Successful Response

Media type application/json
CreateKeyResponse

Create/rotate response. plaintext is shown EXACTLY ONCE — it is not stored (only its salted hash is) and can never be retrieved again.

object
key
required
ApiKeyRecord

The browser-/SDK-safe view of a key. The plaintext and its hash are NEVER in here — only a masked display string + the last four chars.

object
id
required
Id
string
name
required
Name
string
env
required
Env
string
prefix
required
Prefix
string
masked
required
Masked
string
last4
required
Last4
string
scopes
Scopes
Array<string>
status
required
Status
string
tenantId
Any of:
string
createdBy
Any of:
string
createdAt
required
Createdat
string
lastUsedAt
Any of:
string
revokedAt
Any of:
string
revokedBy
Any of:
string
rotatedAt
Any of:
string
rotatedFrom
Any of:
string
plaintext
required
Plaintext
string
Example generated
{
"key": {
"id": "example",
"name": "example",
"env": "example",
"prefix": "example",
"masked": "example",
"last4": "example",
"scopes": [
"example"
],
"status": "example",
"tenantId": "example",
"createdBy": "example",
"createdAt": "example",
"lastUsedAt": "example",
"revokedAt": "example",
"revokedBy": "example",
"rotatedAt": "example",
"rotatedFrom": "example"
},
"plaintext": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}