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.
Param | Description |
---|---|
since_id | Return only unsubscribes whose id is after the specified id. Pagination guidance |
limit | Number of unsubscribes to return per request. Must be 1-500 (default: 100) |
Response
This endpoint returns a list of unsubscribe resources.
Field | Type | Description |
---|---|---|
id | integer | Unique id of unsubscribe in LoyaltyLion |
email | string | Email 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:
Field | Type | Required | Description |
---|---|---|---|
email | string | yes | The 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"
}'