Developer Resources
Suppressions
The suppression object
Attributes
- id integer
- Unique identifier for this suppression.
- email string
- The email address being suppressed.
- user_id integer
- Unique identifier of the user being suppressed.
- reason string
-
Type of suppression, which is one of:
Manual
,Unsubscribe
,HardBounce
, orSpamComplaint
- suppressed_at timestamp
- Time at which the email was suppressed.
LIST all suppressions GET /api/v2/betas/{beta_id}/suppressions
Receive a list of all suppressions.
Parameters
- email optional
- Filter the suppressions list by a specific user's email address. Performs an exact match search.
Request
curl -u api_key: https://api.prefinery.com/api/v2/betas/1/suppressions.json \
-d email=leonard@bigbangtheory.com \
-G
Response
HTTP/1.1 200 OK
[
{
"id": 1,
"email": "leonard@bigbangtheory.com",
"user_id": 1,
"reason": "Unsubscribe",
"suppressed_at": "2020-08-15T13:15:01Z"
}
]
CREATE a suppression POST /api/v2/betas/{beta_id}/suppressions
Add an email address to the suppressions list.
Parameters
- email required
- The email address being suppressed.
- reason required
-
Type of suppression, which is either
Manual
orUnsubscribe
. In the case ofUnsubscribe
, where a User with the email address exists, the User will be unsubscribed in addtion to their email address being added to the Suppressions list. The default, if no reason is specified, isManual
.
Request
{
"email": "leonard@bigbangtheory.com",
"reason": "Unsubscribe"
}
Or, using curl:
curl -u api_key: https://api.prefinery.com/api/v2/betas/1/suppressions.json \
-d email=leonard@bigbangtheory.com \
-d reason=Unsubscribe
Response
HTTP/1.1 201 Created
{
"id": 1,
"email": "leonard@bigbangtheory.com",
"user_id": 1,
"reason": "Unsubscribe",
"suppressed_at": "2020-08-15T13:15:01Z"
}
Errors
Code | Description |
---|---|
2701 | A general error has occurred. |
2702 | Email already exists. |
2703 | Email is required. |
DELETE a suppression DELETE /api/v2/betas/{beta_id}/suppressions/1
Delete a Manual
or HardBounce
suppression and reactivate the email address for email delivery.
Attempts to delete an Unsubscribe
or SpamComplaint
suppression will result in a HTTP
422 as these suppressions can only be deleted by contacting Prefinery support.
Request
curl -u api_key: -X DELETE https://api.prefinery.com/api/v2/betas/1/suppressions/1.json
Response
HTTP/1.1 200 OK
{
"id": 1,
"email": "leonard@bigbangtheory.com",
"user_id": 1,
"reason": "Unsubscribe",
"suppressed_at": "2020-08-15T13:15:01Z"
}