Add SMTP mailbox
Add an SMTP mailbox to the workspace. Credentials are encrypted at rest. 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" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"email": "sarah@company.com",
"displayName": "Sarah Johnson",
"provider": "custom",
"smtp": {
"host": "smtp.company.com",
"port": 587,
"secure": false,
"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": 40,
"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",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"email": "sarah@company.com",
"displayName": "Sarah Johnson",
"provider": "custom",
"smtp": {
"host": "smtp.company.com",
"port": 587,
"secure": false,
"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": 40,
"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",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"email": "sarah@company.com",
"displayName": "Sarah Johnson",
"provider": "custom",
"smtp": {
"host": "smtp.company.com",
"port": 587,
"secure": false,
"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": 40,
"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": false,
"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": 40,
"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")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
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['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"email": "sarah@company.com",
"displayName": "Sarah Johnson",
"provider": "custom",
"smtp": {
"host": "smtp.company.com",
"port": 587,
"secure": false,
"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": 40,
"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": "active",
"connectionType": "smtp",
"dailySendLimit": 40,
"sendingEnabled": true,
"signature": "<p>Best regards,<br>Sarah Johnson</p>",
"tags": [
"outreach"
],
"smtpHost": "smtp.company.com",
"smtpPort": 587,
"smtpSecure": false,
"imapHost": "imap.company.com",
"imapPort": 993,
"imapSecure": true,
"createdAt": "2025-06-10T10:30:00.000Z",
"updatedAt": "2025-06-10T10:30:00.000Z"
}
}
{
"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
IMAP server configuration (for receiving/replying)
Maximum emails per day (default 50, 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_...)
Bearer token. API key as Bearer token
Body
Mailbox email address (stored lowercase)
Sender display name (defaults to email username)
SMTP server configuration
IMAP server configuration (for receiving/replying)
Maximum emails per day (default 50, clamped to 1-50)
HTML email signature
Responses
Last updated today
Built with Documentation.AI