identities.rotate_key
Generate a new API key for an identity
Key type: Platform (lopk-)
Generate a new API key for an identity. The old key is immediately invalidated. The new raw key is returned once — store it securely.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
identityId | string | Yes | Identity ID to rotate key for |
Example
Orchestrator: "Rotate the sales agent's API key"
-> identities.rotate_key({ identityId: "id-abc123" })Returns
{
"identityId": "id-abc123",
"rawKey": "loid-c4e6f8a0...",
"apiKeyPrefix": "loid-c4e6f8a0",
"message": "Key rotated. The old key is now invalid."
}REST Equivalent
POST /v0/platform/identities/:identityId/rotate-key