Skip to main content
POST
/
partner
/
v1
/
api-keys
/
{id}
/
rotate
curl -X POST "https://prod.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"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.unleeshed.ai/llms.txt

Use this file to discover all available pages before exploring further.

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://prod.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"
  }
}