Loyalty emails

You can use the loyalty emails API to view and update your list of unsubscribes.

GET /v2/loyalty_emails/unsubscribes

Returns a list of all loyalty email unsubscribes.

Request

You can pass the following optional query parameters with the request.

ParamDescription
since_idReturn only unsubscribes whose id is after the specified id. Pagination guidance
limitNumber of unsubscribes to return per request. Must be 1-500 (default: 100)

Response

This endpoint returns a list of unsubscribe resources.

FieldTypeDescription
idintegerUnique id of unsubscribe in LoyaltyLion
emailstringEmail address of customer who unsubscribed

Example

curl \
  --user 'token:secret' \
  --url 'https://api.loyaltylion.com/v2/loyalty_emails/unsubscribes' \
  --header 'Content-Type: application/json'

POST /v2/loyalty_emails/unsubscribes

Use this endpoint to unsubscribe a customer from your loyalty emails.

Request

You must provide a JSON payload with the following fields:

FieldTypeRequiredDescription
emailstringyesThe email address of the customer.

Response

  • Returns a 201 Created response if the activity was tracked successfully.
  • Returns a 200 OK response if the email address is already unsubscribed.
  • Returns a 422 Unprocessable Entity response if the email address provided is invalid.

Example

curl -X POST \
  --user 'token:secret' \
  --url 'https://api.loyaltylion.com/v2/loyalty_emails/unsubscribes' \
  --header 'Content-Type: application/json'\
  --data '{
    "email":"alice@example.com"
  }'