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.",
    "first_name": "John",
    "last_name": "Doe",
    "flags": ["new_user"]
}

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.

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.

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.

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."]}

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>"}'

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"'

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.