Auth & API Keys
CRM entegrasyonu API key kullanır. Panel (UI) JWT kullanır.
CRM: API key
Authorization: Bearer b2b_<your_api_key>
- Anahtarlar panelde API Keys sayfasından oluşturulur.
- Plaintext key yalnızca oluşturma anında bir kez gösterilir.
- Prefix
b2b_ile başlar; sunucu hash saklar.
Scope’lar
| Scope | Kullanım |
|---|---|
events:write | Event gönderme |
events:read | Event okuma / katalog |
partners:read | Partner listesi |
partners:write | Partner oluşturma/güncelleme |
executions:read | Çalıştırma okuma |
webhooks:manage | Webhook abonelik / delivery |
Liste: GET /api/v1/api-keys/scopes/
Rate limit
API key istekleri: 120/dakika (throttle api_key).
Panel: JWT
Authorization: Bearer <access_jwt>
POST /api/v1/auth/login/→access+refresh- API key yönetimi (oluşturma/revoke) yalnızca JWT ile; API key kendini yönetemez (403).
Endpoints
| Method | Path | Auth | Açıklama |
|---|---|---|---|
GET | /api/v1/api-keys/ | JWT | Liste |
POST | /api/v1/api-keys/ | JWT | Oluştur (name, scopes) |
POST | /api/v1/api-keys/{id}/revoke/ | JWT | İptal |
GET | /api/v1/api-keys/scopes/ | JWT/API | Scope listesi |
Örnek oluşturma (panel token)
curl -X POST https://app.b2bworker.com/api/v1/api-keys/ \
-H "Authorization: Bearer $JWT" \
-H "Content-Type: application/json" \
-d '{"name":"crm-prod","scopes":["events:write","events:read","executions:read","webhooks:manage"]}'
UI
Panel: /api-keys