BrazeEx.Api.EmailListsAddresses (braze_ex v1.0.22)

API calls for all endpoints tagged EmailListsAddresses.

Link to this section Summary

Functions

Blacklist Email Addresses

Use this endpoint to unsubscribe a user from email and mark them as hard bounced.

Blocklist Email Addresses

Use this endpoint to unsubscribe a user from email and mark them as hard bounced.

Remove Hard Bounced Emails

Use this endpoint to remove email addresses from your Braze bounce list and bounce list maintained by your email provider.

Query Hard Bounced Emails

Use this endpoint to pull a list of email addresses that have “hard bounced” your email messages within a certain time frame.

Remove Email Addresses from Spam List

Use this endpoint to remove email addresses from your Braze spam list and spam list maintained by your email provider.

Change Email Subscription Status

Use this endpoint to set the email subscription state for your users. Users can be opted_in, unsubscribed, or subscribed (not specifically opted in or out).

Query List of Unsubscribed Email Addresses

Use this endpoint to return emails that have unsubscribed during the time period from start_date to end_date.

Link to this section Functions

Link to this function

email_blacklist_post(connection, opts \\ [])

@spec email_blacklist_post(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

blacklist-email-addresses

Blacklist Email Addresses

Use this endpoint to unsubscribe a user from email and mark them as hard bounced.

prerequisites

Prerequisites

To use this endpoint, you’ll need an API key with the email.blacklist permission.

rate-limit

Rate limit

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

request-parameters

Request parameters

ParameterRequiredData TypeDescription
emailRequiredString or arrayString email address to blacklist, or an array of up to 50 email addresses to blocklist.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :"Content-Type" (String.t):
    • :Authorization (String.t):
    • :body (String.t):

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

email_blocklist_post(connection, opts \\ [])

@spec email_blocklist_post(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

blocklist-email-addresses

Blocklist Email Addresses

Use this endpoint to unsubscribe a user from email and mark them as hard bounced.

prerequisites

Prerequisites

To use this endpoint, you’ll need an API key with the email.blacklist permission.

rate-limit

Rate limit

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

request-parameters

Request parameters

ParameterRequiredData TypeDescription
emailRequiredString or arrayString email address to blacklist, or an array of up to 50 email addresses to blocklist.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :"Content-Type" (String.t):
    • :Authorization (String.t):
    • :body (String.t):

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

email_bounce_remove_post(connection, opts \\ [])

@spec email_bounce_remove_post(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

remove-hard-bounced-emails

Remove Hard Bounced Emails

Use this endpoint to remove email addresses from your Braze bounce list and bounce list maintained by your email provider.

prerequisites

Prerequisites

To use this endpoint, you’ll need an API key with the email.bounce.remove permission.

rate-limit

Rate limit

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

request-parameters

Request parameters

ParameterRequiredData TypeDescription
emailRequiredString or arrayString email address to modify, or an array of up to 50 email addresses to modify.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :"Content-Type" (String.t):
    • :Authorization (String.t):
    • :body (String.t):

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

email_hard_bounces_get(connection, opts \\ [])

@spec email_hard_bounces_get(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

query-hard-bounced-emails

Query Hard Bounced Emails

Use this endpoint to pull a list of email addresses that have “hard bounced” your email messages within a certain time frame.

Note: You must provide an end_date, as well as either an email or a start_date. If you provide all three, start_date, end_date, and an email, we prioritize the emails given and disregard the date range.

If your date range has more than limit number of hard bounces, you will need to make multiple API calls, each time increasing the offset until a call returns either fewer than limit or zero results.

prerequisites

Prerequisites

To use this endpoint, you’ll need an API key with the email.hard_bounces permission.

rate-limit

Rate limit

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

example-request

Example request

curl --location --request GET 'https://rest.iad-01.braze.com/email/hard_bounces?start_date=2019-01-01&end_date=2019-02-01&limit=100&offset=1&email=example@braze.com' --header 'Authorization: Bearer YOUR-API-KEY-HERE'

response

Response

Entries are listed in descending order.

Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
"emails": [
  {
    "email": "example1@braze.com",
    "hard_bounced_at": "2016-08-25 15:24:32 +0000"
  },
  {
    "email": "example2@braze.com",
    "hard_bounced_at": "2016-08-24 17:41:58 +0000"
  },
  {
    "email": "example3@braze.com",
    "hard_bounced_at": "2016-08-24 12:01:13 +0000"
  }
],
"message": "success"
}

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :Authorization (String.t):
    • :start_date (String.t): (Optional) String in YYYY-MM-DD format Start date of the range to retrieve hard bounces, must be earlier than end_date. This is treated as midnight in UTC time by the API. You must provide either an email or a start_date, and an end_date.
    • :end_date (String.t): (Optional) String in YYYY-MM-DD format String in YYYY-MM-DD format. End date of the range to retrieve hard bounces. This is treated as midnight in UTC time by the API. You must provide either an email or a start_date, and an end_date.
    • :limit (integer()): (Optional) Integer Optional field to limit the number of results returned. Defaults to 100, maximum is 500.
    • :offset (integer()): (Optional) Integer Optional beginning point in the list to retrieve from.
    • :email (String.t): (Optional) String If provided, we will return whether or not the user has hard bounced. You must provide either an email or a start_date, and an end_date.

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

email_spam_remove_post(connection, opts \\ [])

@spec email_spam_remove_post(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

remove-email-addresses-from-spam-list

Remove Email Addresses from Spam List

Use this endpoint to remove email addresses from your Braze spam list and spam list maintained by your email provider.

prerequisites

Prerequisites

To use this endpoint, you’ll need an API key with the email.spam.remove permission.

rate-limit

Rate limit

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

request-parameters

Request parameters

ParameterRequiredData TypeDescription
emailRequiredString or arrayString email address to modify, or an array of up to 50 email addresses to modify.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :"Content-Type" (String.t):
    • :Authorization (String.t):
    • :body (String.t):

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

email_status_post(connection, opts \\ [])

@spec email_status_post(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

change-email-subscription-status

Change Email Subscription Status

Use this endpoint to set the email subscription state for your users. Users can be opted_in, unsubscribed, or subscribed (not specifically opted in or out).

You can set the email subscription state for an email address that is not yet associated with any of your users within Braze. When that email address is subsequently associated with a user, the email subscription state that you uploaded will be automatically set.

prerequisites

Prerequisites

To use this endpoint, you’ll need an API key with the email.status permission.

rate-limit

Rate limit

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

request-parameters

Request parameters

ParameterRequiredData TypeDescription
emailRequiredString or arrayString email address to modify, or an array of up to 50 email addresses to modify.
subscription_stateRequiredStringEither “subscribed”, “unsubscribed”, or “opted_in”.

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :"Content-Type" (String.t):
    • :Authorization (String.t):
    • :body (String.t):

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

email_unsubscribes_get(connection, opts \\ [])

@spec email_unsubscribes_get(
  Tesla.Env.client(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

query-list-of-unsubscribed-email-addresses

Query List of Unsubscribed Email Addresses

Use this endpoint to return emails that have unsubscribed during the time period from start_date to end_date.

You can use this endpoint to set up a bi-directional sync between Braze and other email systems or your own database.

Note: You must provide an end_date, as well as either an email or a start_date.

If your date range has more than limit number of unsubscribes, you will need to make multiple API calls, each time increasing the offset until a call returns either fewer than limit or zero results.

prerequisites

Prerequisites

To use this endpoint, you’ll need an API key with the email.unsubscribe permission.

rate-limit

Rate limit

We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.

example-request

Example request

curl --location --request GET 'https://rest.iad-01.braze.com/email/unsubscribes?start_date=2020-01-01&end_date=2020-02-01&limit=1&offset=1&sort_direction=desc&email=example@braze.com' --header 'Authorization: Bearer YOUR-API-KEY-HERE'

response

Response

Entries are listed in descending order.

Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
"emails": [
  {
    "email": "example1@braze.com",
    "unsubscribed_at": "2016-08-25 15:24:32 +0000"
  },
  {
    "email": "example2@braze.com",
    "unsubscribed_at": "2016-08-24 17:41:58 +0000"
  },
  {
    "email": "example3@braze.com",
    "unsubscribed_at": "2016-08-24 12:01:13 +0000"
  }
],
"message": "success"
}

parameters

Parameters

  • connection (BrazeEx.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :Authorization (String.t):
    • :start_date (String.t): (Optional*) String in YYYY-MM-DD format Start date of the range to retrieve unsubscribes, must be earlier than end_date. This is treated as midnight in UTC time by the API.
    • :end_date (String.t): (Optional*) String in YYYY-MM-DD format End date of the range to retrieve unsubscribes. This is treated as midnight in UTC time by the API.
    • :limit (integer()): (Optional) Integer Optional field to limit the number of results returned. Limit must be greater than 1. Defaults to 100, maximum is 500.
    • :offset (integer()): (Optional) Integer Optional beginning point in the list to retrieve from.
    • :sort_direction (String.t): (Optional) String Pass in the value asc to sort unsubscribes from oldest to newest. Pass in desc to sort from newest to oldest. If sort_direction is not included, the default order is newest to oldest.
    • :email (String.t): (Optional*) String If provided, we will return whether or not the user has unsubscribed.

returns

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure