Command Palette

Search for a command to run...

API Reference

Audiences

Manage your email audiences (mailing lists). Create audiences, add contacts, and use them for targeted email campaigns.

POST/v1/audiences

Create an Audience

Create a new audience to organize your contacts.

Request Body

ParameterTypeRequiredDescription
namestringRequiredName of the audience
descriptionstringOptionalDescription of the audience
cURL
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

201 Created
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Newsletter Subscribers",
  "description": "Main newsletter list",
  "created_at": "2024-01-15T10:30:00.000Z"
}
GET/v1/audiences

List Audiences

Get a list of all audiences in your account with contact counts.

cURL
curl https://www.unosend.co/api/v1/audiences \
  -H "Authorization: Bearer un_your_api_key"

Response

200 OK
{
  "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/v1/audiences/:id

Get Audience Details

cURL
curl https://www.unosend.co/api/v1/audiences/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer un_your_api_key"
DELETE/v1/audiences/:id

Delete Audience

Delete an audience and all its contacts. This action cannot be undone.

cURL
curl -X DELETE https://www.unosend.co/api/v1/audiences/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer un_your_api_key"