Sectorfeed

Webhooks

HTTP push към твоя endpoint при нови записи — за AI агенти, n8n, Make и собствени скриптове.

Как работи

  1. Имаш Pro/Custom API key.
  2. Регистрираш https:// URL + сектор (+ опционални филтри).
  3. Cron пуска send-webhooks.php и Sectorfeed POSTва JSON с новите items.
  4. Проверяваш подписа X-Sectorfeed-Signature (HMAC-SHA256).

Създаване

curl -X POST "https://sectorfeed.eu/api/webhooks" \
  -H "X-API-Key: sf_…" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/hooks/sectorfeed","feed":"tenders","filters":{"niche":"it"}}'

Сектори: tenders, projects, firms, jobs, cadastre, kevr, cpc, night-market. Отговорът връща secret само веднъж.

Payload

{
  "event": "feed.items",
  "webhook_id": "wh_…",
  "delivery_id": "dl_…",
  "feed": "tenders",
  "filters": { "niche": "it" },
  "delivered_at": "2026-09-26T12:00:00+00:00",
  "count": 1,
  "items": [
    {
      "id": "…",
      "title": "…",
      "meta": "…",
      "path": "/tender/…",
      "url": "https://sectorfeed.eu/tender/…"
    }
  ]
}

Подпис

X-Sectorfeed-Event: feed.items
X-Sectorfeed-Delivery: dl_…
X-Sectorfeed-Signature: sha256=<hmac_hex>

Проверка: hash_hmac('sha256', $rawBody, $secret) === substr($header, 7) (след префикса sha256=).

Управление

GET    /api/webhooks
POST   /api/webhooks/{id}/ping
DELETE /api/webhooks/{id}

След 10 неуспешни доставки webhook-ът се деактивира автоматично.

CLI

php bin/make-webhook.php sf_… https://example.com/hook tenders --niche=it
php bin/send-webhooks.php

Нужен API key? Профил (създай ключ) · Docs: /docs · support@sectorfeed.eu