Want to automate your hosting management? The Enhance API lets you programmatically control websites, email, databases, and more. Time to unleash your inner developer!
The Enhance API follows the OpenAPI 3.0 specification, which means:
[SCREENSHOT: API key creation form with name and permission settings]
Security Warning: Treat API keys like passwords. Never commit them to Git, share them publicly, or include them in client-side code!
Configure what each key can do:
| Permission | Access Level |
|---|---|
| Read Only | GET endpoints only |
| Read/Write | GET, POST, PUT, DELETE |
| Full Access | Everything including user management |
| Custom | Select specific endpoints |
Include your API key in request headers:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.enhance.com/v1/websites
Some installations support OAuth for more secure integrations:
curl -H "Authorization: Bearer OAUTH_ACCESS_TOKEN" \
https://api.enhance.com/v1/websites
| Endpoint | Method | Description |
|---|---|---|
/websites |
GET | List all websites |
/websites |
POST | Create new website |
/websites/{id} |
GET | Get website details |
/websites/{id} |
PUT | Update website |
/websites/{id} |
DELETE | Delete website |
/emails |
GET | List email accounts |
/emails |
POST | Create email account |
/databases |
GET | List databases |
/databases |
POST | Create database |
/domains |
GET | List domains |
/backups |
GET | List backups |
/backups |
POST | Create backup |
List all websites:
curl -X GET \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
https://api.enhance.com/v1/websites
Create a new website:
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain": "newsite.com", "php_version": "8.2"}' \
https://api.enhance.com/v1/websites
Update a website:
curl -X PUT \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"php_version": "8.3"}' \
https://api.enhance.com/v1/websites/123
<?php
$apiKey = 'YOUR_API_KEY';
$baseUrl = 'https://api.enhance.com/v1';
// List websites
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "$baseUrl/websites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $apiKey",
"Content-Type: application/json"
]
]);
$response = curl_exec($ch);
$websites = json_decode($response, true);
curl_close($ch);
foreach ($websites['data'] as $site) {
echo $site['domain'] . "\n";
}
import requests
API_KEY = 'YOUR_API_KEY'
BASE_URL = 'https://api.enhance.com/v1'
headers = {
'Authorization': f'Bearer {API_KEY}',
'Content-Type': 'application/json'
}
# List websites
response = requests.get(f'{BASE_URL}/websites', headers=headers)
websites = response.json()
for site in websites['data']:
print(site['domain'])
# Create a website
new_site = {
'domain': 'newsite.com',
'php_version': '8.2'
}
response = requests.post(f'{BASE_URL}/websites', headers=headers, json=new_site)
print(response.json())
const axios = require('axios');
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://api.enhance.com/v1';
const client = axios.create({
baseURL: BASE_URL,
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
}
});
// List websites
async function listWebsites() {
const response = await client.get('/websites');
return response.data;
}
// Create website
async function createWebsite(domain, phpVersion = '8.2') {
const response = await client.post('/websites', {
domain,
php_version: phpVersion
});
return response.data;
}
// Usage
listWebsites().then(sites => {
sites.data.forEach(site => console.log(site.domain));
});
[SCREENSHOT: API response in a terminal or API client like Postman]
{
"status": "success",
"data": {
"id": 123,
"domain": "example.com",
"php_version": "8.2",
"status": "active",
"created_at": "2025-01-27T10:00:00Z"
}
}
{
"status": "success",
"data": [...],
"meta": {
"total": 50,
"page": 1,
"per_page": 20,
"total_pages": 3
},
"links": {
"next": "/websites?page=2",
"prev": null
}
}
{
"status": "error",
"error": {
"code": "VALIDATION_ERROR",
"message": "The domain field is required",
"details": {
"domain": ["This field cannot be empty"]
}
}
}
Create website with full configuration:
curl -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "newsite.com",
"php_version": "8.2",
"webserver": "nginx",
"document_root": "/public_html"
}' \
https://api.enhance.com/v1/websites
Get website details:
curl -H "Authorization: Bearer $API_KEY" \
https://api.enhance.com/v1/websites/123
Create email account:
curl -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "hello",
"domain": "example.com",
"password": "SecurePassword123!",
"quota": 1024
}' \
https://api.enhance.com/v1/emails
Create database:
curl -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "myapp_production",
"website_id": 123
}' \
https://api.enhance.com/v1/databases
Create on-demand backup:
curl -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"website_id": 123,
"type": "full"
}' \
https://api.enhance.com/v1/backups
Restore from backup:
curl -X POST \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"backup_id": 456,
"target": "files"
}' \
https://api.enhance.com/v1/backups/restore
The API has rate limits to prevent abuse:
| Tier | Requests/Minute | Requests/Hour |
|---|---|---|
| Standard | 60 | 1,000 |
| Premium | 300 | 5,000 |
When rate limited, you'll receive:
{
"status": "error",
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests",
"retry_after": 30
}
}
Headers will include:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1706355600
Retry-After: 30
Get notified when events occur:
website.createdwebsite.deletedbackup.completedssl.renewed[SCREENSHOT: Webhook configuration form]
{
"event": "backup.completed",
"timestamp": "2025-01-27T10:15:30Z",
"data": {
"backup_id": 789,
"website_id": 123,
"size": 524288000,
"status": "success"
}
}
| Code | Meaning | Resolution |
|---|---|---|
| 400 | Bad Request | Check request format |
| 401 | Unauthorized | Check API key |
| 403 | Forbidden | Check permissions |
| 404 | Not Found | Resource doesn't exist |
| 422 | Validation Error | Check input data |
| 429 | Rate Limited | Slow down requests |
| 500 | Server Error | Try again later |
import requests
import time
def api_request(method, endpoint, data=None, retries=3):
for attempt in range(retries):
try:
response = requests.request(
method,
f'{BASE_URL}{endpoint}',
headers=headers,
json=data
)
if response.status_code == 429:
retry_after = int(response.headers.get('Retry-After', 30))
time.sleep(retry_after)
continue
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
if attempt == retries - 1:
raise
time.sleep(2 ** attempt) # Exponential backoff
Download the spec for code generation:
curl https://api.enhance.com/v1/openapi.json > enhance-api.json
Generate client code:
# Using OpenAPI Generator
openapi-generator generate -i enhance-api.json -g python -o ./enhance-client
Next Steps: Having issues? Check our Troubleshooting Guide.