Webhooks
Configure webhook endpoints for delivery events
6 endpoints
Endpoints
| Method | Path | Description |
| GET | /v1/webhooks | GET /v1/webhooks |
| POST | /v1/webhooks | POST /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}/test | POST /v1/webhooks/:id/test - Send a test webhook event |
GET /v1/webhooks
GET /v1/webhooks
Parameters
| Name | In | Type | Required | Description |
page | query | integer | No | Page number (default: 1) |
per_page | query | integer | No | Items per page (default: 25) |
Responses
| Status | Description |
| 200 | Paginated list of webhooks |
| 401 | Unauthorized |
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
| Field | Type | Required | Description |
events | string[] | Yes | |
url | string | Yes | |
Responses
| Status | Description |
| 201 | Webhook created (signing secret returned only at creation) |
| 401 | Unauthorized |
| 422 | Invalid 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
| Name | In | Type | Required | Description |
id | path | string | Yes | Webhook ID |
Responses
| Status | Description |
| 200 | Webhook details |
| 401 | Unauthorized |
| 404 | Webhook 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
| Name | In | Type | Required | Description |
id | path | string | Yes | Webhook ID |
Request Body
| Field | Type | Required | Description |
events | string[] | Yes | |
is_active | boolean | Yes | |
url | string | Yes | |
Responses
| Status | Description |
| 200 | Webhook updated |
| 401 | Unauthorized |
| 404 | Webhook 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
| Name | In | Type | Required | Description |
id | path | string | Yes | Webhook ID |
Responses
| Status | Description |
| 204 | Webhook deleted |
| 401 | Unauthorized |
| 404 | Webhook 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
| Name | In | Type | Required | Description |
id | path | string | Yes | Webhook ID |
Responses
| Status | Description |
| 200 | Test event queued and will be delivered to the webhook URL |
| 401 | Unauthorized |
| 404 | Webhook 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_...")