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.
curl --request GET \ --url https://api.leaseweb.com/account/v1/details \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "address": {
- "city": "Amsterdam",
- "country": "Netherlands",
- "houseNumber": "8",
- "postalCode": "1101 EC",
- "state": "",
- "stateCode": "",
- "street": "luttenbergweg"
}, - "name": "Leaseweb",
- "resellerTier": "resellerTier",
- "vatNumber": "vat1234134"
}
For an USA customer the address is uneditable.
required | object Address |
{- "address": {
- "city": "New York",
- "houseNumber": "1",
- "postalCode": "10005",
- "street": "Wallstreet"
}
}
{- "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
- "errorCode": "401",
- "errorMessage": "You are not authorized to view this resource."
}
Get contacts
primaryRoles | string Enum: "TECHNICAL" "GENERAL" "BILLING" "SECURITY" Filter the contacts endpoint on primary role(s). |
curl --request GET \ --url https://api.leaseweb.com/account/v1/contacts \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'
{- "_metadata": {
- "limit": 10,
- "offset": 0,
- "totalCount": 1
}, - "contacts": [
- {
- "description": "Mr.",
- "email": "john@doe.com",
- "firstName": "John",
- "id": "1",
- "lastName": "Doe",
- "mobile": {
- "countryCode": "NL",
- "dialCode": "+31",
- "number": "682212341"
}, - "phone": {
- "countryCode": "NL",
- "dialCode": "+31",
- "number": "682212341"
}, - "primaryRoles": [
- "GENERAL",
- "SECURITY",
- "TECHNICAL",
- "BILLING"
], - "roles": [
- "GENERAL",
- "TECHNICAL",
- "BILLING",
- "SECURITY"
]
}
]
}
Create a contact
primaryRoles | string Enum: "TECHNICAL" "GENERAL" "BILLING" "SECURITY" Filter the contacts endpoint on primary role(s). |
description | string The description of the contact. The descriptions listed in the examples are the descriptions we currently support. |
email required | string The email of the contact |
firstName required | string The first name of the contact |
lastName required | string The last name of the contact |
object Mobile of the contact | |
required | object Phone 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. |
{- "description": "Mr.",
- "email": "john@doe.com",
- "firstName": "John",
- "lastName": "Doe",
- "mobile": {
- "countryCode": "NL",
- "number": "682212341"
}, - "phone": {
- "countryCode": "NL",
- "number": "682212341"
}, - "roles": [
- "GENERAL",
- "TECHNICAL",
- "BILLING",
- "SECURITY"
]
}
{- "description": "Mr.",
- "email": "john@doe.com",
- "firstName": "John",
- "id": "1",
- "lastName": "Doe",
- "mobile": {
- "countryCode": "+31",
- "countryCodeName": "NL",
- "number": "682212341"
}, - "phone": {
- "countryCode": "+31",
- "countryCodeName": "NL",
- "number": "682212341"
}, - "primaryRoles": [
- "GENERAL",
- "SECURITY",
- "TECHNICAL",
- "BILLING"
], - "roles": [
- "GENERAL",
- "TECHNICAL",
- "BILLING",
- "SECURITY"
]
}
Delete contact
id required | string The identifier of a contact |
curl --request DELETE \ --url https://api.leaseweb.com/account/v1/contacts/%7Bid%7D \ --header 'x-lsw-auth: REPLACE_KEY_VALUE'