Send transactional email
POST/v1/public/emails
Accepts one transactional email and returns 202 only after it is stored with everything needed for sending. to is one email for all its recipients (they see each other), not a batch. Content is either html/text or a template (templateId or templateAlias). Without keyId the default sending key of the from domain is used. Recipients suppressed by the sending key (unsubscribed, complained) or rejected by the RuSender undeliverable list are returned with their status and are not charged; if no to recipient can receive the email, it is rejected with 422 and copies are not sent. The X-Quota-Remaining response header contains the remaining quota at the commit of this request (on replay - of the original request). Use Idempotency-Key for safe retries: a 402 response releases the key, so a retry passes after the balance is topped up.
Request
Responses
- 202
- 400
- 401
- 402
- 403
- 404
- 409
- 413
- 422
- 429
- 500
- 503
The email is accepted and queued for sending.
Response Headers
Indicates that the response was returned from idempotency replay instead of being executed again.
Remaining email quota after this send was committed (for a replay, after the original one). Parallel sends may reduce it before you read the header.
Invalid request: BAD_REQUEST (body format and limits, details[] per field), HEADER_NOT_ALLOWED, ATTACHMENT_TOO_LARGE, ATTACHMENT_TYPE_FORBIDDEN, ATTACHMENT_COUNT_EXCEEDED, INVALID_IDEMPOTENCY_KEY.
A valid Public API token is required.
PAYMENT_REQUIRED: not enough email quota. X-Quota-Remaining shows the current balance. Not stored for idempotency: a retry with the same key runs again after a top-up.
Response Headers
Remaining email quota after this send was committed (for a replay, after the original one). Parallel sends may reduce it before you read the header.
The endpoint requires a scope that is not granted to the token.
Not found: SENDING_KEY_NOT_FOUND, SENDING_KEY_DOMAIN_NOT_FOUND, TEMPLATE_NOT_FOUND.
Conflict: SENDER_DOMAIN_BLOCKED, IDEMPOTENCY_KEY_REUSED_WITH_DIFFERENT_PAYLOAD, REQUEST_ALREADY_IN_PROGRESS (with Retry-After).
Response Headers
Number of seconds after which the request may be retried safely.
PAYLOAD_TOO_LARGE: the request body exceeds 32 MB.
Cannot be accepted: RECIPIENT_BOUNCED, RECIPIENT_SUPPRESSED (no to recipient can receive the email; details[] lists rejected addresses), SENDING_KEY_NOT_ACTIVE, SENDING_KEY_DEFAULT_NOT_CONFIGURED, SENDING_KEY_DOMAIN_NOT_VERIFIED, SENDER_DOMAIN_MISMATCH, ATTACHMENT_NOT_FOUND, TEMPLATE_SYNTAX_ERROR, CONTENT_SYNTAX_ERROR.
The current API key exceeded the configured rate limit.
Response Headers
Number of seconds after which the request may be retried safely.
Internal server error.
SERVICE_UNAVAILABLE: storage, database or a dependency is temporarily unavailable; nothing was accepted or charged. Retry with the same Idempotency-Key.