SDK reference · Python SDK

prov.account.rotate_key

prov.account.rotate_key in Python SDK.

Signature

prov.account.rotate_key(key_id: Optional[str] = …) -> Any

Parameters

key_idOptional[str]

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
idstringpathRequired
The key's ID (key_…), or current for the API key making the call.

Returns

Any The new API key. It's shown only once.

HTTP operation

POST /v1/account/keys/{id}/rotate_secret: Rotate an API key

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/account/keys/current/rotate_secret`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.