Using
Generates a new API key for the user and immediately invalidates the old one. The new key is returned **only in this response**. Use this after key leaks or for regular key rotation.
applies to v0.5.1POST
/store-api/auth/users/{name}/rotate-key
const url = 'https://example.com/store-api/auth/users/example/rotate-key';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/store-api/auth/users/example/rotate-key \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”name
required
string
Username
Responses
Section titled “Responses”New API key generated (visible once)
Media typeapplication/json
object
api_key
required
New API key (visible only once — cannot be retrieved afterward).
string
name
required
string
Example generated
{ "api_key": "example", "name": "example"}User not found
Media typetext/plain
string