Add SMTP mailbox
Add an SMTP mailbox to the workspace. Credentials are encrypted at rest.
The mailbox is created in inactive status. A background worker verifies
the SMTP/IMAP credentials and either flips status to active (success) or
deletes the mailbox (failure). After this request, poll
GET /v1/mailboxes/{mailboxId}/connection-test until the status is no
longer pending.
A DNS check (MX/SPF/DKIM/DMARC) runs automatically and populates
setupStatus. Mailbox usage is incremented against the workspace
owner's plan limit.
Returns 403 if the workspace owner has no active subscription or has reached the mailbox limit. Returns 409 if a mailbox with the same email already exists in the workspace.
curl -X POST "https://api.sendkit.ai/v1/mailboxes" \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"email": "sarah@company.com",
"displayName": "Sarah Johnson",
"provider": "custom",
"smtp": {
"host": "smtp.company.com",
"port": 587,
"secure": true,
"username": "sarah@company.com",
"password": "app-password-here"
},
"imap": {
"host": "imap.company.com",
"port": 993,
"secure": true,
"username": "sarah@company.com",
"password": "app-password-here"
},
"dailySendLimit": 15,
"signature": "<p>Best regards,<br>Sarah Johnson</p>",
"tags": [
"outreach"
]
}'
import requests
import json
url = "https://api.sendkit.ai/v1/mailboxes"
headers = {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
}
data = {
"email": "sarah@company.com",
"displayName": "Sarah Johnson",
"provider": "custom",
"smtp": {
"host": "smtp.company.com",
"port": 587,
"secure": true,
"username": "sarah@company.com",
"password": "app-password-here"
},
"imap": {
"host": "imap.company.com",
"port": 993,
"secure": true,
"username": "sarah@company.com",
"password": "app-password-here"
},
"dailySendLimit": 15,
"signature": "<p>Best regards,<br>Sarah Johnson</p>",
"tags": [
"outreach"
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.sendkit.ai/v1/mailboxes", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"email": "sarah@company.com",
"displayName": "Sarah Johnson",
"provider": "custom",
"smtp": {
"host": "smtp.company.com",
"port": 587,
"secure": true,
"username": "sarah@company.com",
"password": "app-password-here"
},
"imap": {
"host": "imap.company.com",
"port": 993,
"secure": true,
"username": "sarah@company.com",
"password": "app-password-here"
},
"dailySendLimit": 15,
"signature": "<p>Best regards,<br>Sarah Johnson</p>",
"tags": [
"outreach"
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"email": "sarah@company.com",
"displayName": "Sarah Johnson",
"provider": "custom",
"smtp": {
"host": "smtp.company.com",
"port": 587,
"secure": true,
"username": "sarah@company.com",
"password": "app-password-here"
},
"imap": {
"host": "imap.company.com",
"port": 993,
"secure": true,
"username": "sarah@company.com",
"password": "app-password-here"
},
"dailySendLimit": 15,
"signature": "<p>Best regards,<br>Sarah Johnson</p>",
"tags": [
"outreach"
]
}`)
req, err := http.NewRequest("POST", "https://api.sendkit.ai/v1/mailboxes", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.sendkit.ai/v1/mailboxes')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-Api-Key'] = 'YOUR_API_KEY'
request.body = '{
"email": "sarah@company.com",
"displayName": "Sarah Johnson",
"provider": "custom",
"smtp": {
"host": "smtp.company.com",
"port": 587,
"secure": true,
"username": "sarah@company.com",
"password": "app-password-here"
},
"imap": {
"host": "imap.company.com",
"port": 993,
"secure": true,
"username": "sarah@company.com",
"password": "app-password-here"
},
"dailySendLimit": 15,
"signature": "<p>Best regards,<br>Sarah Johnson</p>",
"tags": [
"outreach"
]
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"_id": "665b1c2d3e4f5a6b7c8d9e0f",
"email": "sarah@company.com",
"displayName": "Sarah Johnson",
"provider": "custom",
"status": "inactive",
"connectionType": "smtp",
"dailySendLimit": 15,
"sendingEnabled": false,
"signature": "<p>Best regards,<br>Sarah Johnson</p>",
"tags": [
"outreach"
],
"smtpHost": "smtp.company.com",
"smtpPort": 587,
"smtpSecure": true,
"imapHost": "imap.company.com",
"imapPort": 993,
"imapSecure": true,
"createdAt": "2025-06-10T10:30:00.000Z",
"updatedAt": "2025-06-10T10:30:00.000Z"
},
"message": "Mailbox queued for SMTP verification. Poll GET /v1/mailboxes/:id/connection-test until status is no longer "inactive"."
}
{
"success": false,
"error": {
"code": "SUBSCRIPTION_REQUIRED",
"message": "Workspace owner needs an active subscription to add mailboxes"
}
}
{
"success": false,
"error": {
"code": "LIMIT_REACHED",
"message": "Mailbox limit reached for your plan",
"currentUsage": 10,
"maxMailboxes": 10,
"requested": 1
}
}
{
"success": false,
"error": {
"code": "CONFLICT",
"message": "Mailbox already exists"
}
}
/v1/mailboxes
Platform API key (sk_user_...) or Workspace API key (sk_...)
The media type of the request body
Mailbox email address (stored lowercase)
Sender display name (defaults to email username)
Email provider (default "custom")
SMTP server configuration (required)
IMAP server configuration (for receiving/replying). If omitted, the SMTP credentials are reused for IMAP.
Maximum emails per day (default 15, clamped to 1-50)
HTML email signature
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)
Body
Mailbox email address (stored lowercase)
Sender display name (defaults to email username)
SMTP server configuration (required)
SMTP server hostname
SMTP port (default 587)
Use SSL/TLS (default true)
SMTP username
SMTP password
IMAP server configuration (for receiving/replying). If omitted, the SMTP credentials are reused for IMAP.
IMAP server hostname
IMAP port (default 993)
Use SSL/TLS (default true)
Maximum emails per day (default 15, clamped to 1-50)
HTML email signature
Responses
Mailbox object (credentials excluded)
Workspace owner lacks subscription or has hit the mailbox limit
Mailbox with this email already exists
Last updated 4 days ago
Built with Documentation.AI