The base URL for this API is: https://api.leaseweb.com/account/v1
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.
Authentication is required.
curl --request GET \ --url https://api.leaseweb.com/account/v1/details \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "name": "Leaseweb",
- "email": "support@leaseweb.com",
- "vatNumber": "vat1234134",
- "resellerTier": "resellerTier",
- "phone": {
- "countryCode": "NL",
- "dialCode": "+31",
- "number": "123456789"
}, - "address": {
- "city": "Amsterdam",
- "country": "Netherlands",
- "state": "",
- "stateCode": "",
- "street": "luttenbergweg",
- "houseNumber": "8",
- "postalCode": "1101 EC"
}
}
For a USA customer the state code is required.
address required | object Address |
If the information is successfully updated, a 204 No Content
is returned.
Authentication is required.
{- "address": {
- "city": "New York",
- "street": "Wallstreet",
- "stateCode": "NY",
- "houseNumber": "1",
- "postalCode": "10005"
}
}
{- "errorCode": "ACCESS_DENIED",
- "errorMessage": "The access token is expired or invalid."
}
curl --request GET \ --url https://api.leaseweb.com/account/v1/contacts \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "contacts": [
- {
- "id": "1",
- "firstName": "John",
- "lastName": "Doe",
- "description": "Mr.",
- "email": "john@doe.com",
- "phone": {
- "number": "682212341",
- "dialCode": "+31",
- "countryCode": "NL"
}, - "mobile": {
- "number": "682212341",
- "dialCode": "+31",
- "countryCode": "NL"
}, - "roles": [
- "GENERAL",
- "TECHNICAL",
- "BILLING",
- "SECURITY"
]
}
], - "_metadata": {
- "totalCount": 1,
- "offset": 0,
- "limit": 10
}
}
description | string The description of the contact. The descriptions listed in the examples are the descriptions we currently support. |
firstName required | string The first name of the contact |
lastName required | string The last name of the contact |
email required | string The email of the contact |
phone required | object Phone of the contact |
mobile | object Mobile of the contact |
roles required | array Indicates which roles the contact has. There are 4 predefined roles. One or multiple roles can be assigned to each contact. It is mandatory to assign at least one of the predefined roles for each contact. If you have only one contact, all 4 roles must be assigned to this contact. |
Authentication is required.
{- "firstName": "John",
- "lastName": "Doe",
- "description": "Mr.",
- "email": "john@doe.com",
- "phone": {
- "number": "682212341",
- "countryCode": "NL"
}, - "mobile": {
- "number": "682212341",
- "countryCode": "NL"
}, - "roles": [
- "GENERAL",
- "TECHNICAL",
- "BILLING",
- "SECURITY"
]
}
{- "id": "1",
- "firstName": "John",
- "lastName": "Doe",
- "description": "Mr.",
- "email": "john@doe.com",
- "phone": {
- "number": "682212341",
- "countryCode": "+31",
- "countryCodeName": "NL"
}, - "mobile": {
- "number": "682212341",
- "countryCode": "+31",
- "countryCodeName": "NL"
}, - "roles": [
- "GENERAL",
- "TECHNICAL",
- "BILLING",
- "SECURITY"
]
}
id required | string |
Authentication is required.
Resource not found.
curl --request GET \ --url https://api.leaseweb.com/account/v1/contacts/%7Bid%7D \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "id": "1",
- "firstName": "John",
- "lastName": "Doe",
- "description": "Mr.",
- "email": "john@doe.com",
- "phone": {
- "number": "682212341",
- "dialCode": "+31",
- "countryCode": "NL"
}, - "mobile": {
- "number": "682212341",
- "dialCode": "+31",
- "countryCode": "NL"
}, - "roles": [
- "GENERAL",
- "TECHNICAL",
- "BILLING",
- "SECURITY"
]
}
id required | string |
description | string The description of the contact. The descriptions listed in the examples are the descriptions we currently support. |
phone required | object Phone of the contact |
mobile | object Mobile of the contact |
roles required | array Indicates what roles the contact has. |
If the contact information is successfully updated, a 204 No Content
is returned.
Authentication is required.
Resource not found.
{- "description": "Mr.",
- "phone": {
- "number": "682212341",
- "countryCode": "NL"
}, - "mobile": {
- "number": "682212341",
- "countryCode": "NL"
}, - "roles": [
- "GENERAL",
- "TECHNICAL",
- "BILLING",
- "SECURITY"
]
}
{- "errorCode": "ACCESS_DENIED",
- "errorMessage": "The access token is expired or invalid."
}
id required | string |
If the contact is successfully removed, a 204 No Content
is returned.
Authentication is required.
Resource not found.
curl --request DELETE \ --url https://api.leaseweb.com/account/v1/contacts/%7Bid%7D \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "errorCode": "ACCESS_DENIED",
- "errorMessage": "The access token is expired or invalid."
}