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. Go to your account settings and look for the API Key menu.

In the API settings menu, flip the switch to turn on the API access. After enabling the API access, the switch will turn green. You can flip it again to turn off the API access.

Generating API Keys

Once you have enabled API access, you can use the API key and API secret shown on the screen. If you want to delete existing keys and issue new keys, you can do so by clicking 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 address, then your API endpoints will be accessible from any IP address by default. If you always make API requests from a fixed IP address, we recommend you restrict the API access from other IP addresses.

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

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

Once you click “Save IP address“, any API requests that originate from an IP address that was not whitelisted will receive an HTTP 401 error.