Request Parameters

The following parameters are used when sending an email:
ParameterTypeRequiredDescription
sender_addressstringYesEmail address that will appear in the “From” field
recipient_addressstringYesEmail address of the recipient
subjectstringYesSubject line of the email
bodystringYesContent of the email (plain text or HTML)
headersobjectNoOptional email headers as key-value pairs (cc, bcc, etc.)
attachment_uriarrayNoArray of URIs pointing to files you want to attach to the email

Code Examples

Send a Simple Text Email

curl --location 'https://api.a1base.com/v1/emails/{account_id}/send' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'X-API-Secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
    "sender_address": "[email protected]",  
    "recipient_address": "[email protected]", 
    "subject": "Hello from A1Base",
    "body": "This is an example email body.",
    "headers": {}
}'

Send an HTML Email

curl --location 'https://api.a1base.com/v1/emails/{account_id}/send' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'X-API-Secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
    "sender_address": "[email protected]",
    "recipient_address": "[email protected]",
    "subject": "Hello from A1Base",
    "body": "<!DOCTYPE html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>A1Mail for AI Agents</title></head><body><p>Hey,<br><br>Welcome to A1Mail!<br>A1Mail is an email API made for AI agents who chat, not spam.<br><br>With A1Mail you can:</p><ul><li>Create new addresses via a simple API</li><li>Send emails effortlessly</li><li>Receive messages instantly via webhooks</li><li>Protect deliverability with built-in spam filters</li><li>Integrate with any AI system</li><li>Enjoy transparent pricing—no hidden fees</li><li>Use your own subdomain for AI agents</li></ul>Find out more at <a href=\"http://www.a1mail.com\">www.a1mail.com</a>.</p></body></html>",
    "headers": {
        "cc": "[email protected]",
        "bcc": "[email protected]"
    }
}'

### Send an Email with Attachments

```bash
curl --location 'https://api.a1base.com/v1/emails/{account_id}/send' \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'X-API-Secret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
    "sender_address": "[email protected]",
    "recipient_address": "[email protected]",
    "subject": "Email with Attachments",
    "body": "Please find the attached files.",
    "headers": {},
    "attachment_uri": [
        "https://example.com/files/document.pdf",
        "https://example.com/files/image.jpg"
    ]
}'
We’d love to hear from you!Don’t hesitate to reach out to [email protected] or [email protected] if there’s any features you’d like to see or prioritised!

Working with Attachments

To include attachments in your emails, use the attachment_uri parameter which accepts an array of URLs pointing to the files you want to attach.

Supported Attachment Types

A1Mail supports most common file types for email attachments, including but not limited to:
  • PDF documents (*.pdf)
  • Images (*.jpg, *.jpeg, *.png, *.gif)
  • Office documents (*.docx, *.xlsx, *.pptx)
  • Text files (*.txt, *.csv)

Attachment Size Limits

Attachments are subject to size limitations. Please ensure your attachments adhere to the following guidelines:
  • Individual attachment: Maximum 10MB
  • Total attachments per email: Maximum 25MB

Hosting Attachments

Attachments must be accessible via a public URL. You can use your own hosting solution or any publicly accessible file storage service. Make sure the URLs provided in the attachment_uri array are directly accessible without authentication.