Limits
- 10MB total attachment size
- 10 emails per day for the free tier, 1000 emails per day for the paid tiers
If you need higher limits, contact us to upgrade.
REST API
1. Create an Api Key (if you don’t already have one)
Create an api key by going to the api keys page. You can also click the Create Your First Api Key button in the sidebar or navigate to the api keys page by clicking Settings, under the user dropdown at the bottom of the sidebar.
Be sure to save the api key somewhere safe. You will not be able to see it
later if you lose it.
Create Your First Api Key
2. Send an Email
Make sure to pass the api_key you created in the previous step in the
Authorization header. Also make sure to replace FROM_ADDRESS with the
address of the BotMailRoom inbox you want to send the email from. And change
the to_addresses to the email address you want to send the email to.
curl -X POST "https://api.botmailroom.com/api/v1/email/send" \
-H "Authorization: Bearer ${api_key}" \
-H "Content-Type: application/json" \
-d '{
"from_address": FROM_ADDRESS,
"subject": "Hello from Bot Mailroom",
"plain_text": "Hello from Bot Mailroom. We are testing our email sending functionality.",
"to_addresses": [
{
"address": "CHANGE_THIS@CHANGE_THIS.com",
"name": null
},
]
}'
Optional - Add an Attachment
Add an attachment to the attachment pool by sending a request to the add
attachment to pool endpoint.
Make sure to pass the api_key you created in the previous step in the
Authorization header. Also make sure to replace path/to/file with the path
to the file you want to add to the attachment pool.
curl -X POST "https://api.botmailroom.com/api/v1/email/add-attachment-to-pool" \
-H "Authorization: Bearer ${api_key}" \
-H "Content-Type: multipart/form-data" \
-F "file=@path/to/file"
The response will contain the ID of the attachment, which you can then use in
the send_email request.
curl -X POST "https://api.botmailroom.com/api/v1/email/send" \
-H "Authorization: Bearer ${api_key}" \
-H "Content-Type: application/json" \
-d '{
"from_address": FROM_ADDRESS,
"subject": "Hello from Bot Mailroom",
"plain_text": "Hello from Bot Mailroom. We are testing our email sending functionality.",
"to_addresses": [
{
"address": "CHANGE_THIS@CHANGE_THIS.com",
"name": null
},
],
"attachment_ids": [
ATTACHMENT_ID
]
}'
Python Client
1. Create an Api Key (if you don’t already have one)
Create an api key by going to the api keys page. You can also click the Create Your First Api Key button in the sidebar or navigate to the api keys page by clicking Settings, under the user dropdown at the bottom of the sidebar.
Be sure to save the api key somewhere safe. You will not be able to see it
later if you lose it.
Create Your First Api Key
2. Install the Client (if you haven’t already)
3. Initialize the Client
from botmailroom import BotMailRoom
client = BotMailRoom(api_key="your_api_key") # or set the BOTMAILROOM_API_KEY environment variable
4. Send an Email
Make sure to replace FROM_ADDRESS with the address of the BotMailRoom inbox
you want to send the email from. And change the to_addresses to the email
address you want to send the email to.
email_id = client.send_email(
from_address=FROM_ADDRESS,
subject="Hello from Bot Mailroom",
to_addresses=[{"address": "CHANGE_THIS@CHANGE_THIS.com", "name": None}],
content="Hello from Bot Mailroom. We are testing our email sending functionality.",
)
Optional - Add an Attachment
With the python client, you can just pass the file info directly to the
send_email method and it will handle adding the attachment to the pool for
you.
filename = "path/to/file"
with open(filename, "rb") as file:
file_bytes = file.read()
attachment_raw = (file_bytes, filename.split("/")[-1], "application/pdf")
email_id = client.send_email(
from_address=FROM_ADDRESS,
subject="Hello from Bot Mailroom",
to_addresses=[{"address": "CHANGE_THIS@CHANGE_THIS.com", "name": None}],
content="Hello from Bot Mailroom. We are testing our email sending functionality.",
attachments_raw=[attachment_raw],
)
TypeScript Client
1. Create an Api Key (if you don’t already have one)
Create an api key by going to the api keys page. You can also click the Create Your First Api Key button in the sidebar or navigate to the api keys page by clicking Settings, under the user dropdown at the bottom of the sidebar.
Be sure to save the api key somewhere safe. You will not be able to see it
later if you lose it.
Create Your First Api Key
2. Install the Client
npm install botmailroom
# or
yarn add botmailroom
3. Initialize the Client
import { BotMailRoom } from "botmailroom";
const client = new BotMailRoom("your_api_key"); // or set the BOTMAILROOM_API_KEY environment variable
4. Send an Email
Make sure to replace FROM_ADDRESS with the address of the BotMailRoom inbox
you want to send the email from. And change the to_addresses to the email
address you want to send the email to.
const emailId = await client.sendEmail({
fromAddress: FROM_ADDRESS,
content:
"Hello from Bot Mailroom. We are testing our email sending functionality.",
subject: "Hello from Bot Mailroom",
toAddresses: [{ address: "CHANGE_THIS@CHANGE_THIS.com", name: null }],
});
See the API Reference for
more information on the available parameters.
Optional - Add an Attachment
With the TypeScript client, you can pass raw attachments directly to the sendEmail method:
const fileBuffer = new ArrayBuffer(8); // Your file data here
const attachment = {
filename: "document.pdf",
file: fileBuffer,
contentType: "application/pdf",
};
const emailId = await client.sendEmail({
fromAddress: FROM_ADDRESS,
content:
"Hello from Bot Mailroom. We are testing our email sending functionality.",
subject: "Hello from Bot Mailroom",
toAddresses: [{ address: "CHANGE_THIS@CHANGE_THIS.com", name: null }],
attachmentsRaw: [attachment],
});