List Webhooks

Retrieve a list of all webhooks in your workspace. Requires full permission.

GET/webhooks

Query Parameters

pageinteger

Page number for pagination (minimum: 1, default: 1).

limitinteger

Number of webhooks to return (minimum: 1, maximum: 100, default: 10).

GET /webhooks
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const webhooks = await emailit.webhooks.list();
from emailit import EmailitClient
client = EmailitClient("your_api_key")

webhooks = client.webhooks.list()
$emailit = Emailit::client('your_api_key');

$webhooks = $emailit->webhooks()->list();
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

webhooks = client.webhooks.list
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

webhooks, err := client.Webhooks.List(nil)
use emailit::Emailit;
let emailit = Emailit::new("your_api_key");

let webhooks = emailit.webhooks.list(None).await?;
import com.emailit.*;
EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject webhooks = emailit.webhooks().list();
using Emailit;
var emailit = new EmailitClient("your_api_key");

var webhooks = emailit.Webhooks.List();
use Emailit\Laravel\Facades\Emailit;

$webhooks = Emailit::webhooks()->list();
curl https://api.emailit.com/v2/webhooks \
  -H "Authorization: Bearer your_api_key"
{
  "data": [
    {
      "object": "webhook",
      "id": "wh_2BxFg7KNqr5M...",
      "name": "My 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": "Unauthorized"
  }
}

Get Webhook

Retrieve information about a specific webhook. Requires full permission.

GET/webhooks/{id}

Path Parameters

idstringRequired

The webhook ID (wh_xxx).

GET /webhooks/{id}
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const webhook = await emailit.webhooks.get('wh_123');
from emailit import EmailitClient
client = EmailitClient("your_api_key")

webhook = client.webhooks.get("wh_123")
$emailit = Emailit::client('your_api_key');

$webhook = $emailit->webhooks()->get('wh_123');
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

webhook = client.webhooks.get("wh_123")
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

webhook, err := client.Webhooks.Get("wh_123")
use emailit::Emailit;
let emailit = Emailit::new("your_api_key");

let webhook = emailit.webhooks.get("wh_123").await?;
import com.emailit.*;
EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject webhook = emailit.webhooks().get("wh_123");
using Emailit;
var emailit = new EmailitClient("your_api_key");

var webhook = emailit.Webhooks.Get("wh_123");
use Emailit\Laravel\Facades\Emailit;

$webhook = Emailit::webhooks()->get('wh_123');
curl https://api.emailit.com/v2/webhooks/wh_123 \
  -H "Authorization: Bearer your_api_key"
{
  "object": "webhook",
  "id": "wh_2BxFg7KNqr5M...",
  "name": "My 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 not found"
}

Create Webhook

Create a new webhook in your workspace. Requires full permission. URL validation includes SSRF protection — private IPs, localhost, and metadata endpoints are blocked.

POST/webhooks

Request Body

namestringRequired

Unique name within the workspace.

urlstringRequired

HTTPS endpoint URL (SSRF-validated).

all_eventsboolean

Subscribe to all event types (default: false).

enabledboolean

Whether the webhook is active (default: true).

eventsstring[]

Array of event type names to subscribe to (default: []). Ignored if all_events is true.

POST /webhooks
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const webhook = await emailit.webhooks.create({
    name: 'My Webhook',
    url: 'https://example.com/webhook',
    events: ['email.delivered']
});
from emailit import EmailitClient
client = EmailitClient("your_api_key")

webhook = client.webhooks.create({
    "name": "My Webhook",
    "url": "https://example.com/webhook",
    "events": ["email.delivered"]
})
$emailit = Emailit::client('your_api_key');

$webhook = $emailit->webhooks()->create([
    'name' => 'My Webhook',
    'url' => 'https://example.com/webhook',
    'events' => ['email.delivered']
]);
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

webhook = client.webhooks.create(
    name: "My Webhook",
    url: "https://example.com/webhook",
    events: ["email.delivered"]
)
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

webhook, err := client.Webhooks.Create(&emailit.CreateWebhookRequest{
    Name:   "My Webhook",
    Url:    "https://example.com/webhook",
    Events: []string{"email.delivered"},
})
use emailit::Emailit;
let emailit = Emailit::new("your_api_key");

let webhook = emailit.webhooks.create(
    emailit::types::CreateWebhookParams::new(
        "My Webhook",
        "https://example.com/webhook"
    ).with_events(vec!["email.delivered".into()])
).await?;
import com.emailit.*;
import com.emailit.params.*;
EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject webhook = emailit.webhooks().create(
    WebhookCreateParams.builder()
        .setName("My Webhook")
        .setUrl("https://example.com/webhook")
        .setEvents(Arrays.asList("email.delivered"))
        .build()
);
using Emailit;
var emailit = new EmailitClient("your_api_key");

var webhook = emailit.Webhooks.Create(new WebhookCreateOptions {
    Name = "My Webhook",
    Url = "https://example.com/webhook",
    Events = new[] { "email.delivered" }
});
use Emailit\Laravel\Facades\Emailit;

$webhook = Emailit::webhooks()->create([
    'name' => 'My Webhook',
    'url' => 'https://example.com/webhook',
    'events' => ['email.delivered']
]);
curl -X POST https://api.emailit.com/v2/webhooks \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Webhook",
    "url": "https://example.com/webhook",
    "events": ["email.delivered"]
  }'
{
  "object": "webhook",
  "id": "wh_2BxFg7KNqr5M...",
  "name": "Production Webhook",
  "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": "Missing required field: name"
}
{
  "error": "Webhook with this name already exists",
  "existing": {
    "object": "webhook",
    "id": "wh_...",
    "name": "..."
  }
}

Available Event Types

These are all the event types that can be used in the events array:

Email events: email.accepted, email.scheduled, email.delivered, email.bounced, email.attempted, email.failed, email.rejected, email.clicked, email.loaded, email.complained, email.received, email.suppressed

Domain events: domain.created, domain.updated, domain.deleted

Audience events: audience.created, audience.updated, audience.deleted

Subscriber events: subscriber.created, subscriber.updated, subscriber.deleted

Contact events: contact.created, contact.updated, contact.deleted

Template events: template.created, template.updated, template.deleted

Suppression events: suppression.created, suppression.updated, suppression.deleted

Email verification events: email_verification.created, email_verification.updated

Email verification list events: email_verification_list.created, email_verification_list.updated

Update Webhook

Update an existing webhook in your workspace. Requires full permission. All fields are optional, but at least one must be provided. Webhooks can be identified by ID (wh_xxx) or name.

POST/webhooks/{id}

Path Parameters

idstringRequired

The webhook ID (wh_xxx) or name.

Request Body

namestring

New name for the webhook.

urlstring

New URL (SSRF-validated).

all_eventsboolean

Subscribe to all events. Setting to true clears any specific events.

enabledboolean

Enable or disable the webhook.

eventsstring[]

Replace subscribed event types. Ignored when all_events is true.

PATCH /webhooks/{id}
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const webhook = await emailit.webhooks.update('wh_123', {
    enabled: false
});
from emailit import EmailitClient
client = EmailitClient("your_api_key")

webhook = client.webhooks.update("wh_123", {
    "enabled": False
})
$emailit = Emailit::client('your_api_key');

$webhook = $emailit->webhooks()->update('wh_123', [
    'enabled' => false
]);
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

webhook = client.webhooks.update("wh_123", enabled: false)
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

webhook, err := client.Webhooks.Update("wh_123", &emailit.UpdateWebhookRequest{
    Enabled: false,
})
use emailit::Emailit;
let emailit = Emailit::new("your_api_key");

let webhook = emailit.webhooks.update("wh_123",
    emailit::types::UpdateWebhookParams {
        enabled: Some(false),
        ..Default::default()
    }
).await?;
import com.emailit.*;
import com.emailit.params.*;
EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject webhook = emailit.webhooks().update("wh_123",
    WebhookUpdateParams.builder()
        .setEnabled(false)
        .build()
);
using Emailit;
var emailit = new EmailitClient("your_api_key");

var webhook = emailit.Webhooks.Update("wh_123", new WebhookUpdateOptions {
    Enabled = false
});
use Emailit\Laravel\Facades\Emailit;

$webhook = Emailit::webhooks()->update('wh_123', [
    'enabled' => false
]);
curl -X PATCH https://api.emailit.com/v2/webhooks/wh_123 \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"enabled": false}'
{
  "object": "webhook",
  "id": "wh_2BxFg7KNqr5M...",
  "name": "Updated 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"
}
{
  "error": "Invalid URL"
}
{
  "error": "Webhook not found"
}
{
  "error": "Webhook with this name already exists",
  "existing": {
    "object": "webhook",
    "id": "wh_...",
    "name": "..."
  }
}

Delete Webhook

Delete a webhook from your workspace. Requires full permission. Webhooks can be identified by ID (wh_xxx) or name.

DELETE/webhooks/{id}

Path Parameters

idstringRequired

The webhook ID (wh_xxx) or name.

DELETE /webhooks/{id}
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

await emailit.webhooks.delete('wh_123');
from emailit import EmailitClient
client = EmailitClient("your_api_key")

client.webhooks.delete("wh_123")
$emailit = Emailit::client('your_api_key');

$emailit->webhooks()->delete('wh_123');
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

client.webhooks.delete("wh_123")
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

err := client.Webhooks.Delete("wh_123")
use emailit::Emailit;
let emailit = Emailit::new("your_api_key");

emailit.webhooks.delete("wh_123").await?;
import com.emailit.*;
EmailitClient emailit = new EmailitClient("your_api_key");

emailit.webhooks().delete("wh_123");
using Emailit;
var emailit = new EmailitClient("your_api_key");

emailit.Webhooks.Delete("wh_123");
use Emailit\Laravel\Facades\Emailit;

Emailit::webhooks()->delete('wh_123');
curl -X DELETE https://api.emailit.com/v2/webhooks/wh_123 \
  -H "Authorization: Bearer your_api_key"
{
  "object": "webhook",
  "id": "wh_2BxFg7KNqr5M...",
  "name": "My Webhook",
  "deleted": true
}
{
  "error": "Webhook not found"
}