Create an Audience
POST/v1/audiences
Create a new audience to organize your contacts.
Request Body
Description of the audience
curl -X POST https://www.unosend.co/api/v1/audiences \
-H "Authorization: Bearer un_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Newsletter Subscribers",
"description": "Main newsletter list"
}'
Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Newsletter Subscribers",
"description": "Main newsletter list",
"created_at": "2024-01-15T10:30:00.000Z"
}
List Audiences
GET/v1/audiences
Get a list of all audiences in your account with contact counts.
curl https://www.unosend.co/api/v1/audiences \
-H "Authorization: Bearer un_your_api_key"
Response
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Newsletter Subscribers",
"description": "Main newsletter list",
"contacts_count": 1250,
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-20T08:00:00.000Z"
},
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"name": "Product Updates",
"description": null,
"contacts_count": 890,
"created_at": "2024-01-16T14:20:00.000Z",
"updated_at": "2024-01-16T14:20:00.000Z"
}
]
}
Get Audience Details
GET/v1/audiences/:id
curl https://www.unosend.co/api/v1/audiences/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer un_your_api_key"
Delete Audience
DELETE/v1/audiences/:id
Delete an audience and all its contacts. This action cannot be undone.
curl -X DELETE https://www.unosend.co/api/v1/audiences/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer un_your_api_key"