Webhook Yönetimi (Webhook Management)
Gerçek zamanlı olay bildirimleri almak için webhook uç noktalarınızı yönetin. Kuruluş başına en fazla 10 webhook uç noktası kaydedebilirsiniz.
Webhook Oluştur
POST /webhooks
İstek Gövdesi (Request Body)
{
"url": "https://yourapp.com/webhooks/vignetim",
"events": ["order.completed", "order.failed"],
"description": "Production order notifications"
}
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
url | string | Evet | Webhook teslimatlarını alacak HTTPS uç nokta URL'si |
events | string[] | Evet | Abone olunacak olay türleri dizisi (veya tümü için ["*"]) |
description | string | Hayır | Bu uç nokta için insan tarafından okunabilir bir açıklama |
Yanıt (201 Oluşturuldu)
{
"id": "wh-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"url": "https://yourapp.com/webhooks/vignetim",
"events": ["order.completed", "order.failed"],
"description": "Production order notifications",
"active": true,
"signingSecret": "whs_a1b2c3d4e5f6789012345678901234567890abcdef",
"createdAt": "2026-03-20T14:30:00.000Z"
}
Önemli:
signingSecretyalnızca webhook ilk oluşturulduğunda döndürülür. Gelen webhook imzalarını doğrulamak için ihtiyaç duyacağınız bu anahtarı güvenli bir şekilde saklayın. Tekrar alınamaz.
SSRF Koruması
Webhook URL'leri herkese açık HTTPS uç noktaları olmalıdır. Aşağıdakiler reddedilir:
- Özel/dahili IP adresleri (10.x.x.x, 172.16-31.x.x, 192.168.x.x)
- Localhost ve geri döngü (loopback) adresleri
- HTTPS olmayan URL'ler
Webhook'ları Listele
GET /webhooks
Yanıt
{
"data": [
{
"id": "wh-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"url": "https://yourapp.com/webhooks/vignetim",
"events": ["order.completed", "order.failed"],
"description": "Production order notifications",
"active": true,
"consecutiveFailures": 0,
"createdAt": "2026-03-20T14:30:00.000Z",
"updatedAt": "2026-03-20T14:30:00.000Z"
}
]
}
Webhook Güncelle
PUT /webhooks/:id
Yol Parametreleri (Path Parameters)
| Ad | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | string | Evet | Webhook ID'si |
İstek Gövdesi (Request Body)
{
"url": "https://yourapp.com/webhooks/vignetim-v2",
"events": ["*"],
"description": "Updated to receive all events"
}
Tüm alanlar isteğe bağlıdır. Yalnızca sağlanan alanlar güncellenir.
Yanıt
Güncellenmiş webhook nesnesini döndürür.
Webhook Sil
DELETE /webhooks/:id
Yol Parametreleri (Path Parameters)
| Ad | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | string | Evet | Webhook ID'si |
Yanıt
Başarılı olduğunda 204 No Content döndürür.
Webhook Test Et
Uç noktanızın erişilebilir olduğunu ve webhook teslimatlarını doğru şekilde işlediğini doğrulamak için bir test olayı gönderin.
POST /webhooks/:id/test
Yol Parametreleri (Path Parameters)
| Ad | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | string | Evet | Webhook ID'si |
Yanıt
{
"success": true,
"statusCode": 200,
"responseTime": 145,
"message": "Test webhook delivered successfully"
}
Test teslimatı başarısız olursa:
{
"success": false,
"statusCode": 500,
"responseTime": 10000,
"message": "Webhook endpoint returned non-2xx status code"
}