Domains API

API link: Swagger UI

Add domains

There are three ways to add domains

  1. Bulk API: https://api.emailconsul.com/api/v1.0/doc/#/Domains/post_domains_add_bulk

  2. Populate API: https://api.emailconsul.com/api/v1.0/doc/#/Domains/post_domains_populate

    It differs from the bulk API in that, along with domains, you can also add all related DKIM selectors.

  3. Import CSV: https://api.emailconsul.com/api/v1.0/doc/#/Domains/post_domains_import

    CSV must contain a "domain" column. CSV may contain an optional "selectors" column related to domain selectors separated by a semicolon.

All of these methods are upserting your domains, which means that if a domain is already added, it will not be added again, preventing duplication.

After adding a domain will have status equal WAITING, and will be sent to validation. When validation is complete, the status will be changed to UPDATED. If anything goes wrong, the status goes to FAILED.

Get a list of domains

To get a list of domains, use the API https://api.emailconsul.com/api/v1.0/doc/#/Domains/get_domains. This API returns the list of domains with all related info (see Domain base model)

Get one domainʼs info

There are two options to get info for some specific domain:

  1. By ID with https://api.emailconsul.com/api/v1.0/doc/#/Domains/get_domains__id_

  2. use the Get List API (https://api.emailconsul.com/api/v1.0/doc/#/Domains/get_domains) with the filter by domain, like

, where we send a request to get info just for example.com domain, and we expect to get just one result by applying limit=1 and offset=0.

Delete domains

To delete a bunch of domains, use the API https://api.emailconsul.com/api/v1.0/doc/#/Domains/delete_domains. With this API, you can delete domains that satisfy a filter from the passed parameters. Without parameters (filters), it removes all domains.

Delete one domain

There are two ways to delete a domain:

Update domain selectors

To update the domain selectors, use https://api.emailconsul.com/api/v1.0/doc/#/Domains/patch_domains__id_. By sending this request, you trigger the validation for this domain right away, and usually, the data for the info is updated within a couple of seconds. While updating, the status goes back to WAITING until validation is complete, and the status is updated to UPDATED.

Refreshing the domain info

By default, the domain updates every 24 hours. In some cases, we want to see the updates now, without waiting ~24 hours to get the updated info (For example, we expect that the domain is no longer blocklisted or dns record is changed). In this scenario, we can use https://api.emailconsul.com/api/v1.0/doc/#/Domains/post_domains__id__refresh. By sending this request, you trigger the validation for this domain right away, and usually, the data for the info is updated within a couple of seconds. While updating, the status goes back to WAITING until validation is complete, and the status is updated to UPDATED.

Export to CSV

Use https://api.emailconsul.com/api/v1.0/doc/#/Domains/get_domains_export to export domains with the related data into CSV. Apply filters if needed.

Domains blocklist changes log

Use https://api.emailconsul.com/api/v1.0/doc/#/Domains/get_domains__id__rbl_changes_log to see when any blocklist information is changed during the time. The info for the domain does not add retroactively; the info is collected after the domain is added and until it is deleted.

Available count API

Use https://api.emailconsul.com/api/v1.0/doc/#/Domains/get_domains_available_count to see how many domains can be added within the current Usage Plan.

Domain base model

{string} id - Unique identifier of the document

{string} status - Current verification status.

Available options:

  • WAITING - when domain info is in a queue for validation

  • UPDATED - when domain info is updated

  • FAILED - if validation fails

{array<object>} dns_lookup_result - Results of DNS lookup checks

{string} ip - associated IP address

{array<object>} rbl_result - Results of RBL (Real-time Blackhole List) checks

{string} lookup_host - The host that was checked against blacklist

{boolean} blacklisted - Whether the domain is blacklisted

NOTE: indicates info regarding the user’s Blocklist settings.

  • If a user sets just a specific blocklist in the Blocklist setting to see, but the current domain is blocklisted in any monitored RBLs, then this flag will be true only if it is selected in the Blocklist settings.

  • If a user has not selected any blocklist in the Blocklist settings yet, then the Blocklist settings will be ignored.

{object} spf - SPF (Sender Policy Framework) verification results

spf fields description:

{array<object>} dkim - array of DKIM (DomainKeys Identified Mail) configurations

dkim fields description:

{object} dmarc - DMARC (Domain-based Message Authentication, Reporting & Conformance) configuration

dmarc fields description:

{Date} updated_at - Timestamp of when the IP info was last updated