If you want to use RunCloud’s functionality, such as connecting new servers or updating the IP address of a connected server over an API endpoint, then you need to enable API access first. 

Enabling API Access

RunCloud API access can be enabled from the RunCloud dashboard. To do this, go to your Workspace account settings and look for the API Management tab in the left menu.

Generating API Keys

Once you have navigated to the API settings page, click the “Generate New Key” button to create a fresh API key. This will open up a new modal where you can enter a descriptive label for this key. After adding the label, click “Generate Key” to create a new one.

Once the key is created, it will be displayed on your screen. You can copy this key and save it securely somewhere on your computer, as it will not be displayed again. 

Alternatively, if you want to delete an existing key and issue a new one, click the “Regenerate” button. Once you click the Regenerate button, a pop-up message will appear asking you to confirm your action. Click on “Regenerate” again to create a fresh key.

Restricting API Access

If you enable the RunCloud API without adding any IP addresses, your API endpoints will be accessible from any IP address by default. However, if you always make API requests from a fixed IP address, we recommend restricting API access to other IP addresses.

Creating a whitelist is very simple. In the API Key menu, scroll to the “IP Address Restriction” section and click “Add New IP Address“.

On the next screen, add the IP address along with a description.  

Once you click “Save IP address”, the IP address will appear in a list with its description. 

Now, if you use an IP address that is not present in this whitelist, RunCloud will return an HTTP 401 error.