Documentation Index
Fetch the complete documentation index at: https://docs.a1base.com/llms.txt
Use this file to discover all available pages before exploring further.
Request Parameters
The following parameters are used when sending an email:
| Parameter | Type | Required | Description |
|---|
sender_address | string | Yes | Email address that will appear in the “From” field |
recipient_address | string | Yes | Email address of the recipient |
subject | string | Yes | Subject line of the email |
body | string | Yes | Content of the email (plain text or HTML) |
headers | object | No | Optional email headers as key-value pairs (cc, bcc, etc.) |
attachment_uri | array | No | Array 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"
]
}'
Send a Simple Text Email
import requests
import json
url = "https://api.a1base.com/v1/emails/{account_id}/send"
headers = {
'X-API-Key': 'YOUR_API_KEY',
'X-API-Secret': 'YOUR_API_SECRET',
'Content-Type': 'application/json'
}
data = {
"sender_address": "[email protected]",
"recipient_address": "[email protected]",
"subject": "Hello from A1Base",
"body": "This is an example email body.",
"headers": {}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
Send an HTML Email
import requests
import json
url = "https://api.a1base.com/v1/emails/{account_id}/send"
headers = {
'X-API-Key': 'YOUR_API_KEY',
'X-API-Secret': 'YOUR_API_SECRET',
'Content-Type': 'application/json'
}
html_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>
<p>Find out more at <a href="http://www.a1mail.com">www.a1mail.com</a>.</p>
</body>
</html>"""
data = {
"sender_address": "[email protected]",
"recipient_address": "[email protected]",
"subject": "Hello from A1Base",
"body": html_body,
"headers": {
"cc": "[email protected]",
"bcc": "[email protected]"
}
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
Send an Email with Attachments
import requests
import json
url = "https://api.a1base.com/v1/emails/{account_id}/send"
headers = {
'X-API-Key': 'YOUR_API_KEY',
'X-API-Secret': 'YOUR_API_SECRET',
'Content-Type': 'application/json'
}
data = {
"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"
]
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
Send a Simple Text Email
const axios = require('axios');
const url = 'https://api.a1base.com/v1/emails/{account_id}/send';
const headers = {
'X-API-Key': 'YOUR_API_KEY',
'X-API-Secret': 'YOUR_API_SECRET',
'Content-Type': 'application/json'
};
const data = {
sender_address: '[email protected]',
recipient_address: '[email protected]',
subject: 'Hello from A1Base',
body: 'This is an example email body.',
headers: {}
};
axios.post(url, data, { headers })
.then(response => console.log(response.data))
.catch(error => console.error('Error:', error));
Send an HTML Email
const axios = require('axios');
const url = 'https://api.a1base.com/v1/emails/{account_id}/send';
const headers = {
'X-API-Key': 'YOUR_API_KEY',
'X-API-Secret': 'YOUR_API_SECRET',
'Content-Type': 'application/json'
};
const htmlBody = `<!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>
<p>Find out more at <a href="http://www.a1mail.com">www.a1mail.com</a>.</p>
</body>
</html>`;
const data = {
sender_address: '[email protected]',
recipient_address: '[email protected]',
subject: 'Hello from A1Base',
body: htmlBody,
headers: {
cc: '[email protected]',
bcc: '[email protected]'
}
};
axios.post(url, data, { headers })
.then(response => console.log(response.data))
.catch(error => console.error('Error:', error));
Send an Email with Attachments
const axios = require('axios');
const url = 'https://api.a1base.com/v1/emails/{account_id}/send';
const headers = {
'X-API-Key': 'YOUR_API_KEY',
'X-API-Secret': 'YOUR_API_SECRET',
'Content-Type': 'application/json'
};
const data = {
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'
]
};
axios.post(url, data, { headers })
.then(response => console.log(response.data))
.catch(error => console.error('Error:', error));
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.