Send an Email
Send an email to a recipient.
POST https://api.notifiedby.com/v1/email/send/
Request Body:
{
"recipient": "user@example.com",
"subject": "Welcome!",
"body": "<h1>Hello</h1><p>Welcome to our service.</p>",
"plain_body": "Hello. Welcome to our service.",
"reply_to": "support@example.com",
"reply_to_name": "Support Team",
"first_name": "John",
"last_name": "Doe",
"flags": ["new_user"],
"use_account_template": true
}
Field |
Required |
Description |
|---|---|---|
recipient |
Yes |
The recipient’s email address. |
subject |
Yes |
The email subject line. |
body |
Yes |
The HTML email body. |
plain_body |
No |
A plain text version of the email body. |
reply_to |
No |
A single reply-to email address for this email. Defaults to the sender’s reply-to settings. |
reply_to_name |
No |
An optional display name for the |
first_name |
No |
The recipient’s first name. Stored on the recipient record. |
last_name |
No |
The recipient’s last name. Stored on the recipient record. |
flags |
No |
A list of flags to set on the recipient. Can also be a comma-separated string. |
use_account_template |
No |
Whether to wrap the body in the sender’s account template. Defaults to |
File attachments can be included when sending as multipart form data using the attachment field.
Multiple files can be attached by including the field more than once.
Reply-to overrides:
Use reply_to to direct replies to a different address for an individual email
without changing the sender’s settings or the email’s From address. Supply one
bare email address, such as support@example.com, with a maximum length of
254 characters. Address lists and combined name/address values such as
Support <support@example.com> are not accepted; use reply_to_name for
the display name instead.
If reply_to is omitted, blank, or JSON null, the sender’s configured
reply-to address and name are used. If the sender has no reply-to address, no
Reply-To header is added. reply_to_name only applies when a non-blank
reply_to override is supplied. When overriding the address, omitting the
name, leaving it blank, or setting it to JSON null sends the address alone.
Leading and trailing spaces are trimmed from both fields. Control characters, including newlines, are rejected in either field. Invalid addresses or names return HTTP 400 with an error under the corresponding field name.
Success Response (200):
{
"id": "JDT"
}
The id is a unique identifier for the sent email that can be used with the
Get Email Detail and List Emails endpoints.
Blocked Recipient Response (200):
If the recipient has been blocked, the email will not be delivered:
{
"id": "JDT",
"error": "Recipient is blocked"
}
Error Responses:
Missing or invalid API key:
{"detail": "Authentication credentials were not provided."}
Missing required fields (400):
{"recipient": ["This field is required."]}
{"subject": ["This field is required."]}
{"body": ["This field is required."]}
Invalid reply-to address or name (400), for example:
{"reply_to": ["Enter a valid email address."]}
{"reply_to_name": ["Reply-to name must be at most 100 characters."]}
Rate limit exceeded (429):
{"error": "Daily limit of 100 emails has been reached"}
Example with curl (JSON):
curl -X POST https://api.notifiedby.com/v1/email/send/ \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"recipient": "user@example.com", "subject": "Welcome!", "body": "<h1>Hello</h1>", "reply_to": "support@example.com", "reply_to_name": "Support Team"}'
Example with curl (form data):
curl -X POST https://api.notifiedby.com/v1/email/send/ \
-H "Authorization: Api-Key YOUR_API_KEY" \
--form 'recipient="user@example.com"' \
--form 'subject="Welcome!"' \
--form 'body="<h1>Hello</h1>"' \
--form 'plain_body="Hello"' \
--form 'reply_to="support@example.com"' \
--form 'reply_to_name="Support Team"'
Example with encryption key:
curl -X POST https://api.notifiedby.com/v1/email/send/ \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Encryption-Key: my-encryption-key" \
-H "Content-Type: application/json" \
-d '{"recipient": "user@example.com", "subject": "Welcome!", "body": "<h1>Hello</h1>"}'
Note
If your sender has Development Mode enabled, emails will be redirected to the development
recipient address configured on the sender, regardless of the recipient value provided.