There are three ways to add IPs
Bulk API: https://api.emailconsul.com/api/v1.0/doc/#/Ips/post_ips_add_bulk
Add IPs within netmask: https://api.emailconsul.com/api/v1.0/doc/#/Ips/post_ips_add_netmask
Import CSV: https://api.emailconsul.com/api/v1.0/doc/#/Ips/post_ips_import
All of these methods are upserting your IPs, which means that if an IP is already added, it will not be added again, preventing duplication.
After adding an IP 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.
To get a list of IPs, use the API https://api.emailconsul.com/api/v1.0/doc/#/Ips/get_ips. This API returns the list of IPs with all related info (see IP base model)
To get info for some specific IP, use theGet List API (https://api.emailconsul.com/api/v1.0/doc/#/Ips/get_ips) with the filter by IP, like
, where we send a request to get info just for1.1.1.1 IP, and we expect to get just one result by applying limit=1 and offset=0.
To delete a bunch of IPs, use the API https://api.emailconsul.com/api/v1.0/doc/#/Ips/delete_ips. With this API, you can delete IPs that satisfy a filter from passed parameters. Without parameters (filters) it will remove all IPs.
There are two ways to delete an IP:
By ID with https://api.emailconsul.com/api/v1.0/doc/#/Ips/delete_ips__id_
By using the Delete Many API (https://api.emailconsul.com/api/v1.0/doc/#/Ips/delete_ips)
To delete some specific IP, use the Delete Many API with the filter by IP, like
, where we send a request to delete 1.1.1.1 IP
By default, the IP 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 IP is no longer blocklisted or dns record is changed). In this scenario, we can use https://api.emailconsul.com/api/v1.0/doc/#/Ips/post_ips__id__refresh. By sending this request, you trigger the validation for this IP 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.
Use https://api.emailconsul.com/api/v1.0/doc/#/Ips/get_ips_export to export IPs with the related data into CSV. Apply filters if needed.
Use https://api.emailconsul.com/api/v1.0/doc/#/Ips/get_ips__id__rbl_changes_log to see when any blocklist information is changed during the time. The info for the IP does not add retroactively; the info is collected after the IP is added and until it is deleted.
Use https://api.emailconsul.com/api/v1.0/doc/#/Ips/get_ips_available_count to see how many IPs can be added within the current Usage Plan.
{string} id - Unique identifier of the document
{string} ip - IP address
{string} status - Current verification status.
Available options:
WAITING - when IP info is in queue for validation
UPDATED - when IP info is updated
FAILED - if validation fails
{array<object>} dns_lookup_result - Results of DNS lookup checks
{string} rDNS - Reverse DNS lookup result
{string} addresses - Array of associated IP addresses
{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 IP 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 IP 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.
{boolean} wrong_rdns - Whether reverse DNS is incorrect
{Date} updated_at - Timestamp of when the IP info was last updated