The base URL for this API is: https://api.leaseweb.com/hosting/v2
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 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.
domainName required | string Example: example.com Domain name |
Authentication is required.
Access denied.
Resource not found.
Internal server error.
Service unavailable.
curl --request GET \ --url https://api.leaseweb.com/hosting/v2/domains/example.com \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "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": {
- "self": {
- "href": "/domains/example.com"
}, - "collection": {
- "href": "/domains"
}, - "catchAll": {
- "href": "/domains/example.com/catchAll"
}, - "contacts": {
- "href": "/domains/example.com/contacts"
}, - "nameservers": {
- "href": "/domains/example.com/nameservers"
}, - "emailAliases": {
- "href": "/domains/example.com/emailAliases"
}, - "forwards": {
- "href": "/domains/example.com/forwards"
}, - "mailboxes": {
- "href": "/domains/example.com/mailboxes"
}, - "resourceRecordSets": {
- "href": "/domains/example.com/resourceRecordSets"
}, - "validateZone": {
- "href": "/domains/example.com/validateZone"
}
}
}
domainName required | string Example: example.com Domain name |
Authentication is required.
Access denied.
Resource not found.
Internal server error.
Service unavailable.
curl --request GET \ --url https://api.leaseweb.com/hosting/v2/domains/example.com/available \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "domainName": "example.com",
- "available": true,
- "_links": {
- "self": {
- "href": "/domains/example.com/available"
}
}
}
domainName required | string Example: example.com Domain name |
Authentication is required.
Access denied.
Resource not found.
Internal server error.
Service unavailable.
curl --request GET \ --url https://api.leaseweb.com/hosting/v2/domains/example.com/nameservers \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "nameservers": [
- {
- "name": "ns1.example.com"
}, - {
- "name": "ns2.example.net"
}
], - "status": "Nameservers update request is accepted. This request will be processed after 24 hours.",
- "_links": {
- "self": {
- "href": "/domains/{domainNam}/nameservers"
}
}, - "_metadata": {
- "totalCount": 4
}
}
Full replacement of all nameservers for a domain.
Please note that the request body should contain at least two nameservers.
domainName required | string Example: example.com Domain name |
nameservers required | Array of objects Array of nameservers |
Validation failed. Check the error message and error details for more information.
Authentication is required.
Access denied.
Resource not found.
If there is a conflict (for example item is already in processing state), you will receive a 409 Conflict.
Internal server error.
Service unavailable.
{- "nameservers": [
- {
- "name": "ns1.example.com"
}, - {
- "name": "ns2.example.net"
}
]
}
{- "nameservers": [
- {
- "name": "ns1.example.com"
}, - {
- "name": "ns2.example.net"
}
], - "status": "Nameservers update request is accepted. This request will be processed after 24 hours.",
- "_links": {
- "self": {
- "href": "/domains/{domainNam}/nameservers"
}
}, - "_metadata": {
- "totalCount": 4
}
}
Retrieve the DNSSEC status for your domain.
domainName required | string Example: example.com Domain name |
Authentication is required.
Access denied.
Resource not found.
The domain name is recognized but cannot be processed. This action is not automated for this tld.
Internal server error.
Service unavailable.
curl --request GET \ --url https://api.leaseweb.com/hosting/v2/domains/example.com/dnssec \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "status": "ENABLED",
- "nsec3": {
- "active": true
}, - "_links": {
- "self": {
- "href": "/domains/example.com/dnssec"
}
}
}
Enable or Disable DNSSEC for your domain.
Please note : If you are using Leaseweb nameservers we will add DNSSEC keys automatically when enabling DNSSEC. If you are managing your own nameservers (non-leaseweb nameservers) then you can add your own keys as shown in example.
domainName required | string Example: example.com Domain name |
status required | string Enum: "ENABLED" "DISABLED" Domain DNSSEC status |
nsec3 | object NSEC3 is an extension to DNSSEC and it requires DNSSEC to be enabled. |
dnssecKeys | Array of objects Add DNSSEC keys only when you have non-leaseweb nameservers. |
DNSSEC enabled/disabled successfully. It may take up to 25 hours to reflect.
Validation failed. Check the error message and error details for more information.
Authentication is required.
Access denied.
Resource not found.
If there is a conflict (for example item is already in processing state), you will receive a 409 Conflict.
The domain name is recognized but cannot be processed. This action is not automated for this tld.
Internal server error.
Service unavailable.