curl -X POST "https://prod.api.unleeshed.ai/partner/v1/api-keys/key-abc-123/rotate" \
-H "Authorization: Bearer YOUR_SUPABASE_JWT"
const response = await fetch(
'https://prod.api.unleeshed.ai/partner/v1/api-keys/key-abc-123/rotate',
{
method: 'POST',
headers: { 'Authorization': `Bearer ${supabaseJwt}` }
}
);
{
"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"
}
}
API Keys
Rotate API Key
Rotate an API key to get a new secret
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"
const response = await fetch(
'https://prod.api.unleeshed.ai/partner/v1/api-keys/key-abc-123/rotate',
{
method: 'POST',
headers: { 'Authorization': `Bearer ${supabaseJwt}` }
}
);
{
"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.
Path Parameters
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"
const response = await fetch(
'https://prod.api.unleeshed.ai/partner/v1/api-keys/key-abc-123/rotate',
{
method: 'POST',
headers: { 'Authorization': `Bearer ${supabaseJwt}` }
}
);
{
"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"
}
}