Create a customer list
curl --request POST \
--url https://api-eg.olimi.ai/api/v2/customer-lists \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "September renewals",
"allowDuplication": false,
"variants": [
{
"slug": "order_number",
"name": "Order number"
}
]
}
'import requests
url = "https://api-eg.olimi.ai/api/v2/customer-lists"
payload = {
"name": "September renewals",
"allowDuplication": False,
"variants": [
{
"slug": "order_number",
"name": "Order number"
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'September renewals',
allowDuplication: false,
variants: [{slug: 'order_number', name: 'Order number'}]
})
};
fetch('https://api-eg.olimi.ai/api/v2/customer-lists', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eg.olimi.ai/api/v2/customer-lists",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'September renewals',
'allowDuplication' => false,
'variants' => [
[
'slug' => 'order_number',
'name' => 'Order number'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eg.olimi.ai/api/v2/customer-lists"
payload := strings.NewReader("{\n \"name\": \"September renewals\",\n \"allowDuplication\": false,\n \"variants\": [\n {\n \"slug\": \"order_number\",\n \"name\": \"Order number\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eg.olimi.ai/api/v2/customer-lists")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"September renewals\",\n \"allowDuplication\": false,\n \"variants\": [\n {\n \"slug\": \"order_number\",\n \"name\": \"Order number\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eg.olimi.ai/api/v2/customer-lists")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"September renewals\",\n \"allowDuplication\": false,\n \"variants\": [\n {\n \"slug\": \"order_number\",\n \"name\": \"Order number\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Customer created successfully",
"data": {
"id": "9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24",
"organizationId": "5f2c8a91-7d3e-4b60-8c1a-9e4f2b7d6a35",
"name": "September renewals",
"allowDuplication": false,
"totalContacts": 1240,
"createdAt": "2026-09-20T08:02:11.904Z",
"updatedAt": "2026-09-20T08:02:11.904Z",
"variants": [
{
"id": "7e3c9b15-6a2d-4f8e-b1c4-5d9a3e7f2b60",
"slug": "order_number",
"name": "Order number",
"createdAt": "2026-09-20T08:02:11.904Z",
"updatedAt": "2026-09-20T08:02:11.904Z"
}
]
}
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 422,
"message": [
"name must be shorter than or equal to 100 characters"
],
"error": "Unprocessable Entity"
}Customer Lists
Create a customer list
Creates an empty customer list, optionally with custom columns (variants).
POST
/
api
/
v2
/
customer-lists
Create a customer list
curl --request POST \
--url https://api-eg.olimi.ai/api/v2/customer-lists \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "September renewals",
"allowDuplication": false,
"variants": [
{
"slug": "order_number",
"name": "Order number"
}
]
}
'import requests
url = "https://api-eg.olimi.ai/api/v2/customer-lists"
payload = {
"name": "September renewals",
"allowDuplication": False,
"variants": [
{
"slug": "order_number",
"name": "Order number"
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'September renewals',
allowDuplication: false,
variants: [{slug: 'order_number', name: 'Order number'}]
})
};
fetch('https://api-eg.olimi.ai/api/v2/customer-lists', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-eg.olimi.ai/api/v2/customer-lists",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'September renewals',
'allowDuplication' => false,
'variants' => [
[
'slug' => 'order_number',
'name' => 'Order number'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-eg.olimi.ai/api/v2/customer-lists"
payload := strings.NewReader("{\n \"name\": \"September renewals\",\n \"allowDuplication\": false,\n \"variants\": [\n {\n \"slug\": \"order_number\",\n \"name\": \"Order number\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-eg.olimi.ai/api/v2/customer-lists")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"September renewals\",\n \"allowDuplication\": false,\n \"variants\": [\n {\n \"slug\": \"order_number\",\n \"name\": \"Order number\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eg.olimi.ai/api/v2/customer-lists")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"September renewals\",\n \"allowDuplication\": false,\n \"variants\": [\n {\n \"slug\": \"order_number\",\n \"name\": \"Order number\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Customer created successfully",
"data": {
"id": "9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24",
"organizationId": "5f2c8a91-7d3e-4b60-8c1a-9e4f2b7d6a35",
"name": "September renewals",
"allowDuplication": false,
"totalContacts": 1240,
"createdAt": "2026-09-20T08:02:11.904Z",
"updatedAt": "2026-09-20T08:02:11.904Z",
"variants": [
{
"id": "7e3c9b15-6a2d-4f8e-b1c4-5d9a3e7f2b60",
"slug": "order_number",
"name": "Order number",
"createdAt": "2026-09-20T08:02:11.904Z",
"updatedAt": "2026-09-20T08:02:11.904Z"
}
]
}
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 422,
"message": [
"name must be shorter than or equal to 100 characters"
],
"error": "Unprocessable Entity"
}The new list is empty. Add people to it with Add a contact.
- Duplicates: leave
allowDuplicationout, or sendfalse, to reject a phone number that’s already in the list. - Variants: add a variant for every custom variable your agent’s script uses. See Variants. Slugs can’t be changed through the API afterwards.
422 validation error:
nameis missing, empty or longer than 100 characters.- An item in
variantsis missingslugorname, or has one empty.
Authorizations
Body
application/json
The list's name.
Required string length:
1 - 100Example:
"September renewals"
Whether the list accepts a phone number more than once. Leave it out, or send false, to reject duplicates (it's then stored as null, which means no).
Example:
false