Skip to main content
POST
https://api.unleeshed.ai
/
partner
/
v1
/
api-keys
/
{id}
/
rotate
curl -X POST "https://api.unleeshed.ai/partner/v1/api-keys/key-abc-123/rotate" \
  -H "Authorization: Bearer YOUR_SUPABASE_JWT"
{
  "success": true,
  "data": {
    "id": "key-abc-123",
    "name": "Production Server",
    "full_key": "pk_live_new456xxxxxxxxxxxxxxxxxxxxxxxx",
    "key_prefix": "pk_live_new45",
    "rotated_at": "2026-01-30T16:00:00Z"
  }
}
This endpoint requires Bearer authentication with your Supabase JWT.
Rotating a key generates a new secret while keeping the same key ID and configuration. The old key is immediately invalidated.

Path Parameters

id
string
required
Key ID to rotate

Response

The new API key is only returned once. Store it securely!
curl -X POST "https://api.unleeshed.ai/partner/v1/api-keys/key-abc-123/rotate" \
  -H "Authorization: Bearer YOUR_SUPABASE_JWT"
{
  "success": true,
  "data": {
    "id": "key-abc-123",
    "name": "Production Server",
    "full_key": "pk_live_new456xxxxxxxxxxxxxxxxxxxxxxxx",
    "key_prefix": "pk_live_new45",
    "rotated_at": "2026-01-30T16:00:00Z"
  }
}