Easymailing
Members

Create or update a member

POST /audiences/{audienceUuid}/members

POST/audiences/{audienceUuid}/members

Adds a person to an audience and requests their email subscription, or merges the data you send into the member if that person is already in the audience. People are matched across the whole account by email, then by phone, so the same person is one contact with one member per audience. The response includes the contact IRI of the person.

When to use: To subscribe a new person or re-send a sign-up from a form, store or integration. It is safe to call again for the same email. Members are also created by create_store_customer (shop buyers) and by the public subscription forms.

When not to use: To create a person without subscribing them to any audience, use create_contact. To subscribe a contact you already have by UUID, use subscribe_contact_to_audience. To change data of a member you already have by UUID, use update_audience_member. To subscribe an existing member again use member_subscribe; to unsubscribe one use member_unsubscribe. To see in which audiences an email already is, use search_member. To register a shop buyer together with their customer record, use create_store_customer.

Side effects: What the person receives depends on their state. A new person (or one still unconfirmed) in a double opt-in audience gets a confirmation email and stays suscriber.status.unconfirmed until they confirm, unless disable_double_opt_in=true. In a single opt-in audience, or with disable_double_opt_in=true, they become suscriber.status.confirmed at once: the member_subscribed webhook fires, automations triggered by a subscription start, and the welcome email is sent if the audience has one (unless disable_welcome_email=true). An email on the audience's suppression list always gets a confirmation email instead. Someone who unsubscribed on their own (suscriber.status.unsuscribed) is not subscribed again: they get a confirmation email and stay unsubscribed until they confirm, even with disable_double_opt_in=true. Someone whose status is suscriber.status.unsuscribed.admin (unsubscribed through the API, by an administrator or by the cleaning rules) can be subscribed again normally: in a single opt-in audience, or with disable_double_opt_in=true, this call confirms them again at once unless their address is on the suppression list. Do not use it to bring back a person who asked to leave. An already confirmed member only gets their data updated. Confirmation emails are not repeated within 15 minutes. If a phone is sent, the SMS subscription follows the audience's SMS opt-in (a confirmation SMS in double opt-in, unless disable_sms_double_opt_in=true). Groups assigned fire the member_added_to_group webhook and group automations once the member is confirmed.

Permissions: Requires the manager role or higher, or the contacts.write and marketing.audiences.write capabilities.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

audienceUuid*string

UUID of the audience to add the person to. If the account has several audiences, confirm with the user which one before calling. Get it from list_audiences.

Query Parameters

disable_double_opt_in?boolean

If true, a person who is not yet subscribed becomes confirmed at once, without the confirmation email of a double opt-in audience. It does not apply to someone who unsubscribed on their own: they always get the confirmation email. Default false.

disable_welcome_email?boolean

If true, the welcome email of the audience is not sent when the member becomes confirmed. Default false.

disable_sms_double_opt_in?boolean

If true and a phone number is sent, the member is subscribed to SMS at once, without the confirmation SMS of a double opt-in audience. Default false.

Request Body

The new Member resource

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://api.easymailing.com/audiences/0df14405-90ff-4287-b3e4-ef088901ee6f/members?disable_double_opt_in=true&disable_welcome_email=true&disable_sms_double_opt_in=true" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com",    "phone": "string",    "first_name": "string",    "last_name": "string",    "client_ip": "192.168.0.1",    "locale": "string",    "location": {      "city": "string",      "postal_code": "string",      "timezone": "string",      "country_code": "string",      "country": "string",      "lat": 0.1,      "lng": 0.1    },    "groups": [      "/entity/1"    ],    "member_consent": {      "ip": "192.168.0.1",      "consent_at": "2019-08-24T14:15:22Z",      "treatment_purposes": [        "/entity/1"      ]    },    "custom_fields": [      {        "list_field": "/entity/1",        "value": "string"      }    ]  }'
{  "id": 0,  "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",  "email": "user@example.com",  "phone": "string",  "first_name": "string",  "last_name": "string",  "client_ip": "192.168.0.1",  "locale": "string",  "location": {    "city": "string",    "postal_code": "string",    "timezone": "string",    "country_code": "string",    "country": "string",    "lat": 0.1,    "lng": 0.1  },  "status": "suscriber.status.confirmed",  "email_opt_in_source": "suscriber.source.manual",  "email_opt_in_at": "2019-08-24T14:15:22Z",  "email_opt_out_at": "2019-08-24T14:15:22Z",  "sms_status": "suscriber.status.confirmed",  "sms_opt_in_at": "2019-08-24T14:15:22Z",  "sms_opt_out_at": "2019-08-24T14:15:22Z",  "sms_opt_in_source": "api",  "source": "suscriber.source.manual",  "rating": 0.1,  "audience": "string",  "contact": "/entity/1",  "groups": [    {      "title": "string",      "description": "string",      "color": "string",      "public": true    }  ],  "member_consent": {    "ip": "192.168.0.1",    "consent_at": "2019-08-24T14:15:22Z",    "treatment_purposes": [      {        "translations": [          {            "title": "string",            "locale": "string"          }        ],        "description": "string"      }    ]  },  "custom_fields": [    {      "list_field": {        "tag": "string",        "template_tag": "string",        "public": true,        "required": true,        "type": "list.field.type.text"      },      "value": "string"    }  ],  "suscription_form": {    "url": "http://example.com",    "domain": "string",    "title": "string",    "type": "popup",    "double_opt_in": true,    "active": true,    "paused": true  },  "stats": {    "sent": 0,    "delivered_emails": 0,    "unique_opens": 0,    "unique_clicks": 0,    "open_rate": 0,    "click_rate": 0,    "orders": 0,    "revenue": 0,    "order_rate": 0,    "avg_revenue": 0  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}