POSThttps://api.relayara.com/v1/emails
Send an email
Queues a single message. The response is returned once the message is accepted and persisted, which is before the provider has seen it. Delivery is reported through webhooks and through the retrieve endpoint.
A sending_only key is enough for this endpoint.
Headers
Idempotency-KeystringOptional
Optional. Repeating a request with the same key within 24 hours returns the identifier of the original message and sends nothing further. A key reused with a different body is rejected.
1 to 256 characters
Request body
fromstringRequired
3 to 384 characters
subjectstringRequired
at most 998 characters
tostring | string[]Required
3 to 384 characters, 1 to 50 entries
ccstring | string[]Optional
3 to 384 characters, 1 to 50 entries
bccstring | string[]Optional
3 to 384 characters, 1 to 50 entries
reply_tostring | string[]Optional
3 to 384 characters, 1 to 50 entries
htmlstringOptional
at most 2000000 characters
textstringOptional
at most 2000000 characters
headersobjectOptional
any key, values are string, each value at most 998 characters
attachmentsobject[]Optional
at most 20 entries
filenamestringRequired
1 to 255 characters
contentstringOptional
base64 encoded
pathstringOptional
format uri
content_typestringOptional
1 to 78 characters
content_idstringOptional
1 to 78 characters
tagsobject[]Optional
at most 10 entries
namestringRequired
matches ^[A-Za-z0-9_-]{1,256}$
valuestringRequired
matches ^[A-Za-z0-9_-]{1,256}$
scheduled_atstringOptional
format date-time
Example
curl -X POST https://api.relayara.com/v1/emails \
-H "Authorization: Bearer $RELAYARA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "Acme <[email protected]>",
"subject": "Your receipt from Acme",
"to": "[email protected]",
"html": "<p>Thanks for your order.</p>"
}'Response 200
Message accepted.
idstringRequired
Errors
- 400
invalid_idempotency_keyvalidation_error - 401
missing_api_key - 403
account_suspendeddomain_not_verifiedexpired_api_keyinvalid_api_key - 409
concurrent_idempotent_requestsinvalid_idempotent_request - 422
invalid_attachmentrecipient_suppressed - 429
daily_quota_exceededmonthly_quota_exceededrate_limit_exceeded - 500
internal_error