Contact Lists
Create Contact List
Create a new contact list to organize and segment your recipients using the AutoSend API.
POST
/
contact-lists
curl --request POST \
--url https://api.autosend.com/v1/contact-lists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list"
}'
import requests
url = "https://api.autosend.com/v1/contact-lists"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/contact-lists', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Newsletter Subscribers',
description: 'Users who signed up for the weekly newsletter',
type: 'list'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/contact-lists';
$data = [
'name' => 'Newsletter Subscribers',
'description' => 'Users who signed up for the weekly newsletter',
'type' => 'list'
];
$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/contact-lists"
payload := map[string]interface{}{
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list",
}
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 CreateContactList {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/contact-lists");
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" +
" \"name\": \"Newsletter Subscribers\",\n" +
" \"description\": \"Users who signed up for the weekly newsletter\",\n" +
" \"type\": \"list\"\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/contact-lists')
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 = {
name: 'Newsletter Subscribers',
description: 'Users who signed up for the weekly newsletter',
type: 'list'
}.to_json
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"id": "60d5ec49f1b2c72d9c8b4567",
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list",
"contactCount": 0,
"createdAt": "2026-03-17T10:30:00.000Z",
"updatedAt": "2026-03-17T10:30:00.000Z"
}
}
curl --request POST \
--url https://api.autosend.com/v1/contact-lists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list"
}'
import requests
url = "https://api.autosend.com/v1/contact-lists"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/contact-lists', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Newsletter Subscribers',
description: 'Users who signed up for the weekly newsletter',
type: 'list'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/contact-lists';
$data = [
'name' => 'Newsletter Subscribers',
'description' => 'Users who signed up for the weekly newsletter',
'type' => 'list'
];
$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/contact-lists"
payload := map[string]interface{}{
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list",
}
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 CreateContactList {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/contact-lists");
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" +
" \"name\": \"Newsletter Subscribers\",\n" +
" \"description\": \"Users who signed up for the weekly newsletter\",\n" +
" \"type\": \"list\"\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/contact-lists')
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 = {
name: 'Newsletter Subscribers',
description: 'Users who signed up for the weekly newsletter',
type: 'list'
}.to_json
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"id": "60d5ec49f1b2c72d9c8b4567",
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list",
"contactCount": 0,
"createdAt": "2026-03-17T10:30:00.000Z",
"updatedAt": "2026-03-17T10:30:00.000Z"
}
}
Authorizations
Bearer authentication header of the form Bearer
<token>, where <token> is your auth token.Body
Contact list or segment dataName of the contact list (max 200 characters). Must be unique within the project.Maximum length:
200Example: "Newsletter Subscribers"Description of the contact list (max 500 characters).Maximum length:
500Example: "Users who signed up for the weekly newsletter"Filter criteria for segments. Required when
type is segment.Show child attributes
Show child attributes
Array of filter conditions.
Show child attributes
Show child attributes
Filter operator. Available operators depend on the field type.String operators:
equals, not_equals, contains, not_contains, starts_with, ends_with, is_empty, is_not_emptyNumber operators: equals, not_equals, greater_than, less_than, betweenBoolean operators: equals, not_equalsDate operators: equals, not_equals, before, after, between, is_empty, is_not_emptyExample: "contains"Response
Contact list created successfullyThe created contact list object
Show child attributes
Show child attributes
Was this page helpful?
⌘I
curl --request POST \
--url https://api.autosend.com/v1/contact-lists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list"
}'
import requests
url = "https://api.autosend.com/v1/contact-lists"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/contact-lists', {
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Newsletter Subscribers',
description: 'Users who signed up for the weekly newsletter',
type: 'list'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/contact-lists';
$data = [
'name' => 'Newsletter Subscribers',
'description' => 'Users who signed up for the weekly newsletter',
'type' => 'list'
];
$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/contact-lists"
payload := map[string]interface{}{
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list",
}
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 CreateContactList {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/contact-lists");
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" +
" \"name\": \"Newsletter Subscribers\",\n" +
" \"description\": \"Users who signed up for the weekly newsletter\",\n" +
" \"type\": \"list\"\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/contact-lists')
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 = {
name: 'Newsletter Subscribers',
description: 'Users who signed up for the weekly newsletter',
type: 'list'
}.to_json
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"id": "60d5ec49f1b2c72d9c8b4567",
"name": "Newsletter Subscribers",
"description": "Users who signed up for the weekly newsletter",
"type": "list",
"contactCount": 0,
"createdAt": "2026-03-17T10:30:00.000Z",
"updatedAt": "2026-03-17T10:30:00.000Z"
}
}