Domains (v2)

The base URL for this API is: https://api.leaseweb.com/hosting/v2

Errors

The API uses standard HTTP status codes to indicate the success or failure of the API call. The response will be JSON. Most APIs use the following format:

{
"errorCode" : "APP00800",
"errorMessage" : "The connection with the DB cannot be established.",
"correlationId" : "550e8400-e29b-41d4-a716-446655440000",
"userMessage" : "Cannot handle your request at the moment. Please try again later.",
"reference" : "http://developer.leaseweb.com/errors/APP00800"
}

Authentication

Authentication for the APIs is required. To authenticate your call, you will need to sent your API key as X-LSW-Auth header.

You can generate API keys in the Customer Portal.

Domains

Inspect a domain

Authorizations:
path Parameters
domainName
required
string
Example: 123242

Domain name

Responses

200
401

Authentication is required.

403

Access denied.

404

Resource not found.

500

Internal server error.

503

Service unavailable.

get/domains/{domainName}
https://api.leaseweb.com/hosting/v2/domains/{domainName}

Request samples

Copy
curl --request GET \
  --url https://api.leaseweb.com/hosting/v2/domains/123242 \
  --header 'leaseweb api key: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "domainName": "example.com",
  • "suspended": true,
  • "dnsOnly": true,
  • "status": "SUSPENDED",
  • "contractStartDate": "2017-04-01T00:00:00+02:00",
  • "contractEndDate": "2018-04-01T00:00:00+02:00",
  • "_links":
    {
    }
}

Check availability

Authorizations:
path Parameters
domainName
required
string
Example: 123242

Domain name

Responses

200
401

Authentication is required.

403

Access denied.

404

Resource not found.

500

Internal server error.

503

Service unavailable.

get/domains/{domainName}/available
https://api.leaseweb.com/hosting/v2/domains/{domainName}/available

Request samples

Copy
curl --request GET \
  --url https://api.leaseweb.com/hosting/v2/domains/123242/available \
  --header 'leaseweb api key: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "domainName": "example.com",
  • "available": true,
  • "_links":
    {
    }
}

List nameservers

Authorizations:
path Parameters
domainName
required
string
Example: 123242

Domain name

Responses

200
401

Authentication is required.

403

Access denied.

404

Resource not found.

500

Internal server error.

503

Service unavailable.

get/domains/{domainName}/nameservers
https://api.leaseweb.com/hosting/v2/domains/{domainName}/nameservers

Request samples

Copy
curl --request GET \
  --url https://api.leaseweb.com/hosting/v2/domains/123242/nameservers \
  --header 'leaseweb api key: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "nameservers":
    [
    ],
  • "status": "Nameservers update request is accepted. This request will be processed after 24 hours.",
  • "_links":
    {
    },
  • "_metadata":
    {
    }
}

Update nameservers

Full replacement of all nameservers for a domain.

Please note that the request body should contain at least two nameservers.

Authorizations:
path Parameters
domainName
required
string
Example: 123242

Domain name

Request Body schema: application/json
nameservers
required
Array of objects

Array of nameservers

Responses

200
400

Validation failed. Check the error message and error details for more information.

401

Authentication is required.

403

Access denied.

404

Resource not found.

409

If there is a conflict (for example item is already in processing state), you will receive a 409 Conflict.

500

Internal server error.

503

Service unavailable.

put/domains/{domainName}/nameservers
https://api.leaseweb.com/hosting/v2/domains/{domainName}/nameservers

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "nameservers":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "nameservers":
    [
    ],
  • "status": "Nameservers update request is accepted. This request will be processed after 24 hours.",
  • "_links":
    {
    },
  • "_metadata":
    {
    }
}

Inspect DNS Security (DNSSEC)

Authorizations:
path Parameters
domainName
required
string
Example: 123242

Domain name

Responses

200
401

Authentication is required.

403

Access denied.

404

Resource not found.

422

The domain name is recognized but cannot be processed. This action is not automated for this tld.

500

Internal server error.

503

Service unavailable.

get/domains/{domainName}/dnssec
https://api.leaseweb.com/hosting/v2/domains/{domainName}/dnssec

Request samples

Copy
curl --request GET \
  --url https://api.leaseweb.com/hosting/v2/domains/123242/dnssec \
  --header 'leaseweb api key: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ENABLED",
  • "nsec3":
    {
    },
  • "_links":
    {
    }
}

Update DNS Security (DNSSEC)

Authorizations:
path Parameters
domainName
required
string
Example: 123242

Domain name

Request Body schema: application/json
status
required
string
Enum: "ENABLED" "DISABLED"

Domain DNSSEC status

nsec3
object

NSEC3 is an extension to DNSSEC and it requires DNSSEC to be enabled.

Responses

200

DNSSEC enabled/disabled successfully. It may take up to 25 hours to reflect.

400

Validation failed. Check the error message and error details for more information.

401

Authentication is required.

403

Access denied.

404

Resource not found.

409

If there is a conflict (for example item is already in processing state), you will receive a 409 Conflict.

422

The domain name is recognized but cannot be processed. This action is not automated for this tld.

500

Internal server error.

503

Service unavailable.

put/domains/{domainName}/dnssec
https://api.leaseweb.com/hosting/v2/domains/{domainName}/dnssec

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "ENABLED",
  • "nsec3":
    {
    }
}