Entegrasyon Oluştur
Yeni entegrasyon oluşturur.
Endpoint
POST /api/v1/integrations
Authentication
Bu endpoint authentication gerektirir.
Header: Authorization: Bearer \{token\}
Permission
integrations.create- Tüm entegrasyonları oluşturmaintegrations.create.own- Sadece kendi entegrasyonunu oluşturma
Request
Headers
| Header | Değer | Zorunlu |
|---|---|---|
Authorization | Bearer \{token\} | Evet |
Content-Type | application/json | Evet |
Request Body
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
name | string | Evet | Entegrasyon adı |
type | string | Evet | Entegrasyon tipi (webhook, oauth, api) |
provider | string | Hayır | Sağlayıcı adı |
description | string | Hayır | Entegrasyon açıklaması |
config | object | Hayır | Yapılandırma ayarları (JSON) |
credentials | object | Hayır | Kimlik bilgileri (JSON, şifrelenmiş saklanır) |
status | string | Hayır | Durum (active, inactive, error, pending, varsayılan: "pending") |
metadata | object | Hayır | Ek metadata bilgileri (JSON) |
is_active | boolean | Hayır | Aktif durumu (varsayılan: true) |
Example Request
{
"name": "Stripe Webhook",
"type": "webhook",
"provider": "stripe",
"description": "Stripe ödeme webhook entegrasyonu",
"config": {
"webhook_url": "https://api.example.com/webhooks/stripe",
"events": ["payment.succeeded", "payment.failed"]
},
"credentials": {
"api_key": "sk_live_..."
},
"status": "pending"
}
Response
Success Response (201 Created)
{
"id": 1,
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"name": "Stripe Webhook",
"type": "webhook",
"provider": "stripe",
"description": "Stripe ödeme webhook entegrasyonu",
"config": {
"webhook_url": "https://api.example.com/webhooks/stripe",
"events": ["payment.succeeded", "payment.failed"]
},
"status": "pending",
"is_active": true,
"user_id": 1,
"user": {
"id": 1,
"email": "user@example.com"
},
"created_at": "2025-11-20T12:00:00.000000Z",
"updated_at": "2025-11-20T12:00:00.000000Z"
}
Error Responses
403 Forbidden
{
"message": "Forbidden"
}
422 Unprocessable Entity
{
"message": "Validation failed",
"errors": {
"name": ["The name field is required."],
"type": ["The type field is required."]
}
}
Code Examples
cURL
curl -X POST https://api.example.com/api/v1/integrations \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"name": "Stripe Webhook",
"type": "webhook",
"provider": "stripe",
"description": "Stripe ödeme webhook entegrasyonu",
"status": "pending"
}'
Notes
.ownpermission'ı olan kullanıcılar içinuser_idotomatik olarak atanıris_activedeğeri belirtilmemişse varsayılan olaraktruekullanılırstatusdeğeri belirtilmemişse varsayılan olarak "pending" kullanılırcredentialsalanı şifrelenerek saklanır, güvenlik için hassas bilgiler içermemelidir
Related Endpoints
- Entegrasyon Listesi - Tüm entegrasyonları listele
- Entegrasyon Detayı - Entegrasyon detayını getir