Aktualizace webhooku

const response = await fetch('https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'Aktualizovaný Webhook',
    enabled: false,
    events: ['email.accepted', 'email.bounced']
  })
});

const result = await response.json();

Odpovědi

{
  "object": "webhook",
  "id": "wh_2BxFg7KNqr5M...",
  "name": "Aktualizovaný Webhook",
  "url": "https://example.com/webhook",
  "all_events": false,
  "enabled": false,
  "events": ["email.accepted", "email.bounced"],
  "last_used_at": "2026-02-11T14:30:00.000000+00:00",
  "created_at": "2026-02-10T10:00:00.000000+00:00",
  "updated_at": "2026-02-12T09:00:00.000000+00:00"
}