Send a single email
Every send is routed through one of your dedicated IPs. If ip_id is
omitted, the account's default IP is used. If you have no active IPs,
the request fails with 400 — contact support to have one assigned
to your account.
curl -X POST "https://api.supasend.io/v1/send" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"mailbox_id": "507f1f77bcf86cd799439011",
"ip_id": "65f1c8a2b3d4e5f607890abc",
"to": "recipient@example.com",
"subject": "Hello from SupaSend",
"body_html": "<h1>Hello!</h1><p>This is a test email.</p>",
"body_text": "Hello! This is a test email.",
"reply_to": "user@example.com",
"headers": {}
}'
import requests
import json
url = "https://api.supasend.io/v1/send"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"mailbox_id": "507f1f77bcf86cd799439011",
"ip_id": "65f1c8a2b3d4e5f607890abc",
"to": "recipient@example.com",
"subject": "Hello from SupaSend",
"body_html": "<h1>Hello!</h1><p>This is a test email.</p>",
"body_text": "Hello! This is a test email.",
"reply_to": "user@example.com",
"headers": {}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.supasend.io/v1/send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"mailbox_id": "507f1f77bcf86cd799439011",
"ip_id": "65f1c8a2b3d4e5f607890abc",
"to": "recipient@example.com",
"subject": "Hello from SupaSend",
"body_html": "<h1>Hello!</h1><p>This is a test email.</p>",
"body_text": "Hello! This is a test email.",
"reply_to": "user@example.com",
"headers": {}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"mailbox_id": "507f1f77bcf86cd799439011",
"ip_id": "65f1c8a2b3d4e5f607890abc",
"to": "recipient@example.com",
"subject": "Hello from SupaSend",
"body_html": "<h1>Hello!</h1><p>This is a test email.</p>",
"body_text": "Hello! This is a test email.",
"reply_to": "user@example.com",
"headers": {}
}`)
req, err := http.NewRequest("POST", "https://api.supasend.io/v1/send", 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/send')
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 = '{
"mailbox_id": "507f1f77bcf86cd799439011",
"ip_id": "65f1c8a2b3d4e5f607890abc",
"to": "recipient@example.com",
"subject": "Hello from SupaSend",
"body_html": "<h1>Hello!</h1><p>This is a test email.</p>",
"body_text": "Hello! This is a test email.",
"reply_to": "user@example.com",
"headers": {}
}'
response = http.request(request)
puts response.body
{
"id": "507f1f77bcf86cd799439011",
"status": "queued"
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Error",
"message": "Insufficient credits",
"code": 402
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server",
"code": 500,
"requestId": "req_1234567890"
}
/v1/send
Target server for requests. Edit to use your own host.
API key in the format sk_live_<64 hex characters>
sk_live_<64 hex characters>The media type of the request body
MongoDB ObjectID of the mailbox to send from
Optional dedicated IP to send this email from. When omitted, the email is sent via the mailbox's default route.
HTML email body
Plain text email body
Custom SMTP headers
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\>
Body
MongoDB ObjectID of the mailbox to send from
507f1f77bcf86cd799439011Optional dedicated IP to send this email from. When omitted, the email is sent via the mailbox's default route.
65f1c8a2b3d4e5f607890abcrecipient@example.comHello from SupaSendCustom SMTP headers