Api reference MessageFlow
  • Welcome
  • Introduction
  • Authentication
  • REST clients samples
  • Long running actions - Retry-After header explained
  • Input compression
  • Using filters
  • Dynamic e-mail content
  • SMS Billing
  • Incoming webhooks
    • Steps to configure webhooks
    • Step 1: Identify the events to monitor
    • Step 2: Create a webhook endpoint
    • Step 3: Handle requests
    • Step 4: Test that your webhook
    • Step 4: Test your webhook
    • Step 5: Save your webhook configuration
  • External resources
  • Current Version
  • License
  • Groups
  • Contacts
  • Emails
  • Sms
  • Blacklist
  • Campaigns
  • Pushes
Powered by GitBook
On this page

Blacklist

PreviousSmsNextCampaigns

Blacklist API basically allows you to manage email addresses and domains. You can add, update, delete or list receivers addresses or domains on your blacklist. Please be aware that this API can be used only in reference to transactional emails.

Get blacklist domains

get

Use this method to list all domains that are on your blacklist.

Authorizations
Path parameters
smtpstringRequired

The name of your smtp account

Example: 1.test.smtp
Responses
200
Request was successfully processed
application/json
207
Some of request body items were not processed due to validation errors
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/email/domain/blacklist/{smtp}");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    "text"
  ]
}

Add domains to blacklist

post

Use this method to add domains to the blacklist. Each email address with blacklisted domain will be omitted in future transactional email sending.

Authorizations
Path parameters
smtpstringRequired

The name of your smtp account

Example: 1.test.smtp
Body

The domain you want to use in action.

domainstringOptional

Domain to add to blacklist.

Example: domain.com
Responses
200
Request was successfully processed
application/json
207
Some of request body items were not processed due to validation errors
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
post
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "{\"domain\":\"domain.com\"}";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.messageflow.com/v2.1/email/domain/blacklist/{smtp}");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  }
}

Delete domains from blacklist

delete

Use this method to delete domains from the blacklist so addresses email with such domain won’t be omitted in the future transactional email sending.

Authorizations
Path parameters
smtpstringRequired

SMTP account

Example: 1.test.smtp
Body
idstring[]Optional

List of domains that should be deleted from blacklist

Example: domain.com
Responses
200
Request was successfully processed
application/json
207
Some of request body items were not processed due to validation errors
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
delete
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "{\"id\":[\"domain.com\"]}";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Delete, "https://api.messageflow.com/v2.1/email/domain/blacklist/{smtp}");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  }
}

Get blacklisted email addresses

get

Use this method to list all email addresses that are on your blacklist.

Authorizations
Query parameters
offsetintegerOptional

The number of items omitted from the beginning of the list. Default ‘0’.

Default: 0
limitinteger · max: 1000Optional

The maximum number of items returned by request. Default ‘100’. Maximum ‘1000’.

Default: 100
smtpAccountstringOptional

The smtp account name.

Example: 1.test.smtp
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
get
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.messageflow.com/v2.1/email/blacklist?offset=0&limit=100&smtpAccount=1.test.smtp");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "email": "text",
      "smtpAccount": "text",
      "reason": "text",
      "comment": "text",
      "counter": "text",
      "createdAt": 1,
      "updatedAt": 1
    }
  ]
}

Add emails to blacklist

post

Use this method to add email addresses to the blacklist. Each email address in the blacklist will be omitted in future transactional email sending.

Authorizations
Query parameters
emailstringRequired

The email address you want to add to the blacklist.

smtpAccountstringRequired

The name of your smtp account.

reasonstringRequired

The reason for adding the email address to the blacklist. Check all the available reason in List blacklist reasons method.

commentstringOptional

The additional information on the entry.

Responses
200
Request was successfully processed
application/json
207
Some of request body items were not processed due to validation errors
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
post
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.messageflow.com/v2.1/email/blacklist?email=<string>&smtpAccount=<string>&reason=<string>&comment=<string>");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    {
      "email": "text",
      "smtpAccount": "text",
      "reason": "text",
      "comment": "text",
      "counter": "text",
      "createdAt": 1,
      "updatedAt": 1
    }
  ]
}

Delete email addresses from blacklist

delete

Use this method to delete email addresses from the blacklist so they won’t be omitted in the future transactional email sending.

Authorizations
Path parameters
smtpstringRequired

The name of your smtp account.

Example: 1.test.smtp
Body
idstring[]Required

List of emails that should be deleted from blacklist

Example: mail@mail.com
Responses
200
Request was successfully processed
application/json
207
Some of request body items were not processed due to validation errors
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
delete
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "{\"id\":[\"mail@mail.com\"]}";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Delete, "https://api.messageflow.com/v2.1/email/blacklist/{smtp}");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  }
}

List blacklist reasons

options

This method allows you to get list of blacklist reasons. At this moment we have provided 4 reasons which are hardbounce, unsubscribe, spam_complaint and other. Run this method once in a while to check if there are new reasons added.

Authorizations
Responses
200
Request was successfully processed
application/json
401
Authorization data is invalid
application/json
404
Request was successfully processed but no results were returned
application/json
500
Request was not processed due to server error
application/json
options
using System.Threading.Tasks;

internal class Program
{
    private static void Main(string[] args)
    {
        string requestBody = "";

        try {
            using var client = new HttpClient{};
            using var request = new HttpRequestMessage(HttpMethod.Options, "https://api.messageflow.com/v2.1/email/blacklist/reason");

            request.Headers.Add("Authorization", "YourAuthorizationKey");
            request.Headers.Add("Application-Key", "YourApplicationKey");
            request.Content = new StringContent(requestBody, null, "application/json");

            var response = await client.SendAsync(request);
            response.EnsureSuccessStatusCode();
            string content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);

        } catch (HttpRequestException e) {
            Console.WriteLine("\n Exception Caught!\n Message :{0} ", e.Message);
        }
    }
}
{
  "meta": {
    "numberOfErrors": 0,
    "numberOfData": 1,
    "status": 200,
    "uniqId": "00d928f759"
  },
  "data": [
    "text"
  ]
}
  • GETGet blacklist domains
  • POSTAdd domains to blacklist
  • DELETEDelete domains from blacklist
  • GETGet blacklisted email addresses
  • POSTAdd emails to blacklist
  • DELETEDelete email addresses from blacklist
  • OPTIONSList blacklist reasons