Build with Bavinhost — Account API for customers and Partner Gateway API for resellers & agencies.
Two REST APIs, both authenticated with API keys over HTTPS. Choose the API that matches how you use Bavinhost.
Bavinhost exposes programmatic access so you can manage services outside the control panel.
| API | Who it’s for | Base URL | Get keys |
|---|---|---|---|
| Account API | End customers managing their own domains, hosting, billing, and support | https://www.bavinhost.com/account/api/v1 |
Client area → API Keys |
| Partner Gateway | Resellers & agencies provisioning sites, domains, wallet, and team access | https://www.bavinhost.com/partner-gateway/api/v1 |
Partner dashboard → Settings |
Customer-facing REST API for domains, hosting, orders, account profile, support tickets, and billing.
Send your API key on every request using either:
X-API-Key: YOUR_API_KEY?api_key=YOUR_API_KEYCreate and revoke keys in the API Keys page after logging in.
curl -H "X-API-Key: YOUR_API_KEY" \ "https://www.bavinhost.com/account/api/v1/domains"
| Method | Path | Description |
|---|---|---|
| GET | /domains | List your domains |
| GET | /domains/{id} | Get a domain by ID |
| POST | /domains | Register a domain |
| POST | /domains/{id}/renew | Renew domain (charges account balance) |
| POST | /domains/{id}/auto-renew | Enable/disable auto-renew |
| PUT | /domains/{id} | Update domain (e.g. nameservers) |
Register body example:
{
"domain": "example.com",
"years": 1,
"contacts": { }
}
Renew body example:
{
"years": 1
}
Auto-renew body example:
{
"enabled": true
}
| Method | Path | Description |
|---|---|---|
| GET | /hosting | List hosting accounts |
| GET | /hosting/{id} | Get a hosting account |
| POST | /hosting | Create a hosting account |
| POST | /hosting/{id}/renew | Renew hosting (charges account balance) |
| PUT | /hosting/{id} | Update / suspend / unsuspend |
| Method | Path | Description |
|---|---|---|
| GET | /orders | List orders |
| GET | /orders/{id} | Get an order |
| Method | Path | Description |
|---|---|---|
| GET | /account | Get account profile |
| PUT | /account | Update account profile |
| Method | Path | Description |
|---|---|---|
| GET | /support | List tickets |
| GET | /support/{id} | Get ticket + comments |
| POST | /support | Open a ticket |
Create ticket body example:
{
"title": "Issue title",
"description": "Help needed",
"department": "IT"
}
| Method | Path | Description |
|---|---|---|
| GET | /billing/balance | Account balance |
| GET | /billing/transactions | Recent transactions |
Reseller / agency API for site provisioning, domains, wallet billing, team, API keys, and webhooks.
Partner requests require these headers:
X-Api-Key: your_api_key X-Timestamp: unix_timestamp X-Nonce: unique_nonce
Keys and webhook settings live in the partner dashboard. Logged-in dashboard sessions can also call the API without a key for interactive use.
| Method | Path | Description |
|---|---|---|
| GET | /sites | List partner sites |
| GET | /sites/{id} | Get a site |
| POST | /sites | Provision a site |
| POST | /sites/{id}/suspend | Suspend site |
| POST | /sites/{id}/reactivate | Reactivate site |
| POST | /sites/{id}/terminate | Terminate site |
| POST | /sites/{id}/redeploy | Redeploy site |
| POST | /sites/{id}/upgrade | Upgrade plan |
| POST | /sites/{id}/renew | Renew site hosting (wallet charge) |
| POST | /sites/{id}/auto-renew | Enable/disable site auto-renew |
| POST | /sites/{id}/attach-domain | Attach domain |
| GET | /sites/{id}/resources | Resource usage |
| GET / POST / PUT / DEL | /sites/{id}/dns | Manage DNS records |
| POST | /sites/bulk/suspend | Bulk suspend |
| POST | /sites/bulk/reactivate | Bulk reactivate |
| POST | /sites/bulk/terminate | Bulk terminate |
Provision body example:
{
"domain": "client-example.com",
"subdomain": "",
"plan_id": "starter",
"partner_customer_id": "cust_12345",
"partner_customer_email": "owner@client-example.com",
"partner_customer_name": "Client Owner"
}
| Method | Path | Description |
|---|---|---|
| GET | /jobs | List provisioning jobs |
| GET | /jobs/{id} | Job status |
| POST | /jobs/{id}/retry | Retry failed job |
| Method | Path | Description |
|---|---|---|
| GET | /domains | List domains |
| GET | /domains/{id} | Get domain |
| GET | /domains/search | Search availability |
| POST | /domains | Register or transfer |
| POST | /domains/{id}/lock | Lock domain |
| POST | /domains/{id}/unlock | Unlock domain |
| POST | /domains/{id}/renew | Renew domain (wallet + registrar) |
| POST | /domains/{id}/auto-renew | Enable/disable auto-renew |
| POST | /domains/{id}/whois-privacy | Update WHOIS privacy |
| GET | /domains/{id}/status | Domain status |
| Method | Path | Description |
|---|---|---|
| GET | /wallet | Wallet summary |
| POST | /wallet/topup | Start a top-up |
| GET | /wallet/transactions | Wallet transactions |
| POST | /wallet/auto-topup | Configure auto top-up |
| GET | /invoices | List invoices |
| GET | /invoices/{id} | Get invoice |
| Method | Path | Description |
|---|---|---|
| GET | /team | List team members |
| POST | /team/invite | Invite member |
| PUT | /team/{id}/role | Update role |
| DEL | /team/{id} | Remove member |
| GET | /keys | List API keys |
| POST | /keys | Create API key |
| PUT | /keys/{id}/revoke | Revoke key |
| DEL | /keys/{id} | Delete key |
| POST | /webhooks/test | Test webhook URL |
| GET | /webhooks/logs | Delivery logs |
| POST | /webhooks/rotate-secret | Rotate secret |
| POST | /webhooks/{id}/retry | Retry delivery |
curl -H "X-API-Key: YOUR_API_KEY" \ "https://www.bavinhost.com/account/api/v1/domains"
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Issue","description":"Help needed","department":"IT"}' \
"https://www.bavinhost.com/account/api/v1/support"
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"years":1}' \
"https://www.bavinhost.com/account/api/v1/domains/DOM_SECRET_ID/renew"
curl -X POST "https://www.bavinhost.com/partner-gateway/api/v1/sites/SITE_ID/renew" \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Timestamp: $(date +%s)" \
-H "X-Nonce: $(openssl rand -hex 16)" \
-d '{"years":1}'
curl -X GET "https://www.bavinhost.com/partner-gateway/api/v1/sites?page=1&limit=20" \ -H "Content-Type: application/json" \ -H "X-Api-Key: YOUR_API_KEY" \ -H "X-Timestamp: $(date +%s)" \ -H "X-Nonce: $(openssl rand -hex 16)"
const baseUrl = "https://www.bavinhost.com/partner-gateway/api/v1";
const apiKey = "YOUR_API_KEY";
const res = await fetch(`${baseUrl}/sites`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": apiKey,
"X-Timestamp": Math.floor(Date.now() / 1000).toString(),
"X-Nonce": crypto.randomUUID().replace(/-/g, "")
},
body: JSON.stringify({
domain: "client-example.com",
plan_id: "starter",
partner_customer_id: "cust_12345",
partner_customer_email: "owner@client-example.com",
partner_customer_name: "Client Owner"
})
});
console.log(await res.json());
Account API responses use a standard envelope:
{
"success": false,
"data": null,
"message": "Unauthorized",
"code": 401
}
Partner Gateway error shape:
{
"success": false,
"error": {
"code": "AUTH_FAILED",
"message": "Missing API key or session"
}
}
Common partner codes: AUTH_FAILED, FORBIDDEN, NOT_FOUND, METHOD_NOT_ALLOWED, VALIDATION_ERROR, INTERNAL_ERROR. Account API defaults to about 100 requests per hour per key. Partner Gateway returns X-RateLimit-* headers.
/partner-gateway/api/v1/…Need help integrating? Contact us or open a ticket.