Introduction

The LayerStack API allows you to manage LayerStack Cloud Servers with RestFUL API using HTTP request.

API Server and Base URL

All API endpoints are relative to the base URL. The base URL is LayerStack API is https://api.layerpanel.com/api. Therefore, /cloudserver endpoint refers to https://api.layerpanel.com/api/cloudserver.

Types of Requests

The following types of requests are supported by LayerStack API:

HTTP METHODUSAGE
GETFor retrieval of information about your environment or account. Response will be returned as a JSON object.
POSTfor creating a new object in your account or environment
PUTFor updating resources of information in your account or environment
DELETEFor destroying or removing an object or resource in your account or environment

Each request will have its own parameters. Refer to the documentation of each endpoint for parameters details.

HTTP Statuses

Response for LayerStack API will include standard HTTP statuses including error codes. Specific error messages would be provided for different API calls. The following explains the meaning of different status codes in general.

STATUS CODEMESSAGEEXPLANATION
200OKThe default success code.
201Object createdThe success code return after POST method created an object.
204No contentRequest completed successfully but no content to return.
206Partial contentThere are more results available. The pagination information can be found in metadata via HEAD method.
400Bad requestThe request is not valid. Possible reason can be missing parameters.
401UnauthorizedThe authentication failed.
403ForbiddenThe user is authenticated but is disallowed from performing the action.
404Not FoundThe request URI is not found.
422Unprocessable EntityValidation error.
429Too Many RequestsLimit reached for number of request sent.
500Internal server errorPlease contact our support.
503Service unavailablePlease contact our support.

Response

Response of LayerStack API is in JSON format.

Authentication

An Access token is needed for a complete authentication request. Include your access token as HTTP header in your request. The Access token can be obtained from User Profile & Settings Page.

Headers required
AccessToken your API token optained from panel.
Account your Account ID in XX-12345678 format.

Object ID

Object ids are unique system wide. It is a 12 char string. It is used for identifying objects such as cloud servers.