LeaseWeb API for Customer Account (v1)

The base URL for this API is: https://api.leaseweb.com/account/v1

BETA
This API is in BETA. Documentation might be incorrect or incomplete. Functionality might change with the final release.

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.

Account

Inspect your account details

Get account details

Authorizations:

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/account/v1/details \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "address": {
    },
  • "name": "Leaseweb",
  • "resellerTier": "resellerTier",
  • "vatNumber": "vat1234134"
}

Update an account

For an USA customer the address is uneditable.

Authorizations:
Request Body schema: application/json
required
object

Address

Responses

Request samples

Content type
application/json
{
  • "address": {
    }
}

Response samples

Content type
application/json
{
  • "correlationId": "289346a1-3eaf-4da4-b707-62ef12eb08be",
  • "errorCode": "401",
  • "errorMessage": "You are not authorized to view this resource."
}

Contacts

Get all your contacts

Get contacts

Authorizations:
query Parameters
primaryRoles
string
Enum: "TECHNICAL" "GENERAL" "BILLING" "SECURITY"

Filter the contacts endpoint on primary role(s).

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/account/v1/contacts \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

Content type
application/json
{
  • "_metadata": {
    },
  • "contacts": [
    ]
}

Create a contact

Create a contact

Authorizations:
query Parameters
primaryRoles
string
Enum: "TECHNICAL" "GENERAL" "BILLING" "SECURITY"

Filter the contacts endpoint on primary role(s).

Request Body schema: application/json
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.

Responses

Request samples

Content type
application/json
{
  • "description": "Mr.",
  • "email": "john@doe.com",
  • "firstName": "John",
  • "lastName": "Doe",
  • "mobile": {
    },
  • "phone": {
    },
  • "roles": [
    ]
}

Response samples

Content type
application/json
{
  • "description": "Mr.",
  • "email": "john@doe.com",
  • "firstName": "John",
  • "id": "1",
  • "lastName": "Doe",
  • "mobile": {
    },
  • "phone": {
    },
  • "primaryRoles": [
    ],
  • "roles": [
    ]
}

Remove a contact

Delete contact

Authorizations:
path Parameters
id
required
string

The identifier of a contact

Responses

Request samples

curl --request DELETE \
  --url https://api.leaseweb.com/account/v1/contacts/%7Bid%7D \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'