Skip to Content
sesameSend

Suppressions

Create and manage Suppressions

Retrieve a list of suppressions

GET /suppressions

Query parameters

NameTypeRequiredDescription
origin"bounce" | "complaint" | "manual"noFilter suppressions by origin.
limitintegernoNumber of items to return.
afterstringnoReturn items after this cursor.
beforestringnoReturn items before this cursor.

Example

curl -X GET "$SESAMESEND_URL/suppressions" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "list",
  "has_more": true,
  "data": [
    {
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
      "email": "ada@example.com",
      "origin": "manual",
      "source_id": "479e3145-dd38-476b-932c-529ceb705947",
      "created_at": "2023-10-06 23:47:56.678+00"
    }
  ]
}

Create a suppression

POST /suppressions

Body

FieldTypeRequiredDescription
emailstringyesEmail address to suppress.

Example

curl -X POST "$SESAMESEND_URL/suppressions" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "ada@example.com"
}'

Responses

StatusDescription
201OK
{
  "object": "suppression",
  "id": "e169aa45-1ecf-4183-9955-b1499d5701d3"
}

Add up to 100 suppressions at once

POST /suppressions/batch/add

Body

FieldTypeRequiredDescription
emailsstring[]yesEmail addresses to suppress.

Example

curl -X POST "$SESAMESEND_URL/suppressions/batch/add" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "emails": [
    "ada@example.com"
  ]
}'

Responses

StatusDescription
201OK
{
  "data": [
    {
      "object": "suppression",
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3"
    }
  ]
}

Remove up to 100 suppressions at once

POST /suppressions/batch/remove

Body

FieldTypeRequiredDescription
emailsstring[]noEmail addresses to remove from the suppression list.
idsstring[]noSuppression IDs to remove from the suppression list.

Example

curl -X POST "$SESAMESEND_URL/suppressions/batch/remove" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "emails": [
    "ada@example.com"
  ],
  "ids": [
    "e169aa45-1ecf-4183-9955-b1499d5701d3"
  ]
}'

Responses

StatusDescription
200OK
{
  "data": [
    {
      "object": "suppression",
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
      "deleted": true
    }
  ]
}

Retrieve a single suppression by ID or email

GET /suppressions/{suppression}

Path parameters

NameTypeRequiredDescription
suppressionstringyesThe Suppression ID or email address.

Example

curl -X GET "$SESAMESEND_URL/suppressions/<suppression>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "suppression",
  "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
  "email": "ada@example.com",
  "origin": "manual",
  "source_id": "479e3145-dd38-476b-932c-529ceb705947",
  "created_at": "2023-10-06 23:47:56.678+00"
}

Remove a single suppression by ID or email

DELETE /suppressions/{suppression}

Path parameters

NameTypeRequiredDescription
suppressionstringyesThe Suppression ID or email address.

Example

curl -X DELETE "$SESAMESEND_URL/suppressions/<suppression>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "suppression",
  "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
  "deleted": true
}