Create List
Create a new contact list to organize contacts into groups for targeted campaigns. A contact can belong to multiple lists.
Endpoint
POST /lists
Returns: 201 Created
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your-api-key> | Yes |
Content-Type | application/json | Yes |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | List name. Max 255 characters. |
description | string | No | Optional description of the list. |
Response
{
"id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"name": "Newsletter Subscribers",
"description": "Contacts who opted in for weekly newsletter",
"contact_count": 0,
"created_at": "2026-03-08T12:00:00.000Z",
"updated_at": "2026-03-08T12:00:00.000Z"
}
| Field | Type | Description |
|---|---|---|
id | string | Unique list ID (UUIDv7) |
name | string | List name |
description | string | null | List description |
contact_count | number | Number of contacts currently in the list |
created_at | string | ISO 8601 timestamp |
updated_at | string | ISO 8601 timestamp |
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X POST "https://api.arsel.sa/v1/lists" \
-H "Authorization: Bearer be_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Newsletter Subscribers",
"description": "Contacts who opted in for weekly newsletter"
}'
const response = await fetch("https://api.arsel.sa/v1/lists", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer be_your_api_key",
},
body: JSON.stringify({
name: "Newsletter Subscribers",
description: "Contacts who opted in for weekly newsletter",
}),
});
const list = await response.json();
console.log(list.id);
import requests
response = requests.post(
"https://api.arsel.sa/v1/lists",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer be_your_api_key",
},
json={
"name": "Newsletter Subscribers",
"description": "Contacts who opted in for weekly newsletter",
},
)
list_data = response.json()
print(list_data["id"])
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var payload = new
{
name = "Newsletter Subscribers",
description = "Contacts who opted in for weekly newsletter"
};
var json = System.Text.Json.JsonSerializer.Serialize(payload);
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.arsel.sa/v1/lists", content);
Console.WriteLine(await response.Content.ReadAsStringAsync());
<?php
$ch = curl_init("https://api.arsel.sa/v1/lists");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer be_your_api_key"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"name" => "Newsletter Subscribers",
"description" => "Contacts who opted in for weekly newsletter"
]));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Error Responses
- 422 Validation Error
- 401 Unauthorized
{
"status_code": 422,
"name": "validation_error",
"message": "name must be shorter than or equal to 255 characters"
}
{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid or missing API key"
}