Localizzato tramite IA

Aggiorna Webhook

Aggiorna un webhook esistente nel tuo workspace. Richiede permessi completi. Tutti i campi sono opzionali, ma almeno uno deve essere fornito. I webhook possono essere identificati tramite ID (wh_xxx) o nome.

POST/webhooks/{id}
Copy

Parametri del Percorso

idstring Required
Link

L'ID del webhook (wh_xxx) o il nome.

Corpo della Richiesta

namestring
Link

Nuovo nome per il webhook.

urlstring
Link

Nuovo URL (validato contro SSRF).

all_eventsboolean
Link

Sottoscrivi tutti gli eventi. Impostando su true vengono cancellati eventuali eventi specifici.

enabledboolean
Link

Abilita o disabilita il webhook.

eventsstring[]
Link

Sostituisce i tipi di evento sottoscritti. Ignorato quando all_events è true.

Aggiorna webhook

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: 'Webhook Aggiornato',
    enabled: false,
    events: ['email.accepted', 'email.bounced']
  })
});

const result = await response.json();

Risposte

{
  "object": "webhook",
  "id": "wh_2BxFg7KNqr5M...",
  "name": "Webhook Aggiornato",
  "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"
}