Senders
Create Sender
Create a new sender identity with email address and display name using the AutoSend API.
POST
/
senders
curl --request POST \
--url https://api.autosend.com/v1/senders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]"
}'
import requests
url = "https://api.autosend.com/v1/senders"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/senders', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '[email protected]',
name: 'Example Team',
replyTo: '[email protected]'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/senders';
$data = [
'email' => '[email protected]',
'name' => 'Example Team',
'replyTo' => '[email protected]'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <token>',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/senders"
payload := map[string]interface{}{
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class CreateSender {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/senders");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Authorization", "Bearer <token>");
con.setRequestProperty("Content-Type", "application/json");
con.setDoOutput(true);
String jsonInputString = "{\n" +
" \"email\": \"[email protected]\",\n" +
" \"name\": \"Example Team\",\n" +
" \"replyTo\": \"[email protected]\"\n" +
"}";
try (OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.autosend.com/v1/senders')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = {
email: '[email protected]',
name: 'Example Team',
replyTo: '[email protected]'
}.to_json
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"sender": {
"id": "60d5ec49f1b2c72d9c8b4567",
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]"
},
"projectId": "60d5ec49f1b2c72d9c8b1234"
},
"message": "Authenticated sender added successfully"
}
curl --request POST \
--url https://api.autosend.com/v1/senders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]"
}'
import requests
url = "https://api.autosend.com/v1/senders"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/senders', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '[email protected]',
name: 'Example Team',
replyTo: '[email protected]'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/senders';
$data = [
'email' => '[email protected]',
'name' => 'Example Team',
'replyTo' => '[email protected]'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <token>',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/senders"
payload := map[string]interface{}{
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class CreateSender {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/senders");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Authorization", "Bearer <token>");
con.setRequestProperty("Content-Type", "application/json");
con.setDoOutput(true);
String jsonInputString = "{\n" +
" \"email\": \"[email protected]\",\n" +
" \"name\": \"Example Team\",\n" +
" \"replyTo\": \"[email protected]\"\n" +
"}";
try (OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.autosend.com/v1/senders')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = {
email: '[email protected]',
name: 'Example Team',
replyTo: '[email protected]'
}.to_json
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"sender": {
"id": "60d5ec49f1b2c72d9c8b4567",
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]"
},
"projectId": "60d5ec49f1b2c72d9c8b1234"
},
"message": "Authenticated sender added successfully"
}
Authorizations
string | header
required
Bearer authentication header of the form Bearer
<token>, where <token> is your auth token.Body
Sender data for creating a new authenticated sender. The email domain must match a verified domain on the project.string
required
Email address for the sender. The domain portion must match a verified domain on the project.Must be a valid email address.Example:
"[email protected]"string
Display name for the sender (max 200 characters). Shown as the “from” name in recipients’ email clients.Maximum length:
200Example: "Example Team"string
Reply-to email address. When recipients reply to emails from this sender, replies go to this address.Must be a valid email address.Example:
"[email protected]"Response
Sender created successfullyboolean
Indicates if the request was successfulExample:
trueobject
Show child attributes
Show child attributes
object
The created sender object
Show child attributes
Show child attributes
string
Unique sender identifierExample:
"60d5ec49f1b2c72d9c8b4567"string
Sender email addressExample:
"[email protected]"string
Display name for the senderExample:
"Example Team"string
Reply-to email addressExample:
"[email protected]"string
ID of the project the sender belongs toExample:
"60d5ec49f1b2c72d9c8b1234"string
Confirmation messageExample:
"Authenticated sender added successfully"Error Responses
object
Returned when the sender’s email domain does not match any verified domain on the project.
{
"success": false,
"error": "A verified domain is required before adding an authenticated sender"
}
object
Returned when a sender with the same email already exists on the project.
{
"success": false,
"error": "An authenticated sender with this email already exists"
}
Was this page helpful?
⌘I
curl --request POST \
--url https://api.autosend.com/v1/senders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]"
}'
import requests
url = "https://api.autosend.com/v1/senders"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/senders', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '[email protected]',
name: 'Example Team',
replyTo: '[email protected]'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/senders';
$data = [
'email' => '[email protected]',
'name' => 'Example Team',
'replyTo' => '[email protected]'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <token>',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/senders"
payload := map[string]interface{}{
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class CreateSender {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/senders");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Authorization", "Bearer <token>");
con.setRequestProperty("Content-Type", "application/json");
con.setDoOutput(true);
String jsonInputString = "{\n" +
" \"email\": \"[email protected]\",\n" +
" \"name\": \"Example Team\",\n" +
" \"replyTo\": \"[email protected]\"\n" +
"}";
try (OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://api.autosend.com/v1/senders')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = {
email: '[email protected]',
name: 'Example Team',
replyTo: '[email protected]'
}.to_json
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"sender": {
"id": "60d5ec49f1b2c72d9c8b4567",
"email": "[email protected]",
"name": "Example Team",
"replyTo": "[email protected]"
},
"projectId": "60d5ec49f1b2c72d9c8b1234"
},
"message": "Authenticated sender added successfully"
}