### Install Official SDKs
Source: https://euromail.dev/docs
Install the EuroMail SDKs for TypeScript, Python, Rust, and Go using their respective package managers.
```bash
# TypeScript / Node.js
npm install @euromail/sdk
# Python
pip install euromail
# Rust (add to Cargo.toml)
euromail = "0.1"
# Go
go get github.com/kalle-works/euromail-go
```
--------------------------------
### Install EuroMail SDK for TypeScript
Source: https://euromail.dev/docs/guides/quickstart
Install the official EuroMail SDK for TypeScript using npm. This is required before you can send emails programmatically.
```bash
npm install @euromail/sdk
```
--------------------------------
### Webhook Payload Example
Source: https://euromail.dev/docs/guides/webhooks
An example of a webhook payload for a 'delivered' event, including details about the email and recipient.
```json
{
"event": "delivered",
"timestamp": "2026-03-09T14:32:01Z",
"email_id": "em_01JQ5K8WMFZ9XRTVB3GH6EDCN4",
"from": "hello@yourdomain.com",
"to": "user@example.com",
"subject": "Your order has shipped",
"domain": "yourdomain.com",
"smtp_response": "250 2.0.0 OK",
"tls_used": true,
"ip_address": "65.109.223.190"
}
```
--------------------------------
### Get Signup Form (Rust)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail Rust SDK to get a specific signup form by its ID. The client requires your API key for authentication.
```rust
use euromail::EuroMail;
let client = EuroMail::new("em_live_...");
let result = client.get_signup_form("id_...").await?;
```
--------------------------------
### Send Email using Go SDK
Source: https://euromail.dev/docs
Example of sending an email using the official EuroMail Go SDK. Initializes the client and calls the SendEmail method with SendEmailParams.
```APIDOC
## Send Email (Go SDK)
### Description
Send transactional emails using the EuroMail Go SDK.
### Method
`client.SendEmail()`
### Parameters
- **From** (string) - Required - The sender's email address.
- **To** (Recipients) - Required - The recipient's email address.
- **Subject** (String) - Optional - The subject of the email.
- **HTMLBody** (String) - Optional - The HTML content of the email.
### Request Example
```go
import (
"context"
euromail "github.com/kalle-works/euromail-go"
)
// Assuming ctx is a valid context.Context
ctx := context.Background()
client := euromail.NewClient("em_live_...")
result, err := client.SendEmail(ctx, euromail.SendEmailParams{
From: "hello@yourdomain.com",
To: euromail.Recipients("user@example.com"),
Subject: euromail.String("Hello from EuroMail"),
HTMLBody: euromail.String("
It works!
"),
})
```
### Response
- **result** - The result of the email sending operation.
- **err** - An error if the operation failed.
```
--------------------------------
### Install EuroMail Package for Python
Source: https://euromail.dev/docs/guides/quickstart
Install the official EuroMail package for Python using pip. This is necessary for sending emails with the Python client.
```bash
pip install euromail
```
--------------------------------
### Get Signup Form
Source: https://euromail.dev/docs/signup-forms
Retrieves the details of a specific signup form by its ID.
```APIDOC
## GET /v1/signup-forms/{id}
### Description
Retrieves the details of a specific signup form by its ID.
### Method
GET
### Endpoint
/v1/signup-forms/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - Signup form ID
### Responses
#### Success Response (200)
- **Signup form details**
#### Error Response (401)
- **Unauthorized**
#### Error Response (404)
- **Signup form not found**
### Request Example
```curl
curl -X GET https://api.euromail.dev/v1/signup-forms/{id} \
-H "X-EuroMail-Api-Key: em_live_..."
```
### Response Example
```json
{
"id": "form_abc123",
"title": "Newsletter Signup",
"list_id": "list_xyz789",
"description": "Sign up for our weekly newsletter.",
"created_at": "2023-10-27T10:00:00Z",
"updated_at": "2023-10-27T10:00:00Z"
}
```
```
--------------------------------
### Get Signup Form (Python)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail Python client to retrieve a signup form by its ID. Instantiate the client with your API key.
```python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.get_signup_form("id_...")
```
--------------------------------
### Get Signup Form (Go)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail Go client to retrieve a signup form by its ID. Ensure you pass the context and initialize the client with your API key.
```go
client := euromail.NewClient("em_live_...")
result, err := client.GetSignupForm(ctx, "id_...")
```
--------------------------------
### Add EuroMail Go Module
Source: https://euromail.dev/docs/guides/quickstart
Fetch the EuroMail Go SDK using go get. This command adds the necessary package to your Go project.
```bash
go get github.com/kalle-works/euromail-go
```
--------------------------------
### Get Signup Form (cURL)
Source: https://euromail.dev/docs/signup-forms
Use this cURL command to retrieve details for a specific signup form by its ID. Requires API key authentication.
```bash
curl -X GET https://api.euromail.dev/v1/signup-forms/{id} \
-H "X-EuroMail-Api-Key: em_live_..."
```
--------------------------------
### GET /v1/account
Source: https://euromail.dev/docs/account
Retrieves the current account information and quota usage.
```APIDOC
## GET /v1/account
### Description
Get current account info and quota usage.
### Method
GET
### Endpoint
/v1/account
### Responses
#### Success Response (200)
- Account details with quota usage
#### Error Response (401)
- Unauthorized
### Request Example
```curl
curl -X GET https://api.euromail.dev/v1/account \
-H "X-EuroMail-Api-Key: em_live_..."
```
```
--------------------------------
### Send Email using Python SDK
Source: https://euromail.dev/docs
Example of sending an email using the official EuroMail Python SDK. Initializes the client with an API key and calls the send_email method.
```APIDOC
## Send Email (Python SDK)
### Description
Send transactional emails using the EuroMail Python SDK.
### Method
`client.send_email()`
### Parameters
- **from_address** (string) - Required - The sender's email address.
- **to** (string) - Required - The recipient's email address.
- **subject** (string) - Required - The subject of the email.
- **html_body** (string) - Required - The HTML content of the email.
### Request Example
```python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.send_email(
from_address="hello@yourdomain.com",
to="user@example.com",
subject="Hello from EuroMail",
html_body="It works!
",
)
```
### Response
- **result** - The result of the email sending operation.
```
--------------------------------
### Send Email using Rust SDK
Source: https://euromail.dev/docs
Example of sending an email using the official EuroMail Rust SDK. Initializes the client and calls the send_email method with SendEmailParams.
```APIDOC
## Send Email (Rust SDK)
### Description
Send transactional emails using the EuroMail Rust SDK.
### Method
`client.send_email()`
### Parameters
- **from** (string) - Required - The sender's email address.
- **to** (string) - Required - The recipient's email address.
- **subject** (string) - Optional - The subject of the email.
- **html_body** (string) - Optional - The HTML content of the email.
### Request Example
```rust
use euromail::{EuroMail, SendEmailParams};
let client = EuroMail::new("em_live_...");
let result = client.send_email(&SendEmailParams {
from: "hello@yourdomain.com".into(),
to: "user@example.com".into(),
subject: Some("Hello from EuroMail".into()),
html_body: Some("It works!
".into()),
..Default::default()
}).await?;
```
### Response
- **result** - The result of the email sending operation.
```
--------------------------------
### Get Signup Form (TypeScript)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail SDK for TypeScript to fetch details of a specific signup form using its ID. Initialize the client with your API key.
```typescript
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.getSignupForm("id_...");
```
--------------------------------
### List Signup Forms (Rust)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail Rust SDK to get a list of signup forms. The client requires your API key for authentication.
```rust
use euromail::EuroMail;
let client = EuroMail::new("em_live_...");
let result = client.list_signup_forms().await?;
```
--------------------------------
### GET /v1/analytics/overview
Source: https://euromail.dev/docs/analytics
Retrieves a summary of key analytics statistics, including totals and rates for the authenticated account.
```APIDOC
## GET /v1/analytics/overview
### Description
Returns summary statistics (totals + rates) for the authenticated account.
### Method
GET
### Endpoint
/v1/analytics/overview
### Parameters
#### Query Parameters
- **period** (string) - Optional - Period shorthand: 7d, 30d, 90d (default: 30d)
- **from** (string) - Optional - Start date (YYYY-MM-DD)
- **to** (string) - Optional - End date (YYYY-MM-DD)
### Responses
#### Success Response (200)
- **Analytics summary**
#### Error Responses
- **400** - Invalid parameters
- **401** - Unauthorized
```
--------------------------------
### Get Account Info
Source: https://euromail.dev/docs/account
Retrieve current account details and quota usage. Requires an API key.
```curl
curl -X GET https://api.euromail.dev/v1/account \
-H "X-EuroMail-Api-Key: em_live_..."
```
```typescript
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.listAccounts();
```
```python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.list_accounts()
```
```rust
use euromail::EuroMail;
let client = EuroMail::new("em_live_...");
let result = client.list_accounts().await?;
```
```go
client := euromail.NewClient("em_live_...")
result, err := client.ListAccounts(ctx)
```
--------------------------------
### List Audit Logs (Python SDK)
Source: https://euromail.dev/docs/audit
Initialize the EuroMail client with your API key and use the list_audit_logs method to get audit log data.
```python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.list_audit_logs()
```
--------------------------------
### Send Email using TypeScript SDK
Source: https://euromail.dev/docs
Example of sending an email using the official EuroMail TypeScript SDK. Initializes the SDK with an API key and calls the sendEmail method.
```APIDOC
## Send Email (TypeScript SDK)
### Description
Send transactional emails using the EuroMail TypeScript SDK.
### Method
`euromail.sendEmail()`
### Parameters
- **from** (string) - Required - The sender's email address.
- **to** (string) - Required - The recipient's email address.
- **subject** (string) - Required - The subject of the email.
- **html_body** (string) - Required - The HTML content of the email.
### Request Example
```typescript
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.sendEmail({
from: "hello@yourdomain.com",
to: "user@example.com",
subject: "Hello from EuroMail",
html_body: "It works!
",
});
```
### Response
- **result** - The result of the email sending operation.
```
--------------------------------
### Process Inbound Email Webhook (Flask)
Source: https://euromail.dev/docs/guides/inbound-email
Example of how to process an inbound email webhook using Flask in Python, including signature verification.
```python
from flask import Flask, request, jsonify
import hmac
import hashlib
app = Flask(__name__)
WEBHOOK_SECRET = "your_webhook_signing_secret"
@app.route("/webhooks/inbound", methods=["POST"])
def handle_inbound():
# Verify signature
signature = request.headers.get("X-EuroMail-Signature", "")
expected = hmac.new(
WEBHOOK_SECRET.encode(), request.data, hashlib.sha256
).hexdigest()
if not hmac.compare_digest(f"sha256={expected}", signature):
return "Invalid signature", 401
data = request.json
print(f"From: {data['from']}")
print(f"Subject: {data['subject']}")
print(f"Body: {data['text_body']}")
# Process attachments
for att in data.get("attachments") or []:
print(f"Attachment: {att['filename']} ({att['content_type']}, {att['size']} bytes)")
return jsonify({"status": "ok"}), 200
```
--------------------------------
### Send Email using Go SDK
Source: https://euromail.dev/docs
Send an email using the official Go SDK. Initialize the client with your API key.
```go
client := euromail.NewClient("em_live_...")
result, err := client.SendEmail(ctx, euromail.SendEmailParams{
From: "hello@yourdomain.com",
To: euromail.Recipients("user@example.com"),
Subject: euromail.String("Hello from EuroMail"),
HTMLBody: euromail.String("It works!
"),
})
```
--------------------------------
### Get Contact List Detail (Python)
Source: https://euromail.dev/docs/contact-lists
Fetch details for a contact list using the EuroMail Python client. Initialize the client with your API key before making the call.
```python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.get_contact_list_detail("id_...")
```
--------------------------------
### Create a Contact List
Source: https://euromail.dev/docs/guides/newsletters
Organize your subscribers into distinct contact lists. Each list manages its own signup form, unsubscribe requests, and sending history.
```bash
# Create a list
curl -X POST https://api.euromail.dev/v1/contact-lists \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{"name": "Product Updates", "description": "Monthly product updates"}'
```
--------------------------------
### List Signup Forms (Go)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail Go client to list signup forms. Ensure you pass the context and initialize the client with your API key.
```go
client := euromail.NewClient("em_live_...")
result, err := client.ListSignupForms(ctx)
```
--------------------------------
### Get Sub-Account
Source: https://euromail.dev/docs/guides/sub-accounts
Retrieves the details of a specific sub-account by its ID.
```APIDOC
## Get Sub-Account
### Description
Retrieves the full details of a specific sub-account using its unique identifier.
### Method
GET
### Endpoint
/v1/accounts/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - The unique identifier of the sub-account.
### Response
#### Success Response (200 OK)
- Returns the full sub-account details including `updated_at`.
#### Error Response
- Returns `404` if the sub-account does not exist or belongs to a different parent.
```
--------------------------------
### Create Signup Form (Go)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail Go client to create a signup form. Provide the context, list ID, and title. The `CreateSignupFormParams` struct accommodates optional fields.
```go
client := euromail.NewClient("em_live_...")
result, err := client.CreateSignupForm(ctx, euromail.CreateSignupFormParams{
ListId: "...",
Title: "...",
})
```
--------------------------------
### Get Webhook by ID
Source: https://euromail.dev/docs/webhooks
Retrieves the details of a specific webhook by its ID.
```APIDOC
## GET /v1/webhooks/{id}
### Description
Retrieves webhook details.
### Method
GET
### Endpoint
/v1/webhooks/{id}
#### Path Parameters
- **id** (string) - Required - Webhook ID
#### Responses
- **200** - Webhook details
- **401** - Unauthorized
- **404** - Webhook not found
### Request Example
```
curl -X GET https://api.euromail.dev/v1/webhooks/{id} \
-H "X-EuroMail-Api-Key: em_live_..."
```
```
--------------------------------
### GET /v1/domains/{id}
Source: https://euromail.dev/docs/domains
Retrieves the details of a specific domain by its ID.
```APIDOC
## GET /v1/domains/{id}
### Description
Retrieves the details of a specific domain.
### Method
GET
### Endpoint
/v1/domains/{id}
#### Path Parameters
- **id** (string) - Required - Domain ID
#### Responses
- **200** - Domain details
- **401** - Unauthorized
- **404** - Domain not found
### Request Example
```
curl -X GET https://api.euromail.dev/v1/domains/{id} \
-H "X-EuroMail-Api-Key: em_live_..."
```
```
--------------------------------
### List Signup Forms (cURL)
Source: https://euromail.dev/docs/signup-forms
Use this cURL command to retrieve a list of all signup forms. Ensure you include your API key in the headers.
```bash
curl -X GET https://api.euromail.dev/v1/signup-forms \
-H "X-EuroMail-Api-Key: em_live_..."
```
--------------------------------
### Create Signup Form (cURL)
Source: https://euromail.dev/docs/signup-forms
Use this cURL command to create a new signup form. Include the list ID and title in the JSON request body. Requires API key authentication.
```bash
curl -X POST https://api.euromail.dev/v1/signup-forms \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{ "list_id": "...", "title": "..." }'
```
--------------------------------
### GET /v1/emails
Source: https://euromail.dev/docs/emails
Retrieves a paginated list of emails with filtering capabilities.
```APIDOC
## GET /v1/emails
### Description
GET /v1/emails - List emails with pagination and filters
### Method
GET
### Endpoint
/v1/emails
### Parameters
#### Query Parameters
- **page** (integer) - Optional - Page number (default: 1)
- **per_page** (integer) - Optional - Items per page (default: 25)
- **status** (string) - Optional - Filter by status (queued, sent, bounced, failed)
- **from_date** (string) - Optional - Filter from date (ISO 8601)
- **to_date** (string) - Optional - Filter to date (ISO 8601)
### Responses
#### Success Response (200)
- **emails** (array) - Paginated list of emails
#### Error Response (401)
- **message** (string) - Unauthorized
### Request Example
```
curl -X GET https://api.euromail.dev/v1/emails \
-H "X-EuroMail-Api-Key: em_live_..."
```
### Response Example
```json
{
"emails": [
{
"id": "email_id_1",
"status": "sent",
"created_at": "2023-10-27T10:00:00Z"
}
],
"pagination": {
"page": 1,
"per_page": 25,
"total_pages": 10
}
}
```
```
--------------------------------
### Get Subscription Status
Source: https://euromail.dev/docs/billing
Fetches the current subscription status for the account.
```APIDOC
## GET /v1/billing/subscription
### Description
Get the current account's subscription status.
### Method
GET
### Endpoint
/v1/billing/subscription
### Responses
#### Success Response (200)
- **Current subscription details** (object) - Details of the current subscription.
#### Error Response (401)
- **Unauthorized** - Indicates that the API key is invalid or missing.
### Request Example
```curl
curl -X GET https://api.euromail.dev/v1/billing/subscription \
-H "X-EuroMail-Api-Key: em_live_..."
```
```
--------------------------------
### Get Template by ID
Source: https://euromail.dev/docs/templates
Retrieves the details of a specific email template by its ID.
```APIDOC
## GET /v1/templates/{id}
### Description
Retrieves the details of a specific email template.
### Method
GET
### Endpoint
/v1/templates/{id}
### Path Parameters
- **id** (string) - Required - The ID of the template to retrieve
### Responses
#### Success Response (200)
- **template** (object) - The details of the requested template
#### Error Response (401)
- **message** (string) - Unauthorized
#### Error Response (404)
- **message** (string) - Template not found
```
--------------------------------
### Create a Sub-Account
Source: https://euromail.dev/docs/guides/sub-accounts
Use this endpoint to create a new sub-account. Requires 'name', 'email', 'password', and 'monthly_quota'. The API key must have the 'sub_accounts:manage' scope.
```bash
curl -X POST https://api.euromail.dev/v1/accounts \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Client A",
"email": "client-a@example.com",
"password": "securepassword123",
"monthly_quota": 5000
}'
```
--------------------------------
### Get Inbound Route
Source: https://euromail.dev/docs/guides/inbound-email
Retrieves the details of a specific inbound email route.
```APIDOC
## GET /v1/inbound-routes/{id}
### Description
Returns the details of a specific inbound email route.
### Method
GET
### Endpoint
/v1/inbound-routes/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - The unique identifier of the inbound route.
```
--------------------------------
### Get Contact List Detail
Source: https://euromail.dev/docs/contact-lists
Retrieves details for a specific contact list.
```APIDOC
## GET /v1/contact-lists/{id}
### Description
Retrieves detailed information about a specific contact list.
### Method
GET
### Endpoint
/v1/contact-lists/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - The unique identifier of the contact list.
### Request Example
```typescript
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.getContactListDetail("id_...");
```
```python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.get_contact_list_detail("id_...")
```
```rust
use euromail::EuroMail;
let client = EuroMail::new("em_live_...");
let result = client.get_contact_list_detail("id_...").await?;
```
```go
client := euromail.NewClient("em_live_...")
result, err := client.GetContactListDetail(ctx, "id_...")
```
```
--------------------------------
### List Audit Logs (Go SDK)
Source: https://euromail.dev/docs/audit
Create a new EuroMail client with your API key and invoke the ListAuditLogs method, passing a context.
```go
client := euromail.NewClient("em_live_...")
result, err := client.ListAuditLogs(ctx)
```
--------------------------------
### List Signup Forms (TypeScript)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail SDK for TypeScript to fetch a list of signup forms. Initialize the client with your API key.
```typescript
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.listSignupForms();
```
--------------------------------
### GET /v1/emails/{id}/links
Source: https://euromail.dev/docs/emails
Retrieves per-link click statistics for a specific email.
```APIDOC
## GET /v1/emails/{id}/links
### Description
GET /v1/emails/{id}/links - Per-link click statistics for an email
### Method
GET
### Endpoint
/v1/emails/{id}/links
### Parameters
#### Path Parameters
- **id** (string) - Required - The unique identifier of the email.
### Responses
#### Success Response (200)
- **links** (array) - An array of link statistics objects
#### Error Response (401)
- **message** (string) - Unauthorized
### Request Example
```
curl -X GET https://api.euromail.dev/v1/emails/email_id_1/links \
-H "X-EuroMail-Api-Key: em_live_..."
```
### Response Example
```json
{
"links": [
{
"url": "https://example.com/link1",
"clicks": 15
},
{
"url": "https://example.com/link2",
"clicks": 8
}
]
}
```
```
--------------------------------
### GET /v1/emails/{id}
Source: https://euromail.dev/docs/emails
Retrieves detailed information about a specific email, including its events.
```APIDOC
## GET /v1/emails/{id}
### Description
GET /v1/emails/:id - Get email details with events
### Method
GET
### Endpoint
/v1/emails/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - The unique identifier of the email.
### Responses
#### Success Response (200)
- **email** (object) - Detailed email object with events
#### Error Response (401)
- **message** (string) - Unauthorized
### Request Example
```
curl -X GET https://api.euromail.dev/v1/emails/email_id_1 \
-H "X-EuroMail-Api-Key: em_live_..."
```
### Response Example
```json
{
"email": {
"id": "email_id_1",
"status": "sent",
"created_at": "2023-10-27T10:00:00Z",
"events": [
{
"type": "sent",
"timestamp": "2023-10-27T10:01:00Z"
},
{
"type": "delivered",
"timestamp": "2023-10-27T10:02:00Z"
}
]
}
}
```
```
--------------------------------
### Get Single Inbound Email
Source: https://euromail.dev/docs/inbound
Retrieves a single inbound email by its unique ID.
```APIDOC
## GET /v1/inbound/{id}
### Description
Get a single inbound email by ID.
### Method
GET
### Endpoint
/v1/inbound/{id}
#### Path Parameters
- **id** (string) - Required - Inbound email ID
### Responses
#### Success Response (200)
- Inbound email details.
#### Error Response (401)
- Unauthorized
#### Error Response (404)
- Not found
```
--------------------------------
### Sending an Email with Template Variables
Source: https://euromail.dev/docs/guides/template-engine
Demonstrates how to send an email using a template and provide dynamic variables for substitution.
```APIDOC
## Sending an Email with Template Variables
Use this endpoint to send an email that will be rendered using a specified template and variables.
### Method
POST
### Endpoint
/send
### Request Body
- **from** (string) - Required - The sender's email address.
- **to** (string) - Required - The recipient's email address.
- **template_id** (string) - Required - The ID of the template to use.
- **variables** (object) - Optional - A key-value map of variables to be substituted into the template.
- **customer_name** (string) - Example variable.
- **order_id** (string) - Example variable.
### Request Example
```json
{
"from": "orders@yourdomain.com",
"to": "customer@example.com",
"template_id": "order-confirmation",
"variables": {
"customer_name": "Anna",
"order_id": "EM-20260309-4821"
}
}
```
### Response
#### Success Response (200)
- **message** (string) - Confirmation message.
- **email_id** (string) - The unique ID of the sent email.
#### Response Example
```json
{
"message": "Email sent successfully",
"email_id": "em_abc123xyz789"
}
```
```
--------------------------------
### Create a Signup Form
Source: https://euromail.dev/docs/guides/newsletters
Create an embeddable signup form for collecting newsletter subscribers. Ensure double opt-in is enabled for GDPR compliance.
```bash
curl -X POST https://api.euromail.dev/v1/contact-lists/{list_id}/forms \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Blog Newsletter",
"double_optin": true,
"redirect_url": "https://yoursite.com/thanks"
}'
```
--------------------------------
### Get Inbound Route by ID
Source: https://euromail.dev/docs/guides/inbound-email
Retrieves details for a specific inbound route using its ID.
```http
GET /v1/inbound-routes/{id}
```
--------------------------------
### Get Contacts in List
Source: https://euromail.dev/docs/contact-lists
Retrieves a paginated list of contacts within a specific contact list.
```APIDOC
## GET /v1/contact-lists/{id}/contacts
### Description
Retrieves a paginated list of contacts within a specific contact list.
### Method
GET
### Endpoint
/v1/contact-lists/{id}/contacts
### Parameters
#### Path Parameters
- **id** (string) - Required - Contact list ID
#### Query Parameters
- **page** (integer) - Optional - Page number (default: 1)
- **per_page** (integer) - Optional - Items per page
- **status** (string) - Optional - Filter by status
### Responses
#### Success Response (200)
- **contacts** (array) - A list of contacts.
- **pagination** (object) - Pagination details.
- **total** (integer) - Total number of items.
- **per_page** (integer) - Items per page.
- **current_page** (integer) - Current page number.
- **last_page** (integer) - Last page number.
- **next_page_url** (string) - URL for the next page.
- **prev_page_url** (string) - URL for the previous page.
#### Error Response (401)
- Description: Unauthorized
#### Error Response (404)
- Description: Contact list not found
```
--------------------------------
### Get Webhook Details
Source: https://euromail.dev/docs/webhooks
Retrieve the details of a specific webhook by its ID. Returns 404 if the webhook is not found.
```cURL
curl -X GET https://api.euromail.dev/v1/webhooks/{id} \
-H "X-EuroMail-Api-Key: em_live_..."
```
```TypeScript
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.getWebhook("id_...");
```
```Python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.get_webhook("id_...")
```
```Rust
use euromail::EuroMail;
let client = EuroMail::new("em_live_...");
let result = client.get_webhook("id_...").await?;
```
```Go
client := euromail.NewClient("em_live_...")
result, err := client.GetWebhook(ctx, "id_...")
```
--------------------------------
### Configure Vanity Tracking Domain
Source: https://euromail.dev/docs/guides/domain-verification
Set up a CNAME record to use a custom subdomain for tracking links and unsubscribe pages. Then, configure it via the API.
```dns
em.yourdomain.com. CNAME tracking.euromail.dev.
```
```bash
curl -X PUT https://api.euromail.dev/v1/domains/{domain_id}/tracking-domain \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{"tracking_domain": "em.yourdomain.com"}'
```
--------------------------------
### List Signup Forms (Python)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail Python client to retrieve a list of signup forms. Instantiate the client with your API key.
```python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.list_signup_forms()
```
--------------------------------
### Get Inbound Email
Source: https://euromail.dev/docs/guides/inbound-email
Retrieves the full details of a specific inbound email, including its body and attachments.
```APIDOC
## GET /v1/inbound/{id}
### Description
Returns the full inbound email including text body, HTML body, raw headers, and attachment metadata.
### Method
GET
### Endpoint
/v1/inbound/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - The unique identifier of the inbound email.
```
--------------------------------
### Get Domain Details
Source: https://euromail.dev/docs/domains
Retrieve details for a specific domain using its ID. Requires an API key.
```curl
curl -X GET https://api.euromail.dev/v1/domains/{id} \
-H "X-EuroMail-Api-Key: em_live_..."
```
```typescript
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.getDomain("id_...");
```
```python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.get_domain("id_...")
```
```rust
use euromail::EuroMail;
let client = EuroMail::new("em_live_...");
let result = client.get_domain("id_...").await?;
```
```go
client := euromail.NewClient("em_live_...")
result, err := client.GetDomain(ctx, "id_...")
```
--------------------------------
### List Signup Forms
Source: https://euromail.dev/docs/signup-forms
Retrieves a list of all available signup forms.
```APIDOC
## GET /v1/signup-forms
### Description
Retrieves a list of all available signup forms.
### Method
GET
### Endpoint
/v1/signup-forms
### Responses
#### Success Response (200)
- **signup_forms** (array) - List of signup forms
#### Error Response (401)
- **Unauthorized**
### Request Example
```curl
curl -X GET https://api.euromail.dev/v1/signup-forms \
-H "X-EuroMail-Api-Key: em_live_..."
```
### Response Example
```json
{
"signup_forms": [
{
"id": "form_abc123",
"title": "Newsletter Signup",
"list_id": "list_xyz789",
"created_at": "2023-10-27T10:00:00Z",
"updated_at": "2023-10-27T10:00:00Z"
}
]
}
```
```
--------------------------------
### Create Signup Form (Rust)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail Rust SDK to create a signup form. Pass the list ID and title. The `CreateSignupFormParams` struct allows for additional optional parameters.
```rust
use euromail::EuroMail;
let client = EuroMail::new("em_live_...");
let result = client.create_signup_form(&CreateSignupFormParams {
list_id: "...".into(),
title: "...".into(),
..Default::default()
}).await?;
```
--------------------------------
### Create Contact List
Source: https://euromail.dev/docs/contact-lists
Create a new contact list. The `name` field is required. Optional fields include `description` and `double_opt_in`.
```curl
curl -X POST https://api.euromail.dev/v1/contact-lists \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{ "name": "example.com" }'
```
```typescript
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.createContactList({
name: "example.com",
});
```
```python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.create_contact_list(
name="example.com",
)
```
```rust
use euromail::EuroMail;
let client = EuroMail::new("em_live_...");
let result = client.create_contact_list(&CreateContactListParams {
name: "example.com".into(),
..Default::default()
}).await?;
```
```go
client := euromail.NewClient("em_live_...")
result, err := client.CreateContactList(ctx, euromail.CreateContactListParams{
Name: "example.com",
})
```
--------------------------------
### Get Contact List Details
Source: https://euromail.dev/docs/contact-lists
Retrieves detailed information about a specific contact list, including its contact count.
```APIDOC
## GET /v1/contact-lists/{id}
### Description
Retrieves details for a specific contact list, including its contact count.
### Method
GET
### Endpoint
/v1/contact-lists/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - The unique identifier of the contact list.
### Responses
#### Success Response (200)
- **contact_list** (object) - An object containing the details of the contact list.
#### Error Responses
- **401** - Unauthorized access.
- **404** - The specified contact list was not found.
```
--------------------------------
### Create API Key for Sub-Account
Source: https://euromail.dev/docs/guides/sub-accounts
Use this endpoint to create a new API key for a specific sub-account. The full key is returned only once upon creation, so store it securely. The `scopes` parameter is optional; if omitted, the key will have full access.
```bash
curl -X POST https://api.euromail.dev/v1/accounts/{id}/api-keys \
-H "X-EuroMail-Api-Key: em_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Client A Production Key",
"scopes": ["emails:send", "emails:read"]
}'
```
```json
{
"data": {
"id": "660e8400-e29b-41d4-a716-446655440000",
"name": "Client A Production Key",
"key": "em_prod_abc123...",
"key_prefix": "em_prod_abc1",
"scopes": ["emails:send", "emails:read"],
"is_active": true,
"created_at": "2026-03-21T10:05:00Z"
}
}
```
--------------------------------
### GET /v1/analytics/timeseries
Source: https://euromail.dev/docs/analytics
Fetches daily analytics data points over time, suitable for generating charts and trend analysis.
```APIDOC
## GET /v1/analytics/timeseries
### Description
Returns daily stats over time for charting.
### Method
GET
### Endpoint
/v1/analytics/timeseries
### Parameters
#### Query Parameters
- **period** (string) - Optional - Period shorthand: 7d, 30d, 90d
- **from** (string) - Optional - Start date
- **to** (string) - Optional - End date
- **metrics** (string) - Optional - Comma-separated: sent,delivered,bounced,opens,clicks
### Responses
#### Success Response (200)
- **Timeseries data points**
#### Error Responses
- **400** - Invalid parameters
- **401** - Unauthorized
```
--------------------------------
### GET /v1/analytics/export
Source: https://euromail.dev/docs/analytics
Exports daily analytics data in CSV format for download. Ideal for offline analysis and reporting.
```APIDOC
## GET /v1/analytics/export
### Description
Export daily analytics as CSV download.
### Method
GET
### Endpoint
/v1/analytics/export
### Parameters
#### Query Parameters
- **period** (string) - Optional - Period shorthand: 7d, 30d, 90d
- **from** (string) - Optional - Start date
- **to** (string) - Optional - End date
### Responses
#### Success Response (200)
- **CSV file download**
#### Error Responses
- **400** - Invalid parameters
- **401** - Unauthorized
```
--------------------------------
### Trigger Insights Generation (Go)
Source: https://euromail.dev/docs/insights
Create a new EuroMail client with your API key and invoke the `CreateInsight` method. This function requires a context and returns a result and an error.
```go
client := euromail.NewClient("em_live_...")
result, err := client.CreateInsight(ctx)
```
--------------------------------
### GET /v1/domains
Source: https://euromail.dev/docs/domains
Retrieves a paginated list of registered domains. Supports filtering by page number and items per page.
```APIDOC
## GET /v1/domains
### Description
Retrieves a paginated list of registered domains.
### Method
GET
### Endpoint
/v1/domains
#### Query Parameters
- **page** (integer) - Optional - Page number (default: 1)
- **per_page** (integer) - Optional - Items per page (default: 25)
#### Responses
- **200** - Paginated list of registered domains
- **401** - Unauthorized
### Request Example
```
curl -X GET https://api.euromail.dev/v1/domains \
-H "X-EuroMail-Api-Key: em_live_..."
```
```
--------------------------------
### Create a Contact List
Source: https://euromail.dev/docs/guides/newsletters
Organize subscribers into contact lists. Each list has its own signup form, unsubscribe handling, and sending history.
```APIDOC
## POST /v1/contact-lists
### Description
Creates a new contact list to organize subscribers.
### Method
POST
### Endpoint
/v1/contact-lists
### Request Body
- **name** (string) - Required - The name of the contact list.
- **description** (string) - Optional - A description for the contact list.
```
--------------------------------
### GET /v1/account/export
Source: https://euromail.dev/docs/account
Generates a JSON export of all account data, excluding email bodies. This endpoint is rate-limited to once per hour.
```APIDOC
## GET /v1/account/export
### Description
GDPR data export. Returns a JSON export of all account data (no email bodies). Rate limited to 1 per hour via Redis key.
### Method
GET
### Endpoint
/v1/account/export
### Responses
#### Success Response (200)
- GDPR data export
#### Error Response (401)
- Unauthorized
#### Error Response (429)
- Export rate limited (1 per hour)
### Request Example
```curl
curl -X GET https://api.euromail.dev/v1/account/export \
-H "X-EuroMail-Api-Key: em_live_..."
```
```
--------------------------------
### Create Signup Form (Python)
Source: https://euromail.dev/docs/signup-forms
Use the EuroMail Python client to create a signup form. Specify the list ID and title. The client handles API key authentication.
```python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.create_signup_form(
list_id="...",
title="...",
)
```
--------------------------------
### Trigger DNS Verification
Source: https://euromail.dev/docs/domains
Initiates the DNS verification process for a given domain ID to confirm ownership and proper setup.
```APIDOC
## POST `/v1/domains/{id}/verify`
### Description
Trigger DNS verification
### Method
POST
### Endpoint
`/v1/domains/{id}/verify`
### Parameters
#### Path Parameters
- **id** (string) - Required - Domain ID
### Responses
#### Success Response (200)
- DNS verification results
#### Error Responses
- **401** Unauthorized
- **404** Domain not found
```
--------------------------------
### Get Email Template by ID
Source: https://euromail.dev/docs/templates
Retrieve details for a specific email template using its ID. Returns 404 if the template is not found.
```cURL
curl -X GET https://api.euromail.dev/v1/templates/{id} \
-H "X-EuroMail-Api-Key: em_live_..."
```
```TypeScript
import { EuroMail } from "@euromail/sdk";
const euromail = new EuroMail({ apiKey: "em_live_..." });
const result = await euromail.getTemplate("id_...");
```
```Python
from euromail import EuroMail
client = EuroMail(api_key="em_live_...")
result = client.get_template("id_...")
```
```Rust
use euromail::EuroMail;
let client = EuroMail::new("em_live_...");
let result = client.get_template("id_...").await?;
```
```Go
client := euromail.NewClient("em_live_...")
result, err := client.GetTemplate(ctx, "id_...")
```
--------------------------------
### Get Next Message
Source: https://euromail.dev/docs/guides/agent-mailboxes
Retrieves the next available message from the mailbox with a lease. This is the primary method for agents to fetch messages for processing.
```APIDOC
## GET /messages/next
### Description
Retrieves the next available message from the mailbox and acquires a lease for it. This endpoint is designed for long polling.
### Method
GET
### Endpoint
/v1/agent-mailboxes/{id}/messages/next
### Parameters
#### Path Parameters
- **id** (string) - Required - The ID of the mailbox.
#### Query Parameters
- **timeout** (integer) - Optional - The maximum time in seconds to wait for a message. If no message is available within this time, a `408 Request Timeout` is returned.
### Response
#### Success Response (200)
- **data** (object) - The message content and metadata.
- **lease_token** (string) - The token for the acquired lease, required for acknowledging or negatively acknowledging the message.
### Response Example
{
"data": {
"id": "msg_123",
"body": "message content",
"created_at": "2023-10-27T10:00:00Z"
},
"lease_token": "lease_abc"
}
#### Error Response (408 Request Timeout)
Returned when the `timeout` expires and no message is available.
```