Configure inbox sync for a mailbox
Enable or disable reply fetching. Google / Outlook mailboxes need no
credentials (the OAuth grant covers IMAP; Outlook mailboxes connected
before inbox support must be reconnected to grant
IMAP.AccessAsUser.All). SMTP mailboxes must supply imap_host and
imap_password (port defaults to 993, username to smtp_username);
the connection is tested before saving. Supplying credentials enables
sync unless enabled: false is passed. Enabling defaults to a
30-day backfill; sync_from restarts the cursor so mail received
after that time is (re)pulled (set it earlier for more history).
curl -X POST "https://api.supasend.io/v1/mailboxes/507f1f77bcf86cd799439011/inbox" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"enabled": true,
"imap_host": "example_string",
"imap_port": 42,
"imap_username": "John Doe",
"imap_password": "example_string",
"sync_from": "2024-12-25T10:00:00Z"
}'
import requests
import json
url = "https://api.supasend.io/v1/mailboxes/507f1f77bcf86cd799439011/inbox"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"enabled": true,
"imap_host": "example_string",
"imap_port": 42,
"imap_username": "John Doe",
"imap_password": "example_string",
"sync_from": "2024-12-25T10:00:00Z"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.supasend.io/v1/mailboxes/507f1f77bcf86cd799439011/inbox", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"enabled": true,
"imap_host": "example_string",
"imap_port": 42,
"imap_username": "John Doe",
"imap_password": "example_string",
"sync_from": "2024-12-25T10:00:00Z"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"enabled": true,
"imap_host": "example_string",
"imap_port": 42,
"imap_username": "John Doe",
"imap_password": "example_string",
"sync_from": "2024-12-25T10:00:00Z"
}`)
req, err := http.NewRequest("POST", "https://api.supasend.io/v1/mailboxes/507f1f77bcf86cd799439011/inbox", 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.supasend.io/v1/mailboxes/507f1f77bcf86cd799439011/inbox')
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 = '{
"enabled": true,
"imap_host": "example_string",
"imap_port": 42,
"imap_username": "John Doe",
"imap_password": "example_string",
"sync_from": "2024-12-25T10:00:00Z"
}'
response = http.request(request)
puts response.body
{
"id": "example_string",
"type": "smtp",
"email": "user@example.com",
"display_name": "John Doe",
"status": "active",
"max_daily_sends": 500,
"imap_host": "example_string",
"imap_port": 42,
"imap_username": "John Doe",
"inbox_sync_enabled": true,
"inbox_sync_from": "2024-12-25T10:00:00Z",
"inbox_last_sync_at": "2024-12-25T10:00:00Z",
"inbox_last_error": "example_string",
"created_at": "2024-12-25T10:00:00Z",
"updated_at": "2024-12-25T10:00:00Z"
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
/v1/mailboxes/{id}/inboxTarget server for requests. Edit to use your own host.
API key in the format sk_live_<64 hex characters>
sk_live_<64 hex characters>MongoDB ObjectID
The media type of the request body
SMTP mailboxes only
Defaults to smtp_username
Restart the cursor — pull mail received after this time
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. API key in the format sk_live_\<64 hex characters\>
Path Parameters
Body
SMTP mailboxes only
Defaults to smtp_username
Restart the cursor — pull mail received after this time
Responses
smtpgoogleoutlookactiveerrordisconnectedSMTP mailboxes only
Only mail received after this time is pulled
Last sync failure, empty when healthy