Elenco Webhook
Recupera l’elenco di tutti i webhook presenti nel tuo workspace. Richiede autorizzazioni complete.
/webhooksParametri di Query
pageintegerNumero di pagina per la paginazione (minimo: 1, predefinito: 1).
limitintegerNumero di webhook da restituire (minimo: 1, massimo: 100, predefinito: 10).
const response = await fetch('https://api.emailit.com/v2/webhooks?page=1&limit=10', {
method: 'GET',
headers: {
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
}
});
const result = await response.json(); <?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.emailit.com/v2/webhooks?page=1&limit=10',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "Errore cURL #:" . $err;
} else {
$result = json_decode($response, true);
print_r($result);
} import requests
response = requests.get(
'https://api.emailit.com/v2/webhooks',
params={
'page': 1,
'limit': 10
},
headers={
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
}
)
result = response.json()
print(result) require 'net/http'
require 'json'
uri = URI('https://api.emailit.com/v2/webhooks?page=1&limit=10')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer em_test_51RxCWJ...vS00p61e0qRE'
request['Content-Type'] = 'application/json'
response = http.request(request)
result = JSON.parse(response.body)
puts result package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
baseURL := "https://api.emailit.com/v2/webhooks"
params := url.Values{}
params.Add("page", "1")
params.Add("limit", "10")
fullURL := baseURL + "?" + params.Encode()
req, _ := http.NewRequest("GET", fullURL, nil)
req.Header.Set("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
} use reqwest;
use serde_json::Value;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let response = client
.get("https://api.emailit.com/v2/webhooks")
.query(&[("page", "1"), ("limit", "10")])
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.send()
.await?;
let result: Value = response.json().await?;
println!("{:?}", result);
Ok(())
} import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class ListWebhooks {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.emailit.com/v2/webhooks?page=1&limit=10"))
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
} using System;
using System.Net.Http;
using System.Threading.Tasks;
public class ListWebhooks
{
public static async Task Main()
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization",
"Bearer em_test_51RxCWJ...vS00p61e0qRE");
var response = await client.GetAsync(
"https://api.emailit.com/v2/webhooks?page=1&limit=10");
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
} curl -X GET "https://api.emailit.com/v2/webhooks?page=1&limit=10" \
-H "Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE" \
-H "Content-Type: application/json" {
"data": [
{
"object": "webhook",
"id": "wh_2BxFg7KNqr5M...",
"name": "Il Mio Webhook",
"url": "https://example.com/webhook",
"all_events": false,
"enabled": true,
"events": ["email.accepted", "email.delivered"],
"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-10T10:00:00.000000+00:00"
}
],
"next_page_url": "/v2/webhooks?page=2&limit=10",
"previous_page_url": null
} {
"error": {
"code": 401,
"message": "Non autorizzato"
}
} Ottieni Webhook
Recupera le informazioni di un webhook specifico. Richiede permessi completi.
/webhooks/{id}Parametri del Percorso
idstringRequiredL’ID del webhook (wh_xxx).
const response = await fetch('https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M', {
method: 'GET',
headers: {
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
}
});
const result = await response.json(); <?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "Errore cURL #:" . $err;
} else {
$result = json_decode($response, true);
print_r($result);
} import requests
response = requests.get(
'https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M',
headers={
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
}
)
result = response.json()
print(result) require 'net/http'
require 'json'
uri = URI('https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer em_test_51RxCWJ...vS00p61e0qRE'
request['Content-Type'] = 'application/json'
response = http.request(request)
result = JSON.parse(response.body)
puts result package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
} use reqwest;
use serde_json::Value;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let response = client
.get("https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M")
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.send()
.await?;
let result: Value = response.json().await?;
println!("{:?}", result);
Ok(())
} import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class GetWebhook {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M"))
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
} using System;
using System.Net.Http;
using System.Threading.Tasks;
public class GetWebhook
{
public static async Task Main()
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization",
"Bearer em_test_51RxCWJ...vS00p61e0qRE");
var response = await client.GetAsync(
"https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M");
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
} curl -X GET https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M \
-H "Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE" \
-H "Content-Type: application/json" {
"object": "webhook",
"id": "wh_2BxFg7KNqr5M...",
"name": "Il Mio Webhook",
"url": "https://example.com/webhook",
"all_events": false,
"enabled": true,
"events": ["email.accepted", "email.delivered"],
"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-10T10:00:00.000000+00:00"
} {
"error": "Webhook non trovato"
} Crea Webhook
Crea un nuovo webhook nel tuo workspace. Richiede permessi completi. La validazione dell’URL include protezione SSRF — IP privati, localhost ed endpoint di metadati sono bloccati.
/webhooksCorpo della Richiesta
namestringRequiredNome univoco all’interno del workspace.
urlstringRequiredURL endpoint HTTPS (validato contro SSRF).
all_eventsbooleanSottoscrivi tutti i tipi di evento (predefinito: false).
enabledbooleanSe il webhook è attivo (predefinito: true).
eventsstring[]Array di nomi dei tipi di evento a cui sottoscriversi (predefinito: []). Ignorato se all_events è true.
const response = await fetch('https://api.emailit.com/v2/webhooks', {
method: 'POST',
headers: {
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Webhook Produzione',
url: 'https://example.com/webhook',
all_events: false,
enabled: true,
events: ['email.accepted', 'email.delivered', 'email.bounced']
})
});
const result = await response.json(); <?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.emailit.com/v2/webhooks',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Webhook Produzione',
'url' => 'https://example.com/webhook',
'all_events' => false,
'enabled' => true,
'events' => ['email.accepted', 'email.delivered', 'email.bounced']
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "Errore cURL #:" . $err;
} else {
$result = json_decode($response, true);
print_r($result);
} import requests
response = requests.post(
'https://api.emailit.com/v2/webhooks',
headers={
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
},
json={
'name': 'Webhook Produzione',
'url': 'https://example.com/webhook',
'all_events': False,
'enabled': True,
'events': ['email.accepted', 'email.delivered', 'email.bounced']
}
)
result = response.json()
print(result) require 'net/http'
require 'json'
uri = URI('https://api.emailit.com/v2/webhooks')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer em_test_51RxCWJ...vS00p61e0qRE'
request['Content-Type'] = 'application/json'
request.body = {
name: 'Webhook Produzione',
url: 'https://example.com/webhook',
all_events: false,
enabled: true,
events: ['email.accepted', 'email.delivered', 'email.bounced']
}.to_json
response = http.request(request)
result = JSON.parse(response.body)
puts result package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.emailit.com/v2/webhooks"
data := map[string]interface{}{
"name": "Webhook Produzione",
"url": "https://example.com/webhook",
"all_events": false,
"enabled": true,
"events": []string{"email.accepted", "email.delivered", "email.bounced"},
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
} use reqwest;
use serde_json::{json, Value};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let response = client
.post("https://api.emailit.com/v2/webhooks")
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.json(&json!({
"name": "Webhook Produzione",
"url": "https://example.com/webhook",
"all_events": false,
"enabled": true,
"events": ["email.accepted", "email.delivered", "email.bounced"]
}))
.send()
.await?;
let result: Value = response.json().await?;
println!("{:?}", result);
Ok(())
} import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.http.HttpRequest.BodyPublishers;
public class CreateWebhook {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String jsonBody = "{\"name\":\"Webhook Produzione\",\"url\":\"https://example.com/webhook\",\"all_events\":false,\"enabled\":true,\"events\":[\"email.accepted\",\"email.delivered\",\"email.bounced\"]}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.emailit.com/v2/webhooks"))
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.POST(BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
} using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class CreateWebhook
{
public static async Task Main()
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization",
"Bearer em_test_51RxCWJ...vS00p61e0qRE");
var data = new {
name = "Webhook Produzione",
url = "https://example.com/webhook",
all_events = false,
enabled = true,
events = new[] { "email.accepted", "email.delivered", "email.bounced" }
};
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.emailit.com/v2/webhooks", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
} curl -X POST https://api.emailit.com/v2/webhooks \
-H "Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE" \
-H "Content-Type: application/json" \
-d '{
"name": "Webhook Produzione",
"url": "https://example.com/webhook",
"all_events": false,
"enabled": true,
"events": ["email.accepted", "email.delivered", "email.bounced"]
}' {
"object": "webhook",
"id": "wh_2BxFg7KNqr5M...",
"name": "Webhook Produzione",
"url": "https://example.com/webhook",
"all_events": false,
"enabled": true,
"events": ["email.accepted", "email.delivered", "email.bounced"],
"last_used_at": null,
"created_at": "2026-02-10T10:00:00.000000+00:00",
"updated_at": "2026-02-10T10:00:00.000000+00:00"
} {
"error": "Campo obbligatorio mancante: name"
} {
"error": "Esiste già un webhook con questo nome",
"existing": {
"object": "webhook",
"id": "wh_...",
"name": "..."
}
} Tipi di Evento Disponibili
Questi sono tutti i tipi di evento che possono essere utilizzati nell’array events:
Eventi email: email.accepted, email.scheduled, email.delivered, email.bounced, email.attempted, email.failed, email.rejected, email.clicked, email.loaded, email.complained, email.received, email.suppressed
Eventi dominio: domain.created, domain.updated, domain.deleted
Eventi pubblico: audience.created, audience.updated, audience.deleted
Eventi iscritto: subscriber.created, subscriber.updated, subscriber.deleted
Eventi contatto: contact.created, contact.updated, contact.deleted
Eventi template: template.created, template.updated, template.deleted
Eventi soppressione: suppression.created, suppression.updated, suppression.deleted
Eventi verifica email: email_verification.created, email_verification.updated
Eventi lista verifica email: email_verification_list.created, email_verification_list.updated
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.
/webhooks/{id}Parametri del Percorso
idstringRequiredL’ID del webhook (wh_xxx) o il nome.
Corpo della Richiesta
namestringNuovo nome per il webhook.
urlstringNuovo URL (validato contro SSRF).
all_eventsbooleanSottoscrivi tutti gli eventi. Impostando su true vengono cancellati eventuali eventi specifici.
enabledbooleanAbilita o disabilita il webhook.
eventsstring[]Sostituisce i tipi di evento sottoscritti. Ignorato quando all_events è true.
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(); <?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Webhook Aggiornato',
'enabled' => false,
'events' => ['email.accepted', 'email.bounced']
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "Errore cURL #:" . $err;
} else {
$result = json_decode($response, true);
print_r($result);
} import requests
response = requests.post(
'https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M',
headers={
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
},
json={
'name': 'Webhook Aggiornato',
'enabled': False,
'events': ['email.accepted', 'email.bounced']
}
)
result = response.json()
print(result) require 'net/http'
require 'json'
uri = URI('https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer em_test_51RxCWJ...vS00p61e0qRE'
request['Content-Type'] = 'application/json'
request.body = {
name: 'Webhook Aggiornato',
enabled: false,
events: ['email.accepted', 'email.bounced']
}.to_json
response = http.request(request)
result = JSON.parse(response.body)
puts result package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M"
data := map[string]interface{}{
"name": "Webhook Aggiornato",
"enabled": false,
"events": []string{"email.accepted", "email.bounced"},
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
} use reqwest;
use serde_json::{json, Value};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let response = client
.post("https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M")
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.json(&json!({
"name": "Webhook Aggiornato",
"enabled": false,
"events": ["email.accepted", "email.bounced"]
}))
.send()
.await?;
let result: Value = response.json().await?;
println!("{:?}", result);
Ok(())
} import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.http.HttpRequest.BodyPublishers;
public class UpdateWebhook {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String jsonBody = "{\"name\":\"Webhook Aggiornato\",\"enabled\":false,\"events\":[\"email.accepted\",\"email.bounced\"]}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M"))
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.POST(BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
} using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class UpdateWebhook
{
public static async Task Main()
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization",
"Bearer em_test_51RxCWJ...vS00p61e0qRE");
var data = new {
name = "Webhook Aggiornato",
enabled = false,
events = new[] { "email.accepted", "email.bounced" }
};
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
} curl -X POST https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M \
-H "Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE" \
-H "Content-Type: application/json" \
-d '{
"name": "Webhook Aggiornato",
"enabled": false,
"events": ["email.accepted", "email.bounced"]
}' {
"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"
} {
"error": "URL non valido"
} {
"error": "Webhook non trovato"
} {
"error": "Esiste già un webhook con questo nome",
"existing": {
"object": "webhook",
"id": "wh_...",
"name": "..."
}
} Elimina Webhook
Elimina un webhook dal tuo workspace. Richiede permessi completi. I webhook possono essere identificati tramite ID (wh_xxx) o nome.
/webhooks/{id}Parametri del Percorso
idstringRequiredL’ID del webhook (wh_xxx) o il nome.
const response = await fetch('https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
}
});
const result = await response.json(); <?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "Errore cURL #:" . $err;
} else {
$result = json_decode($response, true);
print_r($result);
} import requests
response = requests.delete(
'https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M',
headers={
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
}
)
result = response.json()
print(result) require 'net/http'
require 'json'
uri = URI('https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer em_test_51RxCWJ...vS00p61e0qRE'
request['Content-Type'] = 'application/json'
response = http.request(request)
result = JSON.parse(response.body)
puts result package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println("Stato:", resp.Status)
} use reqwest;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let response = client
.delete("https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M")
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.send()
.await?;
println!("Stato: {}", response.status());
Ok(())
} import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
public class DeleteWebhook {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M"))
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.DELETE()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println("Stato: " + response.statusCode());
}
} using System;
using System.Net.Http;
using System.Threading.Tasks;
public class DeleteWebhook
{
public static async Task Main()
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization",
"Bearer em_test_51RxCWJ...vS00p61e0qRE");
var response = await client.DeleteAsync(
"https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M");
Console.WriteLine("Stato: " + response.StatusCode);
}
}
} curl -X DELETE https://api.emailit.com/v2/webhooks/wh_2BxFg7KNqr5M \
-H "Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE" \
-H "Content-Type: application/json" {
"object": "webhook",
"id": "wh_2BxFg7KNqr5M...",
"name": "Il Mio Webhook",
"deleted": true
} {
"error": "Webhook non trovato"
}