How it works
An email domain is the part of an email address that comes after the@ symbol. Your list of email domains will contain all the domains that have been supplied as part of people’s email addresses. It is automatically populated and can’t be modified.
An approved email domain is an email domain that can be supplied as part of someone’s email address when you create a person. If you’re using a product-level API key, your list of approved email domains will be empty by default if no approved email domains have been added by you. You can choose to add domain(s) to your list in order to enable this security feature. If you’re using a user-level API key, this feature is enabled by default.
For example, if your list of approved email domains only includes @example.com, then:
- you’ll be able create a person whose email address is
jane.doe@example.com - you won’t be able to create a person whose email address is
jane.doe@otherexample.comand will receive a400error instead
@otherexample.com, you’ll need to update your list of approved email domains.
You can also remove an approved email domain by updating your list. This won’t affect any existing people who use that domain.
List email domains
GET
/v2/accounts/{accountId}/people/email-domainsRequest
Use this request to retrieve a list of email domains used by people on your account. You can then use the results to update your approved domains.Path parameters
The ID of the account that you want to retrieve a list of email domains for.Allowable values: An existing
accountId (≤ 36 characters)Response
If your request is successful, you’ll receive a200 response containing a list of the email domains that are currently associated with your account.
Update approved email domains
PUT
/v2/accounts/{accountId}/email-domainsRequest
Use this request to update the list of approved email domains associated with a given account. You’ll only be able to create people if their email address contains one of the domains in this list.Path parameters
The ID of the account that you want to update the list of approved email domains for.Allowable values: An existing
accountId (≤ 36 characters)Query parameters
The list of approved email domains. There can be up to 100.Allowable values: An array of valid strings (
^@?([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\.)+[a-zA-Z]{2,}$)Response
If your request is successful, you’ll receive a200 response containing the updated list of approved email domains.
List approved email domains
GET
/v2/accounts/{accountId}/email-domainsRequest
Use this request to retrieve a list of approved email domains associated with a given account. You’ll only be able to create people if their email address contains one of the domains returned in the response.Path parameters
The ID of the account that you want to retrieve a list of approved email domains for.Allowable values: An existing
accountId (≤ 36 characters)Query parameters
The maximum number of items to return. For example,
limit=25. By default, this is set to 100.Allowable values: [ 1 .. 100000 ]The number of items to skip before returning the results. For example,
offset=200. By default, this is set to 0.Allowable values: A valid integerResponse
If your request is successful, you’ll receive a200 response containing a list of approved email domains.