REST API · v1

API documentation

Connect one or more SMTP senders, then send transactional email from any application through a stable HTTPS contract. This guide covers setup, authentication, requests, errors, rotation, and operational safety.

Base URL
https://easymail-nu.vercel.app
Endpoint
POST /api/v1/emails
Authentication
Bearer API key

Start here

Quickstart

Complete these steps in order. The full setup normally takes only a few minutes.

01
Create a workspace
Register, name your personal or organization workspace, and keep it active.
02
Connect an SMTP sender
Choose Gmail, Yahoo, Zoho, Amazon SES, or authenticated custom SMTP and follow its provider-specific setup.
03
Create an API key and assign its SMTP sender
Copy the secret immediately and store it outside your source code.

Sender setup

Create provider credentials

The platform sends through the sender you select. Use the exact credential type required by that provider: an app password, an SMTP username/password pair, or OAuth where supported.

Gmail and Google Workspace mailbox
Enable Google 2-Step Verification, create a 16-character App Password, and choose Gmail in the sender wizard. Use the complete Google mailbox as the username. EasyMail removes display spaces from the App Password before encrypting it. Google Workspace administrators may alternatively operate an IP-authenticated SMTP relay, but that relay mode is not supported by EasyMail's authenticated sender connection.
Yahoo Mail
Open Yahoo Account Security → External connections, generate a third-party app password, then choose Yahoo in the wizard. Use the complete Yahoo address as the SMTP username and the generated app password—not the normal account password.
Zoho Mail
Choose the personal/free profile for smtp.zoho.com or the paid organization profile for smtppro.zoho.com. Use the complete mailbox address. A normal account password can work when TFA is off; when TFA or SAML is enabled, create and use a Zoho application-specific password.
Amazon SES SMTP
In the SES console, choose the same AWS Region used in EasyMail and create SMTP credentials. SES SMTP usernames and passwords are region-specific and are different from AWS access keys. Verify the From identity or domain in that region before sending.
Microsoft 365
Microsoft Exchange Online requires Modern Authentication (OAuth 2.0) for dependable SMTP AUTH integrations; app passwords and ordinary mailbox passwords are not a supported replacement for OAuth. EasyMail therefore disables Microsoft 365 in the password-based sender wizard until its interactive OAuth connection is available.
Other SMTP providers
Ask the provider for its authenticated outbound SMTP host, username, password or app-specific password, port, and encryption mode. Use port 465 with SSL/TLS or port 587 with STARTTLS. EasyMail verifies the connection before encrypting the credential and does not support anonymous or IP-allowlisted relays.

Identity

Authentication

Programmatic sending requires two setup items: a verified SMTP sender and an organization-owned API key bound to that sender. Your request sends the key, and the platform securely resolves the sender. Dashboard playground sends only require selecting the saved sender.

Authorization: Bearer $EASYMAIL_API_KEY

You may alternatively send the same secret in the x-api-key header. Bearer authentication is recommended because it works consistently with proxies and standard HTTP clients.

Endpoint

Send an email

Send JSON to POST /api/v1/emails. The configured workspace sender controls the From address.

curl https://easymail-nu.vercel.app/api/v1/emails \
  -H "Authorization: Bearer $EASYMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: receipt-order-9382" \
  -d '{
    "to": "customer@gmail.com",
    "cc": ["finance@gmail.com"],
    "subject": "Your receipt",
    "text": "Thanks for your order.",
    "html": "<h1>Your receipt</h1><p>Thanks for your order.</p>",
    "attachments": [{"filename":"receipt.pdf","content":"BASE64_FILE_CONTENT","contentType":"application/pdf"}]
  }'

Schema

Request fields

Unknown fields are rejected, preventing accidental From-address spoofing or unsupported Nodemailer options.

FieldTypeRequirementDescription
senderIdUUIDOptionalConfirm the sender assigned to the API key. The key's sender is always used when omitted.
tostring | string[]RequiredOne address or an array of up to 50 valid email addresses.
subjectstringRequiredMessage subject between 1 and 200 characters.
textstringConditionalPlain-text body. Either text or html must be present.
htmlstringConditionalHTML body. Either html or text must be present.
ccstring[]OptionalUp to 20 carbon-copy recipients.
bccstring[]OptionalUp to 20 blind-carbon-copy recipients.
replyTostringOptionalAddress that receives replies.
attachmentsAttachment[]OptionalUp to 3 files. Send base64 content with a filename and optional contentType; total request size is 4.5 MB.

Safe retries

Idempotency

Use a stable Idempotency-Key whenever your application might retry a send after a timeout or temporary network failure.

Idempotency-Key: order-9382-receipt
Good keys
Use a business event identifier such as password-reset-user-42-attempt-1.
Scope
Keys are unique within a workspace and may contain up to 200 characters.

Contract

Success responses

Responses include the delivery record and a request ID for tracing.

{
  "data": {
    "id": "44df90ce-...",
    "status": "sent",
    "messageId": "<provider-message-id@gmail.com>",
    "accepted": ["customer@gmail.com"],
    "rejected": [],
    "duplicate": false
  },
  "requestId": "12d4139c-..."
}

The same request ID is also returned in the x-request-id response header.

Check request status

Call GET /api/v1/emails/{id} with the same API-key header. A status of accepted means the SMTP provider accepted at least one recipient; it does not guarantee inbox placement or that the recipient opened the message.

curl https://easymail-nu.vercel.app/api/v1/emails/44df90ce-... \
  -H "Authorization: Bearer $EASYMAIL_API_KEY"

Recovery

Errors

Error codes are stable and safe to use in application logic. Human messages may become clearer over time.

StatusCodeMeaning
400INVALID_JSONThe request body is not valid JSON.
401API_KEY_REQUIREDNo API key was supplied.
401INVALID_API_KEYThe key is invalid, revoked, or expired.
409SMTP_NOT_CONFIGUREDThe workspace has no matching SMTP sender.
413PAYLOAD_TOO_LARGEThe request exceeds 4.5 MB.
415UNSUPPORTED_MEDIA_TYPEContent-Type is not application/json.
422VALIDATION_ERROROne or more request fields are invalid.
502DELIVERY_FAILEDThe SMTP provider did not accept the message.
{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The API key is invalid or expired",
    "requestId": "12d4139c-..."
  }
}

Boundaries

Limits and timeouts

These defaults keep delivery predictable and protect every workspace from accidental overload.

Request body
256 KB
To recipients
50
CC / BCC
20 each
Default rate
60 / minute

The endpoint has a 30-second execution budget. Treat 502 responses and client-side timeouts as retryable only when you also supplied an idempotency key.

Credential lifecycle

Rotate an API key

Rotation creates a replacement and revokes the selected key. Plan the change so applications do not lose access.

  1. 1

    Open Dashboard → API keys and identify the key used by your application.

  2. 2

    Select Rotate, then immediately copy the replacement secret.

  3. 3

    Update the secret in your deployment platform or secret manager.

  4. 4

    Redeploy or restart the application and verify a test email.

Operations

Security guidance

easymail protects credentials at the platform boundary, while your application must protect its API key.

Keep API keys in a managed secret store, never source control.
Use separate keys for development, staging, and production.
Rotate immediately after suspected exposure or staff changes.
Never log Authorization, x-api-key, or SMTP passwords.
Use idempotency keys for user-visible or financial messages.
Review provider activity and rotate unused SMTP credentials.

Help

Troubleshooting

Start with the response code and request ID, then work through the matching check.

SMTP_NOT_CONFIGURED
Connect a verified SMTP sender and create or rotate a key associated with it.
DELIVERY_FAILED
Confirm the SMTP host, port, security mode, username, and password are current.
INVALID_API_KEY
Confirm the complete secret is deployed without whitespace and has not been rotated.
Duplicate response
Your Idempotency-Key was already used. Generate a new key only for a genuinely new email event.
Client timeout
Retry with the same Idempotency-Key, then use the returned request ID for investigation.