Skip to main content

API Key Geri Yükle

İptal edilmiş API anahtarını geri yükler.

Endpoint

POST /api/v1/api-keys/\{uuid\}/restore

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Permission

  • api.keys.restore - Tüm API anahtarlarını geri yükleme
  • api.keys.restore.own - Sadece kendi API anahtarlarını geri yükleme

Request

Headers

HeaderDeğerZorunlu
AuthorizationBearer \{token\}Evet

Path Parameters

ParametreTipZorunluAçıklama
uuidstringEvetAPI key UUID'si

Response

Success Response (200 OK)

{
"id": 1,
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production API Key",
"key_prefix": "cc_live_",
"is_active": true,
"deleted_at": null,
"user": {
"id": 1,
"email": "user@example.com"
}
}

Error Responses

404 Not Found

{
"message": "API key not found"
}

400 Bad Request

{
"message": "API key is not deleted"
}

403 Forbidden

{
"message": "Forbidden"
}

Code Examples

cURL

curl -X POST https://api.example.com/api/v1/api-keys/550e8400-e29b-41d4-a716-446655440000/restore \
-H "Authorization: Bearer \{token\}"

Notes

  • Sadece iptal edilmiş (soft delete) anahtarlar geri yüklenebilir
  • Geri yüklenen anahtar is_active durumu korunur
  • Anahtar zaten iptal edilmemişse 400 hatası döner
  • Geri yüklenen anahtar tekrar API isteklerinde kullanılabilir