SiteHost

SiteHost API

The SiteHost API enables programmatic access to the systems, tools and resources in your SiteHost account. You can retrieve information and execute actions on your resources using simple HTTP requests.

Please check the SiteHost API Documentation for a list of available endpoints. Code samples are provided in various programming languages including JavaScript, PHP, Rails and Python to get you started.

To start working with the SiteHost API you will need an API Key, which you can create via the API module in SiteHost Control Panel, do note that your account will need to have two-factor authentication enabled before you can do so.

Creating an API Key

  1. Navigate to the API module at the bottom left of the SiteHost Control Panel.

  2. Click the “Add API Key” icon in the top right corner of the API key list. Add API Key Using Dropdown

  3. Enter a label for your key.

    This helps you identify which key it is, for example: the purpose of the key or whose it is.

  4. Select which API modules you wish the key to have access to.

    Modules are distinct areas of the API you can interact with. The modules correspond to the available endpoints as seen in our API Documentation.

    For organisation and security reasons, we recommend you to apply the principle of least privilege when you are creating an API key. This means you should limit the modules on your key to just the ones it needs to perform its function.

  5. To lock your API key down so it can only be used from trusted IP addresses, add them to the Allowed IP Addresses section. Otherwise the API key can be used from anywhere.

  6. Click “Add API Key”.

  7. A green banner will appear containing your newly created API key. Store this safely as the key will only be shown once and cannot be retrieved again, only regenerated. Green Banner with API Key

Updating an API key

  1. Navigate to the API module at the bottom left of the SiteHost Control Panel.
  2. Next to an existing key click the menu to expand it and select “Edit Key”. Edit API Key Using Dropdown
  3. Modify the label, modules, or IPs as you wish.
  4. Click “Save API Key”.

Regenerating an API key

  1. Navigate to the API module at the bottom left of the SiteHost Control Panel.
  2. Next to an existing key click the menu to expand it and select “Regenerate Key”.
  3. Confirm regeneration.
  4. A green banner will appear containing your regenerated API key. Store this safely, and update any services that were using the old one. Green Banner with API Key

    Be aware that any services using this key will cease to work until you update them with the new key.

Deleting an API key

  1. Navigate to the API module at the bottom left of the SiteHost Control Panel.
  2. Next to an existing key click the menu to expand it and select “Remove Key”.
  3. Confirm removal.

    Be aware that any services using this key will cease to work after it’s deleted.