← All API sections

Webhooks

Configure webhook endpoints for delivery events

6 endpoints

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}/testPOST /v1/webhooks/:id/test - Send 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 "X-EuroMail-Api-Key: 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[]Yes
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 "X-EuroMail-Api-Key: em_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "events": [], "url": "https://example.com/webhook" }'
import { EuroMail } from "@euromail/sdk";

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

const result = await euromail.createWebhook({
    events: [],
    url: "https://example.com/webhook",
  });
from euromail import EuroMail

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

result = client.create_webhook(
    events=[],
    url="https://example.com/webhook",
)
use euromail::EuroMail;

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

let result = client.create_webhook(&CreateWebhookParams {
    events: [],
    url: "https://example.com/webhook".into(),
    ..Default::default()
}).await?;
client := euromail.NewClient("em_live_...")

result, err := client.CreateWebhook(ctx, euromail.CreateWebhookParams{
    Events: [],
    Url: "https://example.com/webhook",
})

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 "X-EuroMail-Api-Key: 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[]Yes
is_activebooleanYes
urlstringYes

Responses

StatusDescription
200Webhook updated
401Unauthorized
404Webhook not found

Example

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

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

const result = await euromail.updateWebhook({
    events: [],
    is_active: true,
    url: "https://example.com/webhook",
  });
from euromail import EuroMail

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

result = client.update_webhook(
    events=[],
    is_active=true,
    url="https://example.com/webhook",
)
use euromail::EuroMail;

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

let result = client.update_webhook(&UpdateWebhookParams {
    events: [],
    is_active: true,
    url: "https://example.com/webhook".into(),
    ..Default::default()
}).await?;
client := euromail.NewClient("em_live_...")

result, err := client.UpdateWebhook(ctx, euromail.UpdateWebhookParams{
    Events: [],
    IsActive: true,
    Url: "https://example.com/webhook",
})

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 "X-EuroMail-Api-Key: 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

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 "X-EuroMail-Api-Key: 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_...")