Getting Started


Welcome to the Cloudways API documentation.

Cloudways Platform API provides the power, flexibility and ease of use of the Cloudways Platform in a simple to use API.

This section covers detailed specifications and documentation of the Platform API. Everything that you can do on the Cloudways Platform is available readily at your finger-tips through an easy to use API.

The Code Examples section provides quick code samples in PHP and Python programming languages that demonstrate how to perform various operations, such as fetching an OAuth token, creating a server, etc.

Request

Cloudways API is a full-featured HTTP API over SSL. It makes use of the following HTTP verbs:

GET
POST
PUT
DELETE

HTTP Response Status and Error codes

Cloudways API sends specific HTTP status codes in response to API requests. For successful responses, the standard 200 response code is used. Any other data returned in response is provided as a well-formed JSON object in the body of the response.

In the event of a problem, the status code will contain an error code, while the body of the response will usually contain additional information about the problem that was encountered. The following is a list of error codes and their descriptions:

400 Access Token not provided Make sure that you have sent a proper access token along with your request
401 Authentication Error Make sure that you have provided a valid access token with your request
403 Forbidden / Authorization Error You don't have access to the requested resource/action
422 Validation Error All validation errors will throw this status code. Response body will contain details of the error.
        {
        "server_id": [{
                        "code": "integer",
                        "message": "The server id must be an integer."
                }],
                "app_id": [{
                        "code": "integer",
                        "message": "The app id must be an integer."
                }]
        }
        
500 Internal server Error API Server is unable to handle your request.

Authentication

To access any API call you first need to authorize yourself on our Cloudways API. For this purpose we use OAuth authentication, an open standard for authorization. Here are the steps involved:

  • Get your API Key from here https://platform.cloudways.com/api
  • Generate the OAuth access token
  • Send the access token with each request in bearer authorization header.