Lists

Filter emails by allowing or blocking specific addresses and domains.

What are Lists?

Lists allow you to filter emails by allowing or blocking specific email addresses or domains. There are four list types based on two dimensions:

  • Direction: send or receive
  • Type: allow or block
ListDescription
Receive allowOnly accept emails from these addresses or domains
Receive blockReject emails from these addresses or domains
Send allowOnly send emails to these addresses or domains
Send blockPrevent sending emails to these addresses or domains

Each entry can be either a full email address (e.g., partner@example.com) or an entire domain (e.g., example.com).

SDK examples

List entries

Retrieve entries from a list with optional pagination.

1entries = client.lists.list("receive", "allow", limit=10)

Create entry

Add an email address or domain to a list. The reason parameter is optional and available on block lists.

1# allow list - no reason needed
2client.lists.create("receive", "allow", entry="partner@example.com")
3
4# block list - reason optional
5client.lists.create("receive", "block", entry="spam@example.com", reason="spam")

Get entry

Retrieve a specific entry from a list by its email address or domain.

1entry = client.lists.get("receive", "allow", entry="partner@example.com")

Delete entry

Remove an entry from a list.

1client.lists.delete("receive", "allow", entry="partner@example.com")