Easymailing

Core concepts

Understand audiences, members, resource identifiers and HTTP response formats.

Most subscriber integrations start with an audience and operate on its members. Understanding how these resources relate helps you choose the correct endpoint and build request bodies with the right identifiers.

How the resources fit together

ResourceRole in an integration
AudienceThe container used to organize subscribers. Many routes require its audienceUuid.
MemberA subscriber in an audience, with contact data, subscription status, groups and custom field values.
GroupA category to which members can be assigned explicitly.
SegmentA selection of members based on conditions.
Custom field definitionDescribes an additional field available in the audience. The API calls these resources list_fields.
Custom field valueThe value of one of those fields for a particular member. It refers to the definition using list_field.

For example, a Newsletter audience might contain a Customer group and a Plan custom field. A member can belong to that group and have Enterprise as the value of the Plan field. Groups and field definitions used by a member should come from the audience you are working with.

Start with List audiences, then use that audience's members, groups and custom fields.

UUID and IRI

A UUID identifies a resource. An IRI identifies it by its resource path. The JSON-LD responses for audiences, members and groups expose both uuid and @id. Use a member's UUID with the audience it was returned from: it identifies that audience membership.

This is an abbreviated, fictitious audience response:

{
  "@id": "/audiences/11111111-1111-4111-8111-111111111111",
  "uuid": "11111111-1111-4111-8111-111111111111",
  "title": "Newsletter"
}
Where you are using the identifierValue to use
An audienceUuid, uuid or groupUuid route parameterThe UUID returned for that resource.
A relationship declared as an IRI, such as an entry in a member's groupsThe resource's @id, including its path.
A custom field value's list_fieldThe @id of the field definition returned by the custom fields endpoint.

Use the returned identifiers and the schema for the specific operation. An integer id, a UUID and an IRI are different values; do not substitute one for another or build an IRI from a display name.

For example, the groups property in a member write body accepts IRI strings. An illustrative value looks like this:

{
  "groups": [
    "/audiences/11111111-1111-4111-8111-111111111111/groups/22222222-2222-4222-8222-222222222222"
  ]
}

Use the group's actual @id in your integration. The subscriber guide explains how to change membership while accounting for the groups a member already has.

Read models and write bodies

A response can contain properties that you cannot send back when updating it. For example, a member response includes its identifiers, status and statistics. The write schema describes contact fields and relationships accepted by that particular operation.

Build a write body from the fields you intend to change. Copying an entire GET response into a PUT request can include read-only data and relationship objects where the request expects IRI strings.

The generated reference labels required fields and shows the request schema. Its code examples can include optional fields as well: remove optional fields that your integration does not need and replace the sample values.

JSON-LD and collection responses

Set Accept: application/ld+json when you want JSON-LD responses. The Accept header selects the response format; Content-Type describes a request body you send to the API.

For the audiences and members collection endpoints, JSON-LD gives you:

PropertyMeaning
hydra:memberThe resources returned on the current page. This is a collection key; it can contain audiences as well as members.
hydra:totalItemsThe collection's total number of matching resources, when included.
hydra:viewPagination links such as hydra:next, when included.
@id on a resourceThat resource's IRI.
@type and @contextJSON-LD type and vocabulary information.

Access keys containing : or @ with bracket notation in JavaScript:

const audiences = collection['hydra:member'];
const nextPage = collection['hydra:view']?.['hydra:next'];

For those same collection endpoints, Accept: application/json returns an array according to the HTTP schema. Choose one format deliberately and parse the shape it documents. See Pagination, filters and errors for a complete collection-reading example.

Changing a member's name or group is a different operation from subscribing or unsubscribing that member. A successful data update does not mean that a member is confirmed for email delivery.

Read the returned status and use the dedicated subscription actions when your workflow intends to change it. Email and SMS have separate status fields. Follow the subscriber workflow for double opt-in and the effect of each action.

Using an SDK

The official SDKs expose their own interfaces for resources and collections. For example, an SDK collection can use page.data, while the raw JSON-LD HTTP response uses hydra:member.

Follow the Node.js / TypeScript or PHP guide when using a client library. Use the API Reference when constructing HTTP requests directly.

On this page