Dedicated Servers API (v2)

This is the description of the Dedicated Server API.

The base url of this API is https://api.leaseweb.com.

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" : "https://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.

Getting Started

List servers

List your Dedicated Servers. This api call supports pagination. Use the limit and offset query string parameters to paginate through all your dedicated servers.

Every server object in the json response lists a few properties of a server. Use the single resource api call to get more details for a single server.

Authorizations:
query Parameters
limit
integer
Example: limit=20

Limit the number of results returned.

offset
integer
Example: offset=10

Return results starting from the given offset.

reference
string
Example: reference=my-db

Filter the list of servers by reference.

ip
string
Example: ip=127.0.0.4

Filter the list of servers by ip address.

macAddress
string
Example: macAddress=aa:bb:cc:dd:ee:ff

Filter the list of servers by mac address.

site
string
Example: site=FRA-10

Filter the list of servers by site (location).

privateRackId
string
Example: privateRackId=123

Filter the list of servers by dedicated rack id.

privateNetworkCapable
string
Enum: "true" "false"

Filter the list for private network capable servers

privateNetworkEnabled
string
Enum: "true" "false"

Filter the list for private network enabled servers

Responses

Request samples

curl --request GET \
  --url 'https://api.leaseweb.com/bareMetals/v2/servers?limit=SOME_INTEGER_VALUE&offset=SOME_INTEGER_VALUE&reference=SOME_STRING_VALUE&ip=SOME_STRING_VALUE&macAddress=SOME_STRING_VALUE&site=SOME_STRING_VALUE&privateRackId=SOME_STRING_VALUE&privateNetworkCapable=SOME_STRING_VALUE&privateNetworkEnabled=SOME_STRING_VALUE' \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples

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

Get server

Use this API to get information about a single server.

Authorizations:
path Parameters
serverId
required
string
Example: 12345

The ID of a server

Responses

Request samples

curl --request GET \
  --url https://api.leaseweb.com/bareMetals/v2/servers/12345 \
  --header 'x-lsw-auth: REPLACE_KEY_VALUE'

Response samples