Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.antryk.com/llms.txt

Use this file to discover all available pages before exploring further.

Send emails using Antryk Email Service with a secure, scalable, and developer-friendly API. This endpoint allows you to send transactional emails, OTPs, notifications, or bulk emails by providing recipient details, subject, and content. Authentication is handled via headers, making the request more secure and aligned with modern API standards.
curl --request POST \
  --url https://ses.antryk.com/api/v1/email/send \
  --header "Content-Type: application/json" \
  --header "x-access-key: YOUR_ACCESS_KEY" \
  --header "x-secret-key: YOUR_SECRET_KEY" \
  --data '{
    "from": "admin@example.com",
    "to": ["ds1@gmail.com", "ds2@gmail.com"],
    "subject": "Otp For Antryk Sign up",
    "html": "<h1>Welcome</h1><p>Your OTP code: 123456</p>",
    "replyTo": "support@example.com",
    "attachments": [
      {
        "filename": "invoice.pdf",
        "content": "<base64-encoded-content>"
      }
    ]
  }'
For Node.js applications, it is recommended to use the official @antryk/sdk. The SDK simplifies email sending by handling authentication, validation, and error handling internally.
Authentication is handled via headers (x-access-key, x-secret-key). The request body should only contain email-related fields such as sender, recipient, subject, and content.
This is the recommended and modern approach for sending emails:
  • Authentication is passed via headers instead of request body.
  • Request body contains only email-related fields.
  • Cleaner, more secure, and easier to maintain.
⚠️ The older approach (sending accessKey and secretKey in the body) may still work for backward compatibility, but it is strongly recommended to migrate to header-based authentication.

Request Parameters

x-access-key
string
required
Your Antryk access key used for authentication.
x-secret-key
string
required
Your Antryk secret key used for authentication.
from
string
required
The sender’s email address.
to
string | array
required
The recipient’s email address. Can be a single email or an array for multiple recipients.
subject
string
required
The subject line of the email.
html
string
The HTML content of the email body.
text
string
Plain text version of the email body (fallback if HTML is not supported).
replyTo
string
Optional reply-to email address. Useful for directing responses to a support or no-reply inbox.
attachments
array
Optional list of attachments. Each item must include: - filename: Name of the file - content: Base64-encoded file content
You can send emails to multiple recipients by passing an array in the to field: ["user1@example.com", "user2@example.com"]
Either html or text must be provided when sending an email. At least one is required.

Examples

x-access-key
string
required
Example: YOUR_ACCESS_KEY
x-secret-key
string
required
Example: YOUR_SECRET_KEY
from
string
required
Example: admin@example.com
to
string | array
required
Example: ds1@gmail.com or ["ds1@gmail.com", "ds2@gmail.com"]
subject
string
required
Example: Otp For Antryk Sign up
html
string
Example: <h1>Welcome to Antryk</h1><p>This is your OTP code: 123456</p>
text
string
Example: Welcome to Antryk. This is your OTP code: 123456
replyTo
string
Example: support@example.com
attachments
array
Example: [{"filename": "invoice.pdf", "content": "<base64>"}]

Additional Notes Supports transactional emails, OTP delivery, and bulk

messaging. Attachments must be base64 encoded before sending. Ensure proper email formatting to improve deliverability. Avoid exposing API keys in frontend applications. SDK usage is recommended for better error handling and validation.

Response

Returns a JSON object confirming the email was sent successfully.
{
  "success": true,
  "messageId": "msg_123456",
  "to": "ds1@gmail.com",
  "subject": "Otp For Antryk Sign up"
}