Email

Register email channel

Changed on

Create a new email channel or update an existing channel. If you provide the email address of an existing channel, the call is treated as a PUT. To update the address of an existing channel, see the Replace Email Channel endpoint.

post/api/channels/email

Request

Request body

attributesobject

An optional object containing the customer-provided attributes associated with the email.

opt_in_mode'classic' | 'double'

The opt-in mode for registering the channel. classic is the default when unspecified, double creates a double_opt_in event.

propertiesobject

An object containing event properties. You can use these properties to filter the double opt-in event and reference them in your message content by using handlebars. Items in the properties object are limited to a 255-character maximum string length.

tag_operationsTagGroupObject

Tag groups appear within the tags object for a named user or the tag_groups object for a channel.

ua_ is a reserved prefix for Airship-specific tag groups. See Device property tags.

Example request

{
  "channel": {
    "address": "name@example.com",
    "locale_country": "US",
    "locale_language": "en",
    "timezone": "America/Los_Angeles",
    "type": "email"
  },
  "opt_in_mode": "double",
  "properties": {
    "interests": "newsletter"
  }
}

Response

An existing email channel was found matching the address and was updated.

channel_idstring uuid

A unique string identifying the email channel.

okboolean required

If true, the operation was successful. If false, other properties defined here will not necessarily be present.

Example response

{
  "channel_id": "ef625038-70a3-41f1-826f-57bc11dd625a"
}

Changes

    • warning

      removed the request property

    • info

      added the new optional request property

    This list may be incomplete.

    • breaking

      the / request property format changed from no format to date-time

    • breaking

      the / request property format changed from no format to date-time

    • breaking

      the / request property format changed from no format to date-time

    • breaking

      the / request property format changed from no format to date-time

    This list may be incomplete.