curl --request POST \
--url https://api.mailbeast.ai/v1/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounts": [
{
"emailAddress": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"smtpHost": "smtp.acme.com",
"smtpPort": 587,
"smtpUsername": "[email protected]",
"smtpPassword": "your-password",
"imapHost": "imap.acme.com",
"imapPort": 993,
"imapUsername": "[email protected]",
"imapPassword": "your-password",
"displayName": "Jane Doe",
"imapAllowInvalidCert": false,
"maxEmailsPerDay": 30,
"sendingGapMinutes": 10,
"campaignSlowRamp": false,
"signature": "Best regards,<br>Jane",
"bcc": "[email protected]",
"replyToAddress": "[email protected]",
"automationLanguage": "en",
"tracking": {
"domainId": "9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84"
},
"warmup": {
"enabled": true,
"strategy": "standard",
"maxPerDay": 15,
"replyRatePercentage": 35,
"rampupEnabled": true,
"dailyRampup": 1,
"randomizer": 0,
"skipWeekends": false,
"timezone": "Europe/London",
"trackingEnabled": true
}
}
]
}
'import requests
url = "https://api.mailbeast.ai/v1/accounts"
payload = { "accounts": [
{
"emailAddress": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"smtpHost": "smtp.acme.com",
"smtpPort": 587,
"smtpUsername": "[email protected]",
"smtpPassword": "your-password",
"imapHost": "imap.acme.com",
"imapPort": 993,
"imapUsername": "[email protected]",
"imapPassword": "your-password",
"displayName": "Jane Doe",
"imapAllowInvalidCert": False,
"maxEmailsPerDay": 30,
"sendingGapMinutes": 10,
"campaignSlowRamp": False,
"signature": "Best regards,<br>Jane",
"bcc": "[email protected]",
"replyToAddress": "[email protected]",
"automationLanguage": "en",
"tracking": { "domainId": "9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84" },
"warmup": {
"enabled": True,
"strategy": "standard",
"maxPerDay": 15,
"replyRatePercentage": 35,
"rampupEnabled": True,
"dailyRampup": 1,
"randomizer": 0,
"skipWeekends": False,
"timezone": "Europe/London",
"trackingEnabled": True
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accounts: [
{
emailAddress: '[email protected]',
firstName: 'Jane',
lastName: 'Doe',
smtpHost: 'smtp.acme.com',
smtpPort: 587,
smtpUsername: '[email protected]',
smtpPassword: 'your-password',
imapHost: 'imap.acme.com',
imapPort: 993,
imapUsername: '[email protected]',
imapPassword: 'your-password',
displayName: 'Jane Doe',
imapAllowInvalidCert: false,
maxEmailsPerDay: 30,
sendingGapMinutes: 10,
campaignSlowRamp: false,
signature: 'Best regards,<br>Jane',
bcc: '[email protected]',
replyToAddress: '[email protected]',
automationLanguage: 'en',
tracking: {domainId: '9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84'},
warmup: {
enabled: true,
strategy: 'standard',
maxPerDay: 15,
replyRatePercentage: 35,
rampupEnabled: true,
dailyRampup: 1,
randomizer: 0,
skipWeekends: false,
timezone: 'Europe/London',
trackingEnabled: true
}
}
]
})
};
fetch('https://api.mailbeast.ai/v1/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mailbeast.ai/v1/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accounts' => [
[
'emailAddress' => '[email protected]',
'firstName' => 'Jane',
'lastName' => 'Doe',
'smtpHost' => 'smtp.acme.com',
'smtpPort' => 587,
'smtpUsername' => '[email protected]',
'smtpPassword' => 'your-password',
'imapHost' => 'imap.acme.com',
'imapPort' => 993,
'imapUsername' => '[email protected]',
'imapPassword' => 'your-password',
'displayName' => 'Jane Doe',
'imapAllowInvalidCert' => false,
'maxEmailsPerDay' => 30,
'sendingGapMinutes' => 10,
'campaignSlowRamp' => false,
'signature' => 'Best regards,<br>Jane',
'bcc' => '[email protected]',
'replyToAddress' => '[email protected]',
'automationLanguage' => 'en',
'tracking' => [
'domainId' => '9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84'
],
'warmup' => [
'enabled' => true,
'strategy' => 'standard',
'maxPerDay' => 15,
'replyRatePercentage' => 35,
'rampupEnabled' => true,
'dailyRampup' => 1,
'randomizer' => 0,
'skipWeekends' => false,
'timezone' => 'Europe/London',
'trackingEnabled' => true
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mailbeast.ai/v1/accounts"
payload := strings.NewReader("{\n \"accounts\": [\n {\n \"emailAddress\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"smtpHost\": \"smtp.acme.com\",\n \"smtpPort\": 587,\n \"smtpUsername\": \"[email protected]\",\n \"smtpPassword\": \"your-password\",\n \"imapHost\": \"imap.acme.com\",\n \"imapPort\": 993,\n \"imapUsername\": \"[email protected]\",\n \"imapPassword\": \"your-password\",\n \"displayName\": \"Jane Doe\",\n \"imapAllowInvalidCert\": false,\n \"maxEmailsPerDay\": 30,\n \"sendingGapMinutes\": 10,\n \"campaignSlowRamp\": false,\n \"signature\": \"Best regards,<br>Jane\",\n \"bcc\": \"[email protected]\",\n \"replyToAddress\": \"[email protected]\",\n \"automationLanguage\": \"en\",\n \"tracking\": {\n \"domainId\": \"9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84\"\n },\n \"warmup\": {\n \"enabled\": true,\n \"strategy\": \"standard\",\n \"maxPerDay\": 15,\n \"replyRatePercentage\": 35,\n \"rampupEnabled\": true,\n \"dailyRampup\": 1,\n \"randomizer\": 0,\n \"skipWeekends\": false,\n \"timezone\": \"Europe/London\",\n \"trackingEnabled\": true\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mailbeast.ai/v1/accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounts\": [\n {\n \"emailAddress\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"smtpHost\": \"smtp.acme.com\",\n \"smtpPort\": 587,\n \"smtpUsername\": \"[email protected]\",\n \"smtpPassword\": \"your-password\",\n \"imapHost\": \"imap.acme.com\",\n \"imapPort\": 993,\n \"imapUsername\": \"[email protected]\",\n \"imapPassword\": \"your-password\",\n \"displayName\": \"Jane Doe\",\n \"imapAllowInvalidCert\": false,\n \"maxEmailsPerDay\": 30,\n \"sendingGapMinutes\": 10,\n \"campaignSlowRamp\": false,\n \"signature\": \"Best regards,<br>Jane\",\n \"bcc\": \"[email protected]\",\n \"replyToAddress\": \"[email protected]\",\n \"automationLanguage\": \"en\",\n \"tracking\": {\n \"domainId\": \"9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84\"\n },\n \"warmup\": {\n \"enabled\": true,\n \"strategy\": \"standard\",\n \"maxPerDay\": 15,\n \"replyRatePercentage\": 35,\n \"rampupEnabled\": true,\n \"dailyRampup\": 1,\n \"randomizer\": 0,\n \"skipWeekends\": false,\n \"timezone\": \"Europe/London\",\n \"trackingEnabled\": true\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mailbeast.ai/v1/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounts\": [\n {\n \"emailAddress\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"smtpHost\": \"smtp.acme.com\",\n \"smtpPort\": 587,\n \"smtpUsername\": \"[email protected]\",\n \"smtpPassword\": \"your-password\",\n \"imapHost\": \"imap.acme.com\",\n \"imapPort\": 993,\n \"imapUsername\": \"[email protected]\",\n \"imapPassword\": \"your-password\",\n \"displayName\": \"Jane Doe\",\n \"imapAllowInvalidCert\": false,\n \"maxEmailsPerDay\": 30,\n \"sendingGapMinutes\": 10,\n \"campaignSlowRamp\": false,\n \"signature\": \"Best regards,<br>Jane\",\n \"bcc\": \"[email protected]\",\n \"replyToAddress\": \"[email protected]\",\n \"automationLanguage\": \"en\",\n \"tracking\": {\n \"domainId\": \"9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84\"\n },\n \"warmup\": {\n \"enabled\": true,\n \"strategy\": \"standard\",\n \"maxPerDay\": 15,\n \"replyRatePercentage\": 35,\n \"rampupEnabled\": true,\n \"dailyRampup\": 1,\n \"randomizer\": 0,\n \"skipWeekends\": false,\n \"timezone\": \"Europe/London\",\n \"trackingEnabled\": true\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"submitted": 2,
"created": 1,
"failed": 1
},
"accounts": [
{
"id": "3f1c2b7e-9a4d-4e18-b2c1-6d8f5a0e7c93",
"emailAddress": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"displayName": "Jane Doe",
"provider": "custom",
"status": "active",
"maxEmailsPerDay": 30,
"sendingGapMinutes": 10,
"campaignSlowRamp": false,
"replyToAddress": "[email protected]",
"signature": "Best regards,<br>Jane",
"bcc": "[email protected]",
"automationLanguage": "en",
"warmup": {
"enabled": true,
"strategy": "standard",
"maxPerDay": 15,
"replyRatePercentage": 35,
"rampupEnabled": true,
"dailyRampup": 1,
"randomizer": 0,
"skipWeekends": false,
"timezone": "Europe/London",
"trackingEnabled": true,
"phase": "warming_up",
"startedAt": "2023-11-07T05:31:56Z",
"poolAccess": "free"
},
"tracking": {
"domainId": "9d1f7c4a-6e58-4b32-8a07-3c5d9e2f1b46"
},
"statusMessage": {
"code": "EENVELOPE",
"command": "DATA",
"responseCode": 550,
"response": "550-5.4.5 Daily user sending limit exceeded.",
"message": "Daily user sending limit exceeded",
"occurredAt": "2023-11-07T05:31:56Z"
},
"tags": [
{
"id": "5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f",
"name": "client-acme",
"color": "#4F46E5"
}
],
"healthScore": 98,
"smtp": {
"host": "smtp.acme.com",
"port": 587,
"username": "[email protected]"
},
"imap": {
"host": "imap.acme.com",
"port": 993,
"username": "[email protected]"
},
"verification": {
"overallStatus": "pending",
"smtp": "active",
"imap": "not_checked",
"dns": {
"mx": "not_checked",
"spf": "not_checked",
"dkim": "not_checked",
"dmarc": "not_checked"
}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"errors": [
{
"index": 0,
"emailAddress": "[email protected]",
"code": "mailbox_connected_elsewhere",
"error": "This mailbox is already connected to another MailBeast workspace. Disconnect it there before adding it here."
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "validation_failed",
"message": "One or more fields are invalid.",
"status": 400,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"details": [
"name should not be empty"
]
}
}{
"error": {
"type": "authentication_error",
"code": "unauthenticated",
"message": "Missing or invalid API key.",
"status": 401,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "authorization_error",
"code": "permission_denied",
"message": "This API key is missing the required scope.",
"status": 403,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "conflict",
"message": "The request conflicts with an existing resource.",
"status": 409,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_reused",
"message": "The Idempotency-Key was already used with a different request body. Use a new key for a new operation.",
"status": 422,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests. Retry after the interval in the Retry-After header.",
"status": 429,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"retryAfter": 30
}
}Connect mailboxes
Connect one SMTP/IMAP mailbox, or up to 50 at once. Any provider works, including Gmail and Outlook with an app password. There is no limit on how many mailboxes a workspace may connect.
Requires one of the following scopes: accounts:write, accounts:all, all:all.
curl --request POST \
--url https://api.mailbeast.ai/v1/accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounts": [
{
"emailAddress": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"smtpHost": "smtp.acme.com",
"smtpPort": 587,
"smtpUsername": "[email protected]",
"smtpPassword": "your-password",
"imapHost": "imap.acme.com",
"imapPort": 993,
"imapUsername": "[email protected]",
"imapPassword": "your-password",
"displayName": "Jane Doe",
"imapAllowInvalidCert": false,
"maxEmailsPerDay": 30,
"sendingGapMinutes": 10,
"campaignSlowRamp": false,
"signature": "Best regards,<br>Jane",
"bcc": "[email protected]",
"replyToAddress": "[email protected]",
"automationLanguage": "en",
"tracking": {
"domainId": "9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84"
},
"warmup": {
"enabled": true,
"strategy": "standard",
"maxPerDay": 15,
"replyRatePercentage": 35,
"rampupEnabled": true,
"dailyRampup": 1,
"randomizer": 0,
"skipWeekends": false,
"timezone": "Europe/London",
"trackingEnabled": true
}
}
]
}
'import requests
url = "https://api.mailbeast.ai/v1/accounts"
payload = { "accounts": [
{
"emailAddress": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"smtpHost": "smtp.acme.com",
"smtpPort": 587,
"smtpUsername": "[email protected]",
"smtpPassword": "your-password",
"imapHost": "imap.acme.com",
"imapPort": 993,
"imapUsername": "[email protected]",
"imapPassword": "your-password",
"displayName": "Jane Doe",
"imapAllowInvalidCert": False,
"maxEmailsPerDay": 30,
"sendingGapMinutes": 10,
"campaignSlowRamp": False,
"signature": "Best regards,<br>Jane",
"bcc": "[email protected]",
"replyToAddress": "[email protected]",
"automationLanguage": "en",
"tracking": { "domainId": "9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84" },
"warmup": {
"enabled": True,
"strategy": "standard",
"maxPerDay": 15,
"replyRatePercentage": 35,
"rampupEnabled": True,
"dailyRampup": 1,
"randomizer": 0,
"skipWeekends": False,
"timezone": "Europe/London",
"trackingEnabled": True
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accounts: [
{
emailAddress: '[email protected]',
firstName: 'Jane',
lastName: 'Doe',
smtpHost: 'smtp.acme.com',
smtpPort: 587,
smtpUsername: '[email protected]',
smtpPassword: 'your-password',
imapHost: 'imap.acme.com',
imapPort: 993,
imapUsername: '[email protected]',
imapPassword: 'your-password',
displayName: 'Jane Doe',
imapAllowInvalidCert: false,
maxEmailsPerDay: 30,
sendingGapMinutes: 10,
campaignSlowRamp: false,
signature: 'Best regards,<br>Jane',
bcc: '[email protected]',
replyToAddress: '[email protected]',
automationLanguage: 'en',
tracking: {domainId: '9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84'},
warmup: {
enabled: true,
strategy: 'standard',
maxPerDay: 15,
replyRatePercentage: 35,
rampupEnabled: true,
dailyRampup: 1,
randomizer: 0,
skipWeekends: false,
timezone: 'Europe/London',
trackingEnabled: true
}
}
]
})
};
fetch('https://api.mailbeast.ai/v1/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mailbeast.ai/v1/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accounts' => [
[
'emailAddress' => '[email protected]',
'firstName' => 'Jane',
'lastName' => 'Doe',
'smtpHost' => 'smtp.acme.com',
'smtpPort' => 587,
'smtpUsername' => '[email protected]',
'smtpPassword' => 'your-password',
'imapHost' => 'imap.acme.com',
'imapPort' => 993,
'imapUsername' => '[email protected]',
'imapPassword' => 'your-password',
'displayName' => 'Jane Doe',
'imapAllowInvalidCert' => false,
'maxEmailsPerDay' => 30,
'sendingGapMinutes' => 10,
'campaignSlowRamp' => false,
'signature' => 'Best regards,<br>Jane',
'bcc' => '[email protected]',
'replyToAddress' => '[email protected]',
'automationLanguage' => 'en',
'tracking' => [
'domainId' => '9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84'
],
'warmup' => [
'enabled' => true,
'strategy' => 'standard',
'maxPerDay' => 15,
'replyRatePercentage' => 35,
'rampupEnabled' => true,
'dailyRampup' => 1,
'randomizer' => 0,
'skipWeekends' => false,
'timezone' => 'Europe/London',
'trackingEnabled' => true
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mailbeast.ai/v1/accounts"
payload := strings.NewReader("{\n \"accounts\": [\n {\n \"emailAddress\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"smtpHost\": \"smtp.acme.com\",\n \"smtpPort\": 587,\n \"smtpUsername\": \"[email protected]\",\n \"smtpPassword\": \"your-password\",\n \"imapHost\": \"imap.acme.com\",\n \"imapPort\": 993,\n \"imapUsername\": \"[email protected]\",\n \"imapPassword\": \"your-password\",\n \"displayName\": \"Jane Doe\",\n \"imapAllowInvalidCert\": false,\n \"maxEmailsPerDay\": 30,\n \"sendingGapMinutes\": 10,\n \"campaignSlowRamp\": false,\n \"signature\": \"Best regards,<br>Jane\",\n \"bcc\": \"[email protected]\",\n \"replyToAddress\": \"[email protected]\",\n \"automationLanguage\": \"en\",\n \"tracking\": {\n \"domainId\": \"9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84\"\n },\n \"warmup\": {\n \"enabled\": true,\n \"strategy\": \"standard\",\n \"maxPerDay\": 15,\n \"replyRatePercentage\": 35,\n \"rampupEnabled\": true,\n \"dailyRampup\": 1,\n \"randomizer\": 0,\n \"skipWeekends\": false,\n \"timezone\": \"Europe/London\",\n \"trackingEnabled\": true\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mailbeast.ai/v1/accounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounts\": [\n {\n \"emailAddress\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"smtpHost\": \"smtp.acme.com\",\n \"smtpPort\": 587,\n \"smtpUsername\": \"[email protected]\",\n \"smtpPassword\": \"your-password\",\n \"imapHost\": \"imap.acme.com\",\n \"imapPort\": 993,\n \"imapUsername\": \"[email protected]\",\n \"imapPassword\": \"your-password\",\n \"displayName\": \"Jane Doe\",\n \"imapAllowInvalidCert\": false,\n \"maxEmailsPerDay\": 30,\n \"sendingGapMinutes\": 10,\n \"campaignSlowRamp\": false,\n \"signature\": \"Best regards,<br>Jane\",\n \"bcc\": \"[email protected]\",\n \"replyToAddress\": \"[email protected]\",\n \"automationLanguage\": \"en\",\n \"tracking\": {\n \"domainId\": \"9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84\"\n },\n \"warmup\": {\n \"enabled\": true,\n \"strategy\": \"standard\",\n \"maxPerDay\": 15,\n \"replyRatePercentage\": 35,\n \"rampupEnabled\": true,\n \"dailyRampup\": 1,\n \"randomizer\": 0,\n \"skipWeekends\": false,\n \"timezone\": \"Europe/London\",\n \"trackingEnabled\": true\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mailbeast.ai/v1/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounts\": [\n {\n \"emailAddress\": \"[email protected]\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"smtpHost\": \"smtp.acme.com\",\n \"smtpPort\": 587,\n \"smtpUsername\": \"[email protected]\",\n \"smtpPassword\": \"your-password\",\n \"imapHost\": \"imap.acme.com\",\n \"imapPort\": 993,\n \"imapUsername\": \"[email protected]\",\n \"imapPassword\": \"your-password\",\n \"displayName\": \"Jane Doe\",\n \"imapAllowInvalidCert\": false,\n \"maxEmailsPerDay\": 30,\n \"sendingGapMinutes\": 10,\n \"campaignSlowRamp\": false,\n \"signature\": \"Best regards,<br>Jane\",\n \"bcc\": \"[email protected]\",\n \"replyToAddress\": \"[email protected]\",\n \"automationLanguage\": \"en\",\n \"tracking\": {\n \"domainId\": \"9b7d4e53-91a0-4c2f-8a19-5d3e7f6b2c84\"\n },\n \"warmup\": {\n \"enabled\": true,\n \"strategy\": \"standard\",\n \"maxPerDay\": 15,\n \"replyRatePercentage\": 35,\n \"rampupEnabled\": true,\n \"dailyRampup\": 1,\n \"randomizer\": 0,\n \"skipWeekends\": false,\n \"timezone\": \"Europe/London\",\n \"trackingEnabled\": true\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"submitted": 2,
"created": 1,
"failed": 1
},
"accounts": [
{
"id": "3f1c2b7e-9a4d-4e18-b2c1-6d8f5a0e7c93",
"emailAddress": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"displayName": "Jane Doe",
"provider": "custom",
"status": "active",
"maxEmailsPerDay": 30,
"sendingGapMinutes": 10,
"campaignSlowRamp": false,
"replyToAddress": "[email protected]",
"signature": "Best regards,<br>Jane",
"bcc": "[email protected]",
"automationLanguage": "en",
"warmup": {
"enabled": true,
"strategy": "standard",
"maxPerDay": 15,
"replyRatePercentage": 35,
"rampupEnabled": true,
"dailyRampup": 1,
"randomizer": 0,
"skipWeekends": false,
"timezone": "Europe/London",
"trackingEnabled": true,
"phase": "warming_up",
"startedAt": "2023-11-07T05:31:56Z",
"poolAccess": "free"
},
"tracking": {
"domainId": "9d1f7c4a-6e58-4b32-8a07-3c5d9e2f1b46"
},
"statusMessage": {
"code": "EENVELOPE",
"command": "DATA",
"responseCode": 550,
"response": "550-5.4.5 Daily user sending limit exceeded.",
"message": "Daily user sending limit exceeded",
"occurredAt": "2023-11-07T05:31:56Z"
},
"tags": [
{
"id": "5c9b1e77-2f4a-4c31-9d8e-1a2b3c4d5e6f",
"name": "client-acme",
"color": "#4F46E5"
}
],
"healthScore": 98,
"smtp": {
"host": "smtp.acme.com",
"port": 587,
"username": "[email protected]"
},
"imap": {
"host": "imap.acme.com",
"port": 993,
"username": "[email protected]"
},
"verification": {
"overallStatus": "pending",
"smtp": "active",
"imap": "not_checked",
"dns": {
"mx": "not_checked",
"spf": "not_checked",
"dkim": "not_checked",
"dmarc": "not_checked"
}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"errors": [
{
"index": 0,
"emailAddress": "[email protected]",
"code": "mailbox_connected_elsewhere",
"error": "This mailbox is already connected to another MailBeast workspace. Disconnect it there before adding it here."
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "validation_failed",
"message": "One or more fields are invalid.",
"status": 400,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"details": [
"name should not be empty"
]
}
}{
"error": {
"type": "authentication_error",
"code": "unauthenticated",
"message": "Missing or invalid API key.",
"status": 401,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "authorization_error",
"code": "permission_denied",
"message": "This API key is missing the required scope.",
"status": 403,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "conflict",
"message": "The request conflicts with an existing resource.",
"status": 409,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_reused",
"message": "The Idempotency-Key was already used with a different request body. Use a new key for a new operation.",
"status": 422,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests. Retry after the interval in the Retry-After header.",
"status": 429,
"requestId": "e4f1c0b2-6a3d-4b8e-9f21-0a1b2c3d4e5f",
"retryAfter": 30
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional. A unique key you generate (max 255 chars, such as a UUID) that makes this request safe to retry. Retrying with the same key replays the original response instead of repeating the operation. Reusing a key with a different body returns 422.
255"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Body
Mailboxes to connect (1-50). Each is validated and created independently; the response reports which succeeded and which failed (e.g. an email already connected elsewhere).
1 - 50 elementsShow child attributes
Show child attributes
Response
Show child attributes
Show child attributes
The mailboxes that were connected. They start inactive and are verified in the background - poll GET /v1/accounts/{id} for the outcome.
Show child attributes
Show child attributes
The mailboxes that could not be connected. Each element is independent: the rest of the batch is still created.
Show child attributes
Show child attributes