Skip to content

Sender Domains

NOTICE

Email Gateway email sender domain API end-points are documented under Email Gateway section.

Retrieve DNS Provider Information

GET /api/v1/dns.provider

This endpoint retrieves the DNS provider information for the specified domain.

Request Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
DomainThe domain for which to retrieve DNS provider informationYes
bash
curl -X GET http://example.com/api/v1/dns.provider \
  -H "Content-Type: application/json" \
  -d '{
        "SessionID": "exampleSessionId",
        "Domain": "exampledomain.com"
      }'
json
{
  "provider": "namecheap"
}
json
{
  "Errors": [
    {
      "Code": 1,
      "Message": "Missing Domain parameter"
    }
  ]
}
txt
1: Missing domain parameter
2: Unable to determine DNS provider for this domain

NOTICE

As of writing, only supported DNS providers are Namecheap, GoDaddy and CloudFlare. We will continue adding more providers in the future.

Authorize DNS Management for a Domain

POST /api/v1/dns.authorize

This endpoint authorizes the user to manage the DNS records for the specified domain.

Request Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
ProviderThe DNS provider for which to authorize DNS management (e.g. "namecheap", "godaddy", "cloudflare")Yes
DomainFully qualified domain name (FQDN) for which to authorize DNS managementYes
Api_keyAPI key for the DNS providerYes
Api_secretAPI secret for the DNS providerNo
Api_userAPI user for the DNS providerNo
UseranemUsername for the DNS providerNo
bash
# CloudFlare
curl -X GET http://example.com/api/v1/dns.authorize \
  -H "Content-Type: application/json" \
  -d '{
        "SessionID": "fakeSessionID12345",
        "Provider": "cloudflare",
        "Domain": "exampledomain.com",
        "Api_key": "fakeApiKey12345"
      }'

# Namecheap
curl -X GET http://example.com/api/v1/dns.authorize \
  -H "Content-Type: application/json" \
  -d '{
        "SessionID": "fakeSessionID12345",
        "Provider": "namecheap",
        "Domain": "exampledomain.com",
        "Api_key": "fakeApiKey12345",
        "Api_user": "fakeUser123",
        "Username": "fakeUser123"
      }'

# GoDaddy
curl -X GET http://example.com/api/v1/dns.authorize \
  -H "Content-Type: application/json" \
  -d '{
        "SessionID": "fakeSessionID67890",
        "Provider": "godaddy",
        "Domain": "anotherexample.com",
        "Api_key": "fakeApiKey67890",
        "Api_secret": "fakeApiSecret67890"
      }'
json
{
  "success":true
}
json
{
  "Errors": [
    {
      "Code": 1,
      "Message": "Missing Domain parameter"
    }
  ]
}
txt
1: Missing domain parameter
2: Missing API key parameter
3: Missing provider parameter
4: Authorization failed for this DNS provider
5: Missing API secret parameter
6: Missing API user parameter
7: Missing username parameter
8: Unsupported provider: {provider}
9: An error occurred during authorization: {error}

NOTICE

As of writing, only supported DNS providers are Namecheap, GoDaddy and CloudFlare. We will continue adding more providers in the future.

Set DNS Records for a Domain

POST /api/v1/dns.set

This API endpoint sets the DNS records for the specified domain on the specified DNS provider.

Request Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
ProviderThe DNS provider for which to authorize DNS management (e.g. "namecheap", "godaddy", "cloudflare")Yes
DomainFully qualified domain name (FQDN) for which to set DNS recordsYes
Api_keyAPI key for the DNS providerYes
Api_secretAPI secret for the DNS providerNo
Api_userAPI user for the DNS providerNo
UseranemUsername for the DNS providerNo
Record_typeType of DNS record set (campaign or email-gateway)Yes
bash
# CloudFlare
curl -X GET http://example.com/api/v1/dns.set \
  -H "Content-Type: application/json" \
  -d '{
        "SessionID": "fakeSessionID98765",
        "Provider": "cloudflare",
        "Domain": "yetanotherexample.com",
        "Api_key": "fakeCloudflareKey98765",
        "Record_type": "campaign"
      }'
      
# Namecheap
curl -X GET http://example.com/api/v1/dns.set \
  -H "Content-Type: application/json" \
  -d '{
        "SessionID": "fakeSessionID12345",
        "Provider": "namecheap",
        "Domain": "exampledomain.com",
        "Api_key": "fakeApiKey12345",
        "Record_type": "campaign",
        "Api_user": "fakeUser123",
        "Username": "fakeUser123"
      }'

# GoDaddy
curl -X GET http://example.com/api/v1/dns.set \
  -H "Content-Type: application/json" \
  -d '{
        "SessionID": "fakeSessionID67890",
        "Provider": "godaddy",
        "Domain": "anotherexample.com",
        "Api_key": "fakeApiKey67890",
        "Record_type": "campaign",
        "Api_secret": "fakeApiSecret67890"
      }'
json
{
  "success":true
}
json
{
  "Errors": [
    {
      "Code": 1,
      "Message": "Missing Domain parameter"
    }
  ]
}
txt
1: Missing domain parameter
2: Missing API key parameter
3: Missing provider parameter
4: Missing record type parameter (e.g. "campaign", "email-gateway")
5: Missing API secret parameter
6: Missing API user parameter
7: Missing username parameter
8: Unsupported provider: {provider}
9: Failed to set DNS records for this domain
10: {system exception error}

NOTICE

As of writing, only supported DNS providers are Namecheap, GoDaddy and CloudFlare. We will continue adding more providers in the future.

Any questions? Contact us.