Base URL: https://<host>/ (пример: http://localhost:5000). Соглашения, обзор Public API, Swagger UI.
Расширенный пример отправки с шаблоном и idempotency. Базовое описание полей — на POST /send.
POST /api/v1/mail/send HTTP/1.1
X-API-Key: csk_live_xxxxxxxx
Content-Type: application/json
ключ идемпотентности: 550e8400-e29b-41d4-a716-446655440000
{
"to": ["user@example.com"],
"subject": "Welcome",
"template": "welcome",
"variables": { "name": "Alex" },
"sync": false
}
| Заголовок | Обяз. | Описание |
|---|---|---|
X-API-Key | да | Ключ с scope mail:send |
Content-Type | да | application/json |
{
"to": ["user@example.com"],
"subject": "Welcome",
"template": "welcome",
"variables": { "name": "Alex" },
"sync": false
}
{
"success": true,
"data": {
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"sync": false,
"recipient_count": 1
}
}
{
"success": false,
"error": {
"code": "mail_not_configured",
"message": "Mail is not configured"
}
}
curl -X POST http://localhost:5000/api/v1/mail/send \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":["user@example.com"],"subject":"Welcome","template":"welcome","variables":{"name":"Alex"},"sync":false}'
См. также: POST /send.