Wooxy API v.3.0

Create Domain

The Create Domain method allows you to create a domain without the need to use the admin panel. It provides all the necessary DNS records that need to be added on your side.

IMPORTANT: In this method, you can use a Webhook URI to receive a request about the domain creation along with additional data. However, it is important to note that the webhook is triggered when the domain has been fully created in the system and all necessary records have been generated.

Request

POST
https://api.wooxy.com/v3/domain/create

IMPORTANT: Do not send more than 10 concurrent API requests.

Body Example

                                        {
            "domain": "YOUR_DOMAIN",
            "webHookUri": "YOUR_WEBHOOK_URI"
        }
                                    

Parameters

Title Type Default Description

domain

required
string

The domain you want to add to our system and use for sending emails.

webHookUri

optional
string

The URL where you will receive the webhook with information that the domain has been created and all necessary records have been generated.

Important! The webhook is sent when the domain is fully created and all records have been generated.

Response

                                        {
  "result": true,
  "data": {
    "id": "YOUR_DOMAIN_ID",
    "domain": "YOUR_DOMAIN",
    "dnsSubdomain": "YOUR_SUBDOMAIN",
    "emailVerified": false,
    "dnsVerified": false,
    "warmupStatus": 1,
    "warmupDay": 0,
    "createdAt": "2013-07-13 13:43:31",
    "dnsRecords": [
      {
        "type": "RECORD_TYPE",
        "name": "RECORD_NAME",
        "value": "RECORD_VALUE"
      },
      {
        "type": "RECORD_TYPE",
        "name": "RECORD_NAME",
        "value": "RECORD_VALUE"
      },
      {
        "type": "RECORD_TYPE",
        "name": "RECORD_NAME",
        "value": "RECORD_VALUE"
      }
    ]
  }
}

                                    

Parameters

Title Type Description

result

boolean

Indicated that the query was successful or not:

  • true: The value indicates that the query was successful.
  • false: The value indicates that the query wasn't successful.

data

object

Object with data about the domain being created.

data.id

string

Unique identifier of the created domain.

data.domain

string

Domain name added to Wooxy. It will be used in From Email address.

data.dnsSubdomain

string

Subdomain that will be delegated to Wooxy as your account's technical domain for sending messages, hosting tracking links, and serving branding images.

data.emailVerified

boolean

Information about whether the domain has been verified using domain email.

data.dnsVerified

boolean

Information about whether the domain has been verified using provided DNS records.

data.warmupStatus

integer

Information about whether your domain is on warming: 

  • 1 - yes
  •  0 - no.

data.warmupDay

integer

The warm-up day of the domain. Domain warm-up begins automatically upon domain addition.

data.createdAt

string

The domain creation date.

data.dnsRecords

array

An array of objects with the necessary DNS records, including all the required data to be added on your side for domain verification.

data.dnsRecords.type

string

The DNS record type that must be added to your domain's DNS settings in your hosting service.

data.dnsRecords.name

string

The DNS record name that must be added to your domain's DNS settings in your hosting service. When adding the record, the name must be exactly as received in the webhook.

data.dnsRecords.value

string

The DNS record value that must be added to your domain's DNS settings in your hosting service. When adding the record, the value must be exactly as received in the response.

Method Errors

                                        {
  "result": false,
  "errors": [
    "Error Description"
  ]
}
                                    
Error

"Argument domain must be a non-empty string"

"Argument domain must be a valid domain name"

"Domain {domain} is already registered"

"Domain {domain} is on removing stage. Try to create it later"

"Domain {domain} is a registered ESP"

"Domain {domain} has unknown TLD"

"Domains limit {limit} is reached"

"Argument webHookUri must be a non-empty string"

"Argument webHookUri must be a valid URI"

"Argument webHookUri can not be longer than 2048"

"Invalid authorization token!"

"Internal server error"

"Bad Request"

"no matches found for access token {accessToken}"

"user {id} not enabled"

"no data found for key {userId}"

"access token check failed for key/secret $key/$accessToken"

"Argument {argument} required"

Code Examples

PHP
                $accessToken = 'YOUR_API_KEY';
$url = 'https://api.wooxy.com/v3/domain/create';

$body = json_encode([
    'domain' => 'YOUR_DOMAIN',
    'webHookUri' => 'YOUR_WEBHOOK_URI',
]);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Access-Token: $accessToken",
    'Content-Type: application/json',
    'Content-Length: ' . strlen($body),
]);

$result = curl_exec($ch);

if ($result === false) {
    echo 'cURL error: ' . curl_error($ch) . PHP_EOL;
} else {
    echo strval($result) . PHP_EOL;
}

curl_close($ch);