Domains
Manage the email domains that MXHook accepts mail for.
List Domains
GET /domains
Returns all registered domains.
Response 200 OK
json
[
{
"id": "d-1710806400",
"name": "yourdomain.com",
"created_at": "2025-03-19T00:00:00Z"
}
]Create Domain
POST /domains
Register a new domain.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The domain name (e.g., yourdomain.com) |
json
{
"name": "yourdomain.com"
}Response 201 Created
json
{
"id": "d-1710806400",
"name": "yourdomain.com",
"created_at": "2025-03-19T00:00:00Z"
}Errors
| Status | Reason |
|---|---|
400 | Missing or empty name field |
401 | Invalid or missing API key |
Delete Domain
DELETE /domains/{id}
Remove a registered domain.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Domain ID |
Response 204 No Content
Errors
| Status | Reason |
|---|---|
401 | Invalid or missing API key |
404 | Domain not found |
Domain Object
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier (format: d-{timestamp}) |
name | string | Domain name |
created_at | string (ISO 8601) | Creation timestamp |