# Update a webhook

`PATCH https://ulawk.com/api/v1/webhooklar/{webhook_id}/`

`aktif` and/or `kategoriler`. Re-enabling resets the failure counter.

## Authentication

Two headers on every request: `X-API-Key` and `X-API-Secret`.

## Path parameters

- `webhook_id` (integer, required) — Webhook id.

## Request body

- `aktif` (boolean)
- `kategoriler[]` (string[])

```json
{
  "aktif": true,
  "kategoriler": [
    "durum",
    "kapandi"
  ]
}
```

## Response

### 200 — Updated webhook.

- `id` (integer, zorunlu)
- `url` (string (uri), zorunlu)
- `aktif` (boolean, zorunlu)
- `kategoriler[]` (string[], zorunlu) — Empty = all categories.
- `tum_kategoriler` (boolean, zorunlu)
- `olusturma` (string (date-time), null, zorunlu)
- `son_gonderim` (string (date-time), null, zorunlu)
- `son_durum` (string, null, zorunlu)
- `ardisik_hata` (integer, zorunlu) — Consecutive failures; paused at 20.
- `son_teslimler[]` (Teslim[]) — Only in webhook detail (last 20).
- `son_teslimler[].teslim_id` (string, zorunlu) — Same across retries (de-duplication).
- `son_teslimler[].olay` (string, zorunlu) Değerler: sirket.degisiklik, test.
- `son_teslimler[].test` (boolean, zorunlu)
- `son_teslimler[].kategoriler[]` (string[], zorunlu)
- `son_teslimler[].durum` (string, zorunlu) Değerler: bekliyor, basarili, hata, vazgecildi.
- `son_teslimler[].deneme_sayisi` (integer, zorunlu)
- `son_teslimler[].http_kodu` (integer, null, zorunlu)
- `son_teslimler[].hata` (string, null, zorunlu)
- `son_teslimler[].olusturma` (string (date-time), null, zorunlu)
- `son_teslimler[].son_deneme` (string (date-time), null, zorunlu)

```json
{
  "id": 1,
  "url": "https://sisteminiz.ornek.com/ulawk",
  "aktif": true,
  "kategoriler": [
    "durum",
    "yetkililer"
  ],
  "tum_kategoriler": false,
  "olusturma": "2026-10-16T00:00:00+00:00",
  "son_gonderim": "2026-10-16T00:00:00+00:00",
  "son_durum": "başarılı (HTTP 200)",
  "ardisik_hata": 0
}
```

### 400 — `gecersiz_json` or `gecersiz_webhook`.


```json
{
  "hata": "gecersiz_webhook",
  "detay": "Adres https:// ile başlamalı.",
  "hata_ayrinti": {
    "kod": "gecersiz_webhook",
    "mesaj": "Adres https:// ile başlamalı.",
    "taraf": "istemci",
    "kaynak": null,
    "tekrar_denenebilir": false,
    "tekrar_sn": null
  }
}
```

### 403 — `anahtar_gerekli`.


```json
{
  "hata": "anahtar_gerekli",
  "detay": "Bu işlem için X-API-Key (ve X-API-Secret) başlığı gerekli; panelden de yapabilirsiniz.",
  "hata_ayrinti": {
    "kod": "anahtar_gerekli",
    "mesaj": "Bu işlem için X-API-Key (ve X-API-Secret) başlığı gerekli; panelden de yapabilirsiniz.",
    "taraf": "istemci",
    "kaynak": null,
    "tekrar_denenebilir": false,
    "tekrar_sn": null
  }
}
```

### 404 — Not found or no access (`bulunamadi`).


```json
{
  "hata": "bulunamadi",
  "detay": "Şirket bulunamadı ya da erişim yetkiniz yok.",
  "hata_ayrinti": {
    "kod": "bulunamadi",
    "mesaj": "Şirket bulunamadı ya da erişim yetkiniz yok.",
    "taraf": "istemci",
    "kaynak": null,
    "tekrar_denenebilir": false,
    "tekrar_sn": null
  }
}
```

### 401 — Missing or invalid key (`yetkisiz`).


```json
{
  "hata": "yetkisiz",
  "detay": "Geçerli X-API-Key başlığı gerekli (panel › API).",
  "hata_ayrinti": {
    "kod": "yetkisiz",
    "mesaj": "Geçerli X-API-Key başlığı gerekli (panel › API).",
    "taraf": "istemci",
    "kaynak": null,
    "tekrar_denenebilir": false,
    "tekrar_sn": null
  }
}
```

### 429 — Hourly rate limit exceeded (`hiz_siniri`); the Retry-After header gives the seconds until reset.

Retry-After: `2494`

```json
{
  "hata": "hiz_siniri",
  "detay": "Saatlik istek sınırı aşıldı (600). Bir sonraki saatte tekrar deneyin.",
  "hata_ayrinti": {
    "kod": "hiz_siniri",
    "mesaj": "Saatlik istek sınırı aşıldı (600). Bir sonraki saatte tekrar deneyin.",
    "taraf": "istemci",
    "kaynak": null,
    "tekrar_denenebilir": true,
    "tekrar_sn": 2494
  }
}
```

### 500 — Unexpected error (`ic_hata`, taraf ulawk); retry shortly.

Retry-After: `60`

```json
{
  "hata": "ic_hata",
  "detay": "Beklenmeyen bir hata oluştu; kısa süre sonra yeniden deneyin.",
  "hata_ayrinti": {
    "kod": "ic_hata",
    "mesaj": "Beklenmeyen bir hata oluştu; kısa süre sonra yeniden deneyin.",
    "taraf": "ulawk",
    "kaynak": null,
    "tekrar_denenebilir": true,
    "tekrar_sn": 60
  }
}
```

## Request

```bash
curl -X PATCH "https://ulawk.com/api/v1/webhooklar/1/" \
  -H "X-API-Key: ulk_DENEME_ANAHTARINIZ" \
  -H "X-API-Secret: ulsk_DENEME_GIZLI_ANAHTARINIZ" \
  -H "Content-Type: application/json" \
  -d '{"aktif": true, "kategoriler": ["durum", "kapandi"]}'
```
