What You Can Do With the RunCloud API

The RunCloud API provides a powerful interface for managing servers. Nearly all tasks that can be performed via the Dashboard are achievable through the API.

These include automating server and web application management tasks, managing databases, and building custom server control panels.

Some of the common use cases include connecting new servers, monitoring server health, stopping/starting a service, blocking an IP address, adding a new system user, and adding web applications and databases.

How To Access Your RunCloud API

Before making an API request, you need to enable the API access for your account. Refer to our knowledgebase article on enabling API Access for RunCloud to learn how to do this.

Once you have your API key and secret, you can start using API. The base URL for the API is https://manage.runcloud.io/api/v2/. You can make a test request to the /ping endpoint using GET method. 

RunCloud uses basic authentication to validate HTTP requests. This means that you need to use your API Key as the username, and your API Secret as the password while making the request. Here is a sample curl request:

curl -X GET "https://manage.runcloud.io/api/v2/ping" \ -u YOUR_API_KEY:YOUR_API_SECRET \ -H "Content-Type: application/json" \ -H "Accept: application/json"

Tip: If you are using an API development tool such as Postman or Insomnia, then you can just import the above request and it will automatically fill the necessary fields.

If your request is successful, you will get a 200 status code, along with a `pong` message as the output.

Once we are sure that the API is working correctly, we can start using it for more useful purposes. For example, the /servers API endpoint returns a JSON object that contains a list of connected servers and their basic information:

The API endpoint to fetch the latest health data of a server is /servers/{id}/health/latest, where {id} is the ID of the server

Let’s use the server ID (1637) from the previous example request to create a new endpoint:

/servers/1637/health/latest – this endpoint will now return latest health data of specified server.

For further information on using RunCloud API, visit the API documentation.