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 knowledge base 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/v3/
. You can make a test request to the /ping endpoint using GET method to test this.
RunCloud uses Bearer Token to validate HTTP requests. This means that you need to use your API Key while making the request. Here is a sample curl request:
curl -X GET https://manage.runcloud.io/api/v3/ping -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
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.
In the above example, replace the eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9
with your API key and submit the request. 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
) 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 RunCloud API v3 documentation.