Easymailing
Audiences

Create an audience

POST /audiences

POST/audiences

Creates an audience, the list that holds your subscribers, with its default sender, notification settings and GDPR configuration. The new audience starts with no members of its own except the one added automatically (see side effects).

When to use: When the user wants a separate list of subscribers, for example customers apart from leads. Check list_audiences first and reuse an existing audience unless the user asks for a new one.

When not to use: To change an audience that already exists, use update_audience. To add people to an audience, use create_audience_member.

Side effects: When the API key or token belongs to a user, the audience is created with a test group ("Pruebas") and that user's email address as its first member, confirmed at once: no confirmation or welcome email is sent to it. The audience's customizable pages (such as the confirmation page) are created from the defaults.

Permissions: Requires the manager role or higher, or the marketing.audiences.write capability.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Request Body

The new Audience resource

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://api.easymailing.com/audiences" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "title": "string",    "description": "string",    "currency": "string",    "timezone": "string",    "preferences": {      "from_name": "string",      "from_email": "/entity/1",      "reply_to": "/entity/1"    },    "company": {      "company_name": "string",      "address": "string",      "postal_code": "string",      "city": "string",      "state": "string",      "country": "string",      "phone": "string",      "website_url": "http://example.com"    },    "notifications": {      "opt_in": "string",      "opt_out": "string",      "opt_in_notify_email": "user@example.com",      "opt_out_notify_email": "user@example.com",      "welcome_email": true,      "unsubscribe_hard_bounces": true,      "unsubscribe_soft_bounces": true,      "sms_sender": "/entity/1"    },    "list_gdpr": {      "enabled": true,      "privacy_url": "http://example.com",      "treatment_purposes": [        "/entity/1"      ],      "data_manager": "/entity/1"    }  }'
{  "id": 0,  "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",  "title": "string",  "description": "string",  "currency": "string",  "timezone": "string",  "audience_stats": {    "score": 0,    "sms_score": 0,    "total": 0,    "active": 0,    "canceled": 0  },  "audience_resources": {    "campaigns": 0,    "automations": 0,    "subscription_forms": 0,    "landing_pages": 0  },  "preferences": {    "from_name": "string",    "from_email": {      "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",      "email": "user@example.com",      "confirmed": true    },    "reply_to": {      "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",      "email": "user@example.com",      "confirmed": true    }  },  "company": {    "company_name": "string",    "address": "string",    "postal_code": "string",    "city": "string",    "state": "string",    "country": "string",    "phone": "string",    "website_url": "http://example.com",    "logo_url": "string"  },  "notifications": {    "opt_in": "string",    "opt_out": "string",    "opt_in_notify_email": "user@example.com",    "opt_out_notify_email": "user@example.com",    "welcome_email": true,    "unsubscribe_hard_bounces": true,    "unsubscribe_soft_bounces": true,    "sms_sender": "/entity/1"  },  "list_segments": [    {      "name": "string",      "description": "string",      "operator_match": "all",      "subscriber_count": 0,      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "list_fields": [    {      "tag": "string",      "template_tag": "string",      "public": true,      "required": true,      "type": "list.field.type.text",      "translations": [        {          "label": "string",          "default_value": "string",          "help_text": "string",          "locale": "string"        }      ],      "options": {        "property1": "string",        "property2": "string"      },      "list_field_options": [        {          "value": "string",          "translations": [            {              "name": "string",              "locale": "string"            }          ]        }      ],      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "groups": [    {      "title": "string",      "description": "string",      "suscriber_count": 0,      "color": "string",      "public": true    }  ],  "list_gdpr": {    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",    "enabled": true,    "privacy_url": "http://example.com",    "list_gdpr_treatment_purposes": [],    "treatment_purposes": [      {        "translations": [          {            "title": "string",            "locale": "string"          }        ],        "name": "string",        "description": "string",        "custom": true      }    ],    "data_manager": {      "name": "string",      "email": "user@example.com"    }  },  "total_suscribers": 0,  "active_suscribers": 0,  "unsuscribed": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}