← All API sections

Webhooks

Configure webhook endpoints for delivery events

6 endpoints
Menu

Endpoints

MethodPathDescription
GET/v1/webhooksGET /v1/webhooks
POST/v1/webhooksPOST /v1/webhooks
GET/v1/webhooks/{id}GET /v1/webhooks/:id
PUT/v1/webhooks/{id}PUT /v1/webhooks/:id
DELETE/v1/webhooks/{id}DELETE /v1/webhooks/:id
POST/v1/webhooks/{id}/testSend a test webhook event

GET /v1/webhooks

GET /v1/webhooks

Parameters

NameInTypeRequiredDescription
pagequeryintegerNoPage number (default: 1)
per_pagequeryintegerNoItems per page (default: 25)

Responses

StatusDescription
200Paginated list of webhooks
401Unauthorized

Example

curl -X GET https://api.euromail.dev/v1/webhooks \
  -H "Authorization: Bearer em_live_..."
import { EuroMail } from "@euromail/sdk";

const euromail = new EuroMail({ apiKey: "em_live_..." });

const result = await euromail.listWebhooks();
from euromail import EuroMail

client = EuroMail(api_key="em_live_...")

result = client.list_webhooks()
use euromail::EuroMail;

let client = EuroMail::new("em_live_...");

let result = client.list_webhooks().await?;
client := euromail.NewClient("em_live_...")

result, err := client.ListWebhooks(ctx)

POST /v1/webhooks

POST /v1/webhooks

Request Body

FieldTypeRequiredDescription
eventsstring[]YesEvent types to receive: sent, deferred, bounced, failed, opened, clicked, complained, email.inbound, mailbox.message.received, account.auto_paused, insights.generated.
urlstringYes

Responses

StatusDescription
201Webhook created (signing secret returned only at creation)
401Unauthorized
422Invalid webhook URL

Example

curl -X POST https://api.euromail.dev/v1/webhooks \
  -H "Authorization: Bearer em_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "events": [
    "sent",
    "bounced",
    "failed"
  ],
  "url": "https://yourdomain.com/webhooks/euromail"
}'
import { EuroMail } from "@euromail/sdk";

const euromail = new EuroMail({ apiKey: "em_live_..." });

const result = await euromail.createWebhook({
  events: [
    "sent",
    "bounced",
    "failed"
  ],
  url: "https://yourdomain.com/webhooks/euromail"
});
from euromail import EuroMail

client = EuroMail(api_key="em_live_...")

result = client.create_webhook(
    events=[
    "sent",
    "bounced",
    "failed"
  ],
    url="https://yourdomain.com/webhooks/euromail",
)
use euromail::{EuroMail, CreateWebhookParams};

let client = EuroMail::new("em_live_...");

let result = client.create_webhook(&CreateWebhookParams {
    events: vec!["sent".into(), "bounced".into(), "failed".into()],
    url: "https://yourdomain.com/webhooks/euromail".into(),
    ..Default::default()
}).await?;
client := euromail.NewClient("em_live_...")

result, err := client.CreateWebhook(ctx, euromail.CreateWebhookParams{
    Events: []string{"sent", "bounced", "failed"},
    URL: "https://yourdomain.com/webhooks/euromail",
})

GET /v1/webhooks/{id}

GET /v1/webhooks/:id

Parameters

NameInTypeRequiredDescription
idpathstringYesWebhook ID

Responses

StatusDescription
200Webhook details
401Unauthorized
404Webhook not found

Example

curl -X GET https://api.euromail.dev/v1/webhooks/{id} \
  -H "Authorization: Bearer em_live_..."
import { EuroMail } from "@euromail/sdk";

const euromail = new EuroMail({ apiKey: "em_live_..." });

const result = await euromail.getWebhook("id_...");
from euromail import EuroMail

client = EuroMail(api_key="em_live_...")

result = client.get_webhook("id_...")
use euromail::EuroMail;

let client = EuroMail::new("em_live_...");

let result = client.get_webhook("id_...").await?;
client := euromail.NewClient("em_live_...")

result, err := client.GetWebhook(ctx, "id_...")

PUT /v1/webhooks/{id}

PUT /v1/webhooks/:id

Parameters

NameInTypeRequiredDescription
idpathstringYesWebhook ID

Request Body

FieldTypeRequiredDescription
eventsstring[]YesEvent types to receive; the same list as on create.
is_activebooleanYes
urlstringYes

Responses

StatusDescription
200Webhook updated
401Unauthorized
404Webhook not found

Example

curl -X PUT https://api.euromail.dev/v1/webhooks/{id} \
  -H "Authorization: Bearer em_live_..." \
  -H "Content-Type: application/json" \
  -d '{
  "events": [
    "sent",
    "bounced",
    "failed"
  ],
  "is_active": true,
  "url": "https://yourdomain.com/webhooks/euromail"
}'
import { EuroMail } from "@euromail/sdk";

const euromail = new EuroMail({ apiKey: "em_live_..." });

const result = await euromail.updateWebhook({
  events: [
    "sent",
    "bounced",
    "failed"
  ],
  is_active: true,
  url: "https://yourdomain.com/webhooks/euromail"
});
from euromail import EuroMail

client = EuroMail(api_key="em_live_...")

result = client.update_webhook(
    events=[
    "sent",
    "bounced",
    "failed"
  ],
    is_active=True,
    url="https://yourdomain.com/webhooks/euromail",
)
use euromail::{EuroMail, UpdateWebhookParams};

let client = EuroMail::new("em_live_...");

let result = client.update_webhook(&UpdateWebhookParams {
    events: vec!["sent".into(), "bounced".into(), "failed".into()],
    is_active: true,
    url: "https://yourdomain.com/webhooks/euromail".into(),
    ..Default::default()
}).await?;
client := euromail.NewClient("em_live_...")

result, err := client.UpdateWebhook(ctx, euromail.UpdateWebhookParams{
    Events: []string{"sent", "bounced", "failed"},
    IsActive: true,
    URL: "https://yourdomain.com/webhooks/euromail",
})

DELETE /v1/webhooks/{id}

DELETE /v1/webhooks/:id

Parameters

NameInTypeRequiredDescription
idpathstringYesWebhook ID

Responses

StatusDescription
204Webhook deleted
401Unauthorized
404Webhook not found

Example

curl -X DELETE https://api.euromail.dev/v1/webhooks/{id} \
  -H "Authorization: Bearer em_live_..."
import { EuroMail } from "@euromail/sdk";

const euromail = new EuroMail({ apiKey: "em_live_..." });

const result = await euromail.deleteWebhook("id_...");
from euromail import EuroMail

client = EuroMail(api_key="em_live_...")

result = client.delete_webhook("id_...")
use euromail::EuroMail;

let client = EuroMail::new("em_live_...");

let result = client.delete_webhook("id_...").await?;
client := euromail.NewClient("em_live_...")

result, err := client.DeleteWebhook(ctx, "id_...")

POST /v1/webhooks/{id}/test

Send a test webhook event

Parameters

NameInTypeRequiredDescription
idpathstringYesWebhook ID

Responses

StatusDescription
200Test event queued and will be delivered to the webhook URL
401Unauthorized
404Webhook not found

Example

curl -X POST https://api.euromail.dev/v1/webhooks/{id}/test \
  -H "Authorization: Bearer em_live_..."
import { EuroMail } from "@euromail/sdk";

const euromail = new EuroMail({ apiKey: "em_live_..." });

const result = await euromail.getWebhookDetail("id_...");
from euromail import EuroMail

client = EuroMail(api_key="em_live_...")

result = client.get_webhook_detail("id_...")
use euromail::EuroMail;

let client = EuroMail::new("em_live_...");

let result = client.get_webhook_detail("id_...").await?;
client := euromail.NewClient("em_live_...")

result, err := client.GetWebhookDetail(ctx, "id_...")