Listar Webhooks

Recupera uma lista de todos os webhooks no seu workspace. Requer permissão total.

GET/webhooks

Parâmetros de Consulta

pageinteger

Número da página para paginação (mínimo: 1, padrão: 1).

limitinteger

Quantidade de webhooks a retornar (mínimo: 1, máximo: 100, padrão: 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 "Erro 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": "Meu 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": "Não autorizado"
}
}

Obter Webhook

Recupera informações sobre um webhook específico. Requer permissão total.

GET/webhooks/{id}

Parâmetros de Caminho

idstringRequired

O ID do 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 "Erro 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": "Meu 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 não encontrado"
}

Criar Webhook

Crie um novo webhook no seu workspace. Requer permissão completa. A validação da URL inclui proteção SSRF — IPs privados, localhost e endpoints de metadados são bloqueados.

POST/webhooks

Corpo da Requisição

namestringRequired

Nome único dentro do workspace.

urlstringRequired

URL do endpoint HTTPS (validada contra SSRF).

all_eventsboolean

Inscrever-se em todos os tipos de evento (padrão: false).

enabledboolean

Se o webhook está ativo (padrão: true).

eventsstring[]

Array com nomes dos tipos de evento para se inscrever (padrão: []). Ignorado se all_events for 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 de Produção',
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 de Produção',
'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 "Erro 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 de Produção',
    '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 de Produção',
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 de Produção",
    "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 de Produção",
        "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 de Produção\",\"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 de Produção",
            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 de Produção",
"url": "https://example.com/webhook",
"all_events": false,
"enabled": true,
"events": ["email.accepted", "email.delivered", "email.bounced"]
}'
{
"object": "webhook",
"id": "wh_2BxFg7KNqr5M...",
"name": "Webhook de Produção",
"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 obrigatório ausente: name"
}
{
"error": "Webhook com este nome já existe",
"existing": {
"object": "webhook",
"id": "wh_...",
"name": "..."
}
}

Tipos de Evento Disponíveis

Estes são todos os tipos de evento que podem ser usados no array events:

Eventos de 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

Eventos de domínio: domain.created, domain.updated, domain.deleted

Eventos de audiência: audience.created, audience.updated, audience.deleted

Eventos de assinante: subscriber.created, subscriber.updated, subscriber.deleted

Eventos de contato: contact.created, contact.updated, contact.deleted

Eventos de template: template.created, template.updated, template.deleted

Eventos de supressão: suppression.created, suppression.updated, suppression.deleted

Eventos de verificação de email: email_verification.created, email_verification.updated

Eventos de lista de verificação de email: email_verification_list.created, email_verification_list.updated

Atualizar Webhook

Atualiza um webhook existente no seu workspace. Requer permissão total. Todos os campos são opcionais, mas pelo menos um deve ser fornecido. Os webhooks podem ser identificados por ID (wh_xxx) ou nome.

POST/webhooks/{id}

Parâmetros de Caminho

idstringRequired

O ID do webhook (wh_xxx) ou nome.

Corpo da Requisição

namestring

Novo nome para o webhook.

urlstring

Nova URL (validada contra SSRF).

all_eventsboolean

Inscrever-se em todos os eventos. Definir como true limpa quaisquer eventos específicos.

enabledboolean

Ativar ou desativar o webhook.

eventsstring[]

Substituir os tipos de evento inscritos. Ignorado 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 Atualizado',
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 Atualizado',
'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 "Erro 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 Atualizado',
    '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 Atualizado',
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 Atualizado",
    "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 Atualizado",
        "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 Atualizado\",\"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 Atualizado",
            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 Atualizado",
"enabled": false,
"events": ["email.accepted", "email.bounced"]
}'
{
"object": "webhook",
"id": "wh_2BxFg7KNqr5M...",
"name": "Webhook Atualizado",
"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 inválida"
}
{
"error": "Webhook não encontrado"
}
{
"error": "Já existe um webhook com este nome",
"existing": {
"object": "webhook",
"id": "wh_...",
"name": "..."
}
}

Excluir Webhook

Exclua um webhook do seu workspace. Requer permissão total. Os webhooks podem ser identificados por ID (wh_xxx) ou nome.

DELETE/webhooks/{id}

Parâmetros de Caminho

idstringRequired

O ID do webhook (wh_xxx) ou 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 "Erro 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("Status:", 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!("Status: {}", 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("Status: " + 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("Status: " + 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": "Meu Webhook",
"deleted": true
}
{
"error": "Webhook não encontrado"
}
Localizado por IA