Add a new domain to the list of blocked domains

Blocks a new domain in order to avoid messages being sent to the same

const SibApiV3Sdk = require('sib-api-v3');
 
const apiInstance = new SibApiV3Sdk.TransactionalEmailsApi();

// Configure API key authorization: api-key

const apiKey = apiInstance.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';

const blockDomain = new SibApiV3Sdk.BlockDomain();
blockDomain.domain = 'https://mydomain.com';

apiInstance.blockNewDomain(blockDomain).then(function(data) {
  console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, function(error) {
  console.error(error);
});
const SibApiV3Sdk = require('sib-api-v3-typescript');
 
const apiInstance = new SibApiV3Sdk.TransactionalEmailsApi();

// Configure API key authorization: api-key

const apiKey = apiInstance.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';

const blockDomain = new SibApiV3Sdk.BlockDomain();
blockDomain.domain = 'https://mydomain.com';

apiInstance.blockNewDomain(blockDomain).then(function(data) {
  console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, function(error) {
  console.error(error);
});
package sibApi;

import sendinblue.ApiClient;
import sendinblue.Configuration;
import sendinblue.auth.ApiKeyAuth;
import sibModel.*;

public class Program {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure API key authorization: api-key
        ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("api-key");
        apiKey.setApiKey("YOUR API KEY");
        try {
            TransactionalEmailsApi api = new TransactionalEmailsApi();
            BlockDomain blockDomain = new BlockDomain();
            blockDomain.setDomain("https://mydomain.com");
            api.blockNewDomain(blockDomain);
        } catch (Exception e) {
            System.out.println("Exception occurred:- " + e.getMessage());
        }
    }
}
using sib_api_v3_sdk.Api;
using sib_api_v3_sdk.Client;
using sib_api_v3_sdk.Model;
using System;
using System.Diagnostics;

namespace Sendinblue
{
    class Program
    {
        static void Main(string[] args)
        {
            Configuration.Default.ApiKey.Add("api-key", "YOUR API KEY");

            var apiInstance = new TransactionalEmailsApi();
            string domain = "https://mydomain.com";
            var blockDomain = new BlockDomain(domain);
            try
            {
                apiInstance.BlockNewDomain(blockDomain);
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
                Console.WriteLine(e.Message);
                Console.ReadLine();
            }
        }
    }
}
Language
Authorization
Header
Click Try It! to start a request and see the response here!