In order to use the API you need an access token.
Sign in into the Bacloud client area using your user credentials.
Choose an API Management.
Press Create API client and then on Action menu click Generate API tokens.
Make sure to copy both the Access Token and the Refresh Token because it won’t be shown to you again.
Alternatively, you can generate both the Access and the Refresh tokens by using Access Tokens -> Generate token endpoint.
To order services using the API, you must have enough money in a credit balance on your Bacloud account. If your credit balance is too low, the service won't launch automatically. In that case, you have to add money to your balance and pay the invoice manually in the Bacloud client area.
You can check your credit balance using an API endpoint /v1/billing/credit.
Communicate with the API by making an HTTP request at the correct endpoint. The chosen method determines the action taken.
Some endpoints support pagination. If they support pagination, it can be controlled with the page
and per_page
query parameters.
page
- The page number to retrieve. Defaults to the first page which is 1.
per_page
- The number of items to retrieve per page. Defaults to 25. Maximum value is 100 unless stated otherwise.
Details of pagination
can be found in the response body meta
object, pagination
key.
Pagination response contains the following keys:
page
- current page (number);perPage
- number of items per page (number);firstPage
- first page (number), usually 1.;prevPage
- previous page (number). Can be null if you are on the first page;nextPage
- next page (number). Can be null if you are on the last page;lastPage
- last page (number).;totalItems
- total number of items (number);Bacloud safeguards the API against bursts of incoming traffic based on the requests IP address to ensure stability for all users. If your application sends more than 30 requests per second, the API may return HTTP status code 429.
In order to make an authenticated request, include a bearer-type
Authorization
header containing your Access token. All requests must be made over HTTPS.
curl -X $HTTP_METHOD -H "Authorization: Bearer $BACLOUD_ACCESS_TOKEN"
"https://api.bacloud.com/v1/"
Along with the HTTP methods that the API responds to, it will also return standard HTTP statuses, including error codes.
In the event of a problem, the status will contain the error code, while the body of the response will usually contain additional information about the problem that was encountered.
Responses in the 200 range indicates that the request was successful and no errors were encountered.
Responses in the 400 range indicates that there is an issue with the requests and it should be changed before trying it again. It will usually contain the message describing what went wrong.
Responses in the 500 range indicates the server-side problem. In that case the issue is on our end and the request was not completed.
Possible responses:
Response | Description |
---|---|
200 OK | The request was successful. |
201 Created | The request was successful and a new resource was created. |
202 Accepted | Your request was accepted and a resource was updated. |
204 No Content | Your request succeeded, there is no additional information returned. |
400 Bad Request | The request could not be completed due to a malformed request of wrongly used endpoint. |
401 Unauthorized | The request could not be completed due to an invalid authentication credentials. This response is possible at all endpoints except for /v1/token/generate and /v1/token/refresh. |
403 Forbidden | You are not allowed to access the requested resource. This response is possible at all endpoints. |
404 Not Found | The requested resource was not found. |
409 Conflict | The request could not be completed due to a conflict with the current state of the resource. |
422 Validation Error | The request could not be completed due to invalid data. |
429 Too Many Requests | The request could not be completed due to rate limiting. This response is possible at all endpoints. |
500 Internal Server Error | The request could not be completed due to server-side problems. This response is possible at all endpoints. |
Generate token to access API resources.
client_id required | string The API Client ID from Bacloud client area. |
client_secret required | string The API Client Secret from Bacloud client area. |
{- "client_id": "9b7d6a04-4a09-4f6e-a4af-a663",
- "client_secret": "1V9GwF4BJv7HJNLH0RtxvBvGRRKd8u"
}
{- "success": true,
- "data": {
- "token_type": "Bearer",
- "expires_in": 86400,
- "access_token": "eyJhdWQiOiI5YjcxNWQwZC1lNmZlLTQ2OGUtYThhYi0yMDQzY2Y0ZmRlYjAiLCJqdGkiOiIzZDg5NzQyY2NiY2VkNDY0ZDA3Y2UwOTQ2ZTE2ODk5MmNkOGFjYmMxM2E1NGNkYTA5MTJmYWVkY2VlMmM2ZDY3OWQ2ZThjMDQyNjhiNjJhMiIsImlhdCI6MTcwOTI5NTMyMy4yMTY4NjYsIm5iZiI6MTcwOTI5NTMyMy4yMTY4NjksImV4cCI6MTc5NTY5NTMyMy4yMDE0MjgsInN1YiI6IjUiLCJzY29wZXMiOltdfQ",
- "refresh_token": "def5020003044bb4be0589f687b51330bd675caf8e60d3a89b45db4334bf5ae36d48c5590f9365f66b37dbc087560b49af13b78a8f6097e2ae0f2e09e1860d4c8cdfec455883104eaaf22ea5795fb9c39195a0b252503522567a595a94bfa5038657276f4b275e217b26988a665fd44570c5fa27de01daf25c8aee233f16f1b017978ed568938abd126c34baed9869a42f8e350e09ebb337de8962b1f774fa9cec9536299c11a68cdc1864054d998eaf23763850ef7172429bae24d2843b188fe6d0d6948c519721998089bcae88f9f7cc5015f2f78e68bf623dbabe87bae57cd731c058f32b2a197f7c81b8f63235f44fe11789086d76f6203008d51cf31e785d82f897d9627243ace74506baae48d6c53039642be1df835e9b9e8c28625f742dea45bc5fe600b027a21ed5cb8b2c303f1b12a20f089b47bf85bf271d4ffcc5fc46bc5a1718ac3c0524c15fa2e493b2493b268f17b1c6abf8f582734f5c2ff84b00d4208c42d7050f131fbe9f1b3fa1be001fab2ab7831f25330b2e1ad622980ce7bc32"
}
}
Generate token with refresh token.
client_id required | string The API Client ID from Bacloud client area. |
client_secret required | string The API Client Secret from Bacloud client area. |
refresh_token required | string The API Client Refresh Token. |
{- "client_id": "9b7d6a04-4a09-4f6e-a4af-a663",
- "client_secret": "1V9GwF4BJv7HJNLH0RtxvBvGRRKd8u",
- "refresh_token": "def5020003044bb4be0589f687b51330b"
}
{- "success": true,
- "data": {
- "token_type": "Bearer",
- "expires_in": 86400,
- "access_token": "eyJhdWQiOiI5YjcxNWQwZC1lNmZlLTQ2OGUtYThhYi0yMDQzY2Y0ZmRlYjAiLCJqdGkiOiIzZDg5NzQyY2NiY2VkNDY0ZDA3Y2UwOTQ2ZTE2ODk5MmNkOGFjYmMxM2E1NGNkYTA5MTJmYWVkY2VlMmM2ZDY3OWQ2ZThjMDQyNjhiNjJhMiIsImlhdCI6MTcwOTI5NTMyMy4yMTY4NjYsIm5iZiI6MTcwOTI5NTMyMy4yMTY4NjksImV4cCI6MTc5NTY5NTMyMy4yMDE0MjgsInN1YiI6IjUiLCJzY29wZXMiOltdfQ",
- "refresh_token": "def5020003044bb4be0589f687b51330bd675caf8e60d3a89b45db4334bf5ae36d48c5590f9365f66b37dbc087560b49af13b78a8f6097e2ae0f2e09e1860d4c8cdfec455883104eaaf22ea5795fb9c39195a0b252503522567a595a94bfa5038657276f4b275e217b26988a665fd44570c5fa27de01daf25c8aee233f16f1b017978ed568938abd126c34baed9869a42f8e350e09ebb337de8962b1f774fa9cec9536299c11a68cdc1864054d998eaf23763850ef7172429bae24d2843b188fe6d0d6948c519721998089bcae88f9f7cc5015f2f78e68bf623dbabe87bae57cd731c058f32b2a197f7c81b8f63235f44fe11789086d76f6203008d51cf31e785d82f897d9627243ace74506baae48d6c53039642be1df835e9b9e8c28625f742dea45bc5fe600b027a21ed5cb8b2c303f1b12a20f089b47bf85bf271d4ffcc5fc46bc5a1718ac3c0524c15fa2e493b2493b268f17b1c6abf8f582734f5c2ff84b00d4208c42d7050f131fbe9f1b3fa1be001fab2ab7831f25330b2e1ad622980ce7bc32"
}
}
Get product groups that are available on the API.
{- "success": true,
- "data": {
- "groups": [
- {
- "id": 10,
- "name": "Linux OpenVZ",
- "description": "Low cost Linux VPS with fast 100% SSD drives and instant delivery!"
}, - {
- "id": 11,
- "name": "Windows KVM",
- "description": "Fast 100% NVMe VPS servers for Windows App's and projects with terminal RDP logins!"
}, - {
- "id": 12,
- "name": "Linux KVM",
- "description": "Fast 100% NVMe VPS servers for Linux projects, full server control! Delivery 30 seconds!"
}
]
}
}
Get products of the specific group that are available on the API.
groupId required | integer Example: 16 Product group ID. |
{- "success": true,
- "data": {
- "group": {
- "id": 10,
- "name": "Linux OpenVZ",
- "description": "Low cost Linux VPS with fast 100% SSD drives and instant delivery!"
}, - "products": [
- {
- "id": 101,
- "name": "Linux OpenVZ 1",
- "status": "available"
}, - {
- "id": 102,
- "name": "Linux OpenVZ 2",
- "status": "available"
}, - {
- "id": 103,
- "name": "Linux OpenVZ 3",
- "status": "available"
}, - {
- "id": 104,
- "name": "Linux OpenVZ 4",
- "status": "available"
}
]
}
}
Get details of the Bacloud product: configurable options, billing.
id required | integer Example: 1 Product ID |
with_billing | string Default: "false" Example: with_billing=false Should the product billing be included. |
currency_code | string (Currency) Enum: "EUR" "USD" Example: currency_code=EUR Currency code for the pricing. |
{- "success": true,
- "data": {
- "product": {
- "id": 101,
- "name": "Linux KVM NVMe 1",
- "cpu": "1 vCPU",
- "ram": "2 GB",
- "storage": "20 GB",
- "group": {
- "id": 12,
- "name": "Linux KVM",
- "description": "Fast 100% NVMe VPS servers for Linux projects, full server control! Delivery 30 seconds!"
}, - "virtualizationType": "kvm",
- "status": "available",
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 17.14,
- "setupFee": 0
}
], - "operatingSystems": [
- {
- "value": "almalinux-9",
- "description": "AlmaLinux 9 x86_64 64-bit system",
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 0,
- "setupFee": 0
}
]
}, - {
- "value": "ubuntu-22.04",
- "description": "Ubuntu 22.04 x86_64 64-bit system",
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 0,
- "setupFee": 0
}
]
}, - {
- "value": "debian-12",
- "description": "Debian 12 (Bookworm) x86_64 64-bit system",
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 0,
- "setupFee": 0
}
]
}
], - "extraIpv4Addresses": [
- {
- "value": 1,
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 3.87,
- "setupFee": 0
}
]
}, - {
- "value": 2,
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 7.77,
- "setupFee": 0
}
]
}, - {
- "value": 3,
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 11.65,
- "setupFee": 0
}
]
}, - {
- "value": 4,
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 15.55,
- "setupFee": 0
}
]
}
], - "locations": [
- {
- "value": "nl-dro",
- "description": "NL - Europe",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 0,
- "setupFee": 0
}
]
}, - {
- "value": "lt-sqq",
- "description": "LT - Europe",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 0,
- "setupFee": 0
}
]
}, - {
- "value": "us-chi",
- "description": "US - United States",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 0,
- "setupFee": 0
}
]
}, - {
- "value": "gb-cov",
- "description": "UK - Europe",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 0,
- "setupFee": 0
}
]
}
], - "licenses": [
- {
- "name": "web-control-panel",
- "type": "perlicense",
- "options": [
- {
- "value": "cpanel-solo-cloud",
- "description": "cPanel Solo Cloud (AlmaLinux and Cloudlinux only)",
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 36.27,
- "setupFee": 0
}
]
}, - {
- "value": "cpanel-admin-cloud",
- "description": "cPanel Admin Cloud (Up to 5 accounts, AlmaLinux and Cloudlinux only)",
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 65.97,
- "setupFee": 0
}
]
}, - {
- "value": "directadmin-personal-plus",
- "description": "DirectAdmin Personal PLUS (2 accounts, 20 Domains)",
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 15,
- "setupFee": 0
}
]
}, - {
- "value": "cyberpanel",
- "description": "CyberPanel",
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 0,
- "setupFee": 25
}
]
}
], - "billing": null
}, - {
- "name": "additional-protection",
- "type": "perlicense",
- "options": [
- {
- "value": "eset-server-security",
- "description": "ESET Server Security",
- "billing": [
- {
- "period": "quarterly",
- "currency": "eur",
- "price": 18.57,
- "setupFee": 0
}
]
}
], - "billing": null
}
], - "type": "VPS"
}
}
}
Get details of VPS service
id required | integer Example: 1 VPS service ID |
{- "success": false,
- "data": {
- "id": 1,
- "name": "Linux KVM 2",
- "cpu": "2 CPU",
- "ram": "8 GB",
- "storage": "80 GB",
- "createdDate": "2024-03-25",
- "nextDueDate": "2024-04-25",
- "status": "Active",
- "billing": {
- "period": "free",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 0
}, - "note": "This is my server",
- "cancelRequest": {
- "date": "2024-04-19",
- "reason": "Not satisfied with the service",
- "type": "Immediate"
}, - "hostname": "example.com",
- "ipConfig": [
- {
- "ip": "192.168.120.2",
- "gateway": "111.222.333.444",
- "netmask": "255.255.240.0 (/20)",
- "type": "main_ip",
- "ipVersion": "IPv4"
}
], - "rootPassword": "root-pass",
- "location": {
- "value": "nl-dro",
- "description": "Netherlands, Dronten",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 1.23
}
]
}, - "operatingSystem": {
- "value": "almalinux-8",
- "description": "AlmaLinux 8",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 1.23
}
]
}, - "extraIpv4Address": {
- "value": 2,
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 1.23
}
]
}, - "licenses": [
- {
- "name": "web-control-panel",
- "value": "cpanel-solo-cloud",
- "description": "cPanel Solo Cloud",
- "type": "perlicense",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 1.23
}
]
}, - {
- "name": "additional-protection",
- "value": "eset-server-security",
- "description": "ESET Server Security",
- "type": "perlicense",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 1.23
}
]
}
]
}
}
Perform various actions on VPS service.
serviceId required | integer Example: 1 VPS service ID |
action required | string (VpsAction) Enum: "boot" "reboot" "shutdown" "changeRootPassword" "changeHostname" "reinstallServer" Action to perform on the service. NotesSome types of services might not support some actions. i.e. Windows VPS do not support thechangeRootPassword action. In that case, the response will contain an error message.If action changeRootPassword is performed, the new password can be retrieved using the GET method with the /v1/vps/{serviceId} endpoint. |
hostname | string New Hostname for your VPS service. RestrictionsOnly required and allowed if action ischangeHostname
|
operating_system | string New Operating System for your VPS service. RestrictionsOnly required and allowed if action isreinstallServer .
If your service has a cPanel web control panel, only Almalinux or Cloudlinux operating systems are allowed. |
{- "action": "reboot"
}
{- "success": true
}
Request to cancel VPS Service.
serviceId required | integer Example: 1 VPS service ID |
cancel_type required | string (CancelRequestType) Enum: "Immediate" "End of Billing Period" |
cancel_reason | string Cancellation reason |
{- "cancel_type": "Immediate",
- "cancel_reason": "Not needed"
}
{- "success": true
}
Get list of your VPS services
status | string (ServiceStatus) Enum: "Active" "Cancelled" "Pending" "Suspended" "Terminated" Example: status=Active List only the services with selected status |
location | string Example: location=lt-sqq List only the services at the selected location. Only services with the status Active will be shown. Location value must be in ISO 3166-1 alpha-2 format. |
page | integer >= 1 Default: 1 Example: page=1 Which page should be returned. First page is 1. |
per_page | integer [ 1 .. 100 ] Default: 25 Example: per_page=25 The number of items returned per page. |
{- "success": true,
- "data": [
- {
- "services": [
- {
- "id": 1,
- "name": "Linux KVM 2",
- "cpu": "2 CPU",
- "ram": "8 GB",
- "storage": "80 GB",
- "createdDate": "2024-03-25",
- "nextDueDate": "2024-04-25",
- "status": "Active",
- "billing": {
- "period": "free",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 0
}, - "note": "This is my server",
- "cancelRequest": {
- "date": "2024-04-19",
- "reason": "Not satisfied with the service",
- "type": "Immediate"
}, - "hostname": "example.com",
- "ipConfig": [
- {
- "ip": "192.168.120.2",
- "gateway": "111.222.333.444",
- "netmask": "255.255.240.0 (/20)",
- "type": "main_ip",
- "ipVersion": "IPv4"
}
], - "rootPassword": "root-pass",
- "location": {
- "value": "nl-dro",
- "description": "Netherlands, Dronten",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 1.23
}
]
}, - "operatingSystem": {
- "value": "almalinux-8",
- "description": "AlmaLinux 8",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 1.23
}
]
}, - "extraIpv4Address": {
- "value": 2,
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 1.23
}
]
}, - "licenses": [
- {
- "name": "web-control-panel",
- "value": "cpanel-solo-cloud",
- "description": "cPanel Solo Cloud",
- "type": "perlicense",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 1.23
}
]
}, - {
- "name": "additional-protection",
- "value": "eset-server-security",
- "description": "ESET Server Security",
- "type": "perlicense",
- "billing": [
- {
- "period": "monthly",
- "currency": "eur",
- "price": 12.34,
- "setupFee": 1.23
}
]
}
]
}
], - "meta": {
- "pagination": {
- "page": 5,
- "perPage": 10,
- "firstPage": 1,
- "previousPage": 4,
- "nextPage": 6,
- "lastPage": 15,
- "totalItems": 143
}
}
}
]
}
Create VPS service.
Request body
product_id required | integer Product ID |
payment_period required | string (PaymentPeriodType) Enum: "free" "free account" "onetime" "monthly" "quarterly" "semiannually" "annually" "biennially" "triennially" |
operating_system required | string Service operating system. RestrictionsOnly Almalinux and Cloudlix operating systems support the cPanel web control panel. |
location required | string Location where the server will be launched. Must be in ISO 3166-1 alpha-2 format |
extra_ipv4_addresses | integer Amount of needed extra IPv4 addresses |
hostname | string Hostname of the service |
note | string Additional notes for the service |
Array of objects (CreateServiceLicense) An array of licenses to be included with the server |
{- "product_id": 111,
- "payment_period": "monthly",
- "operating_system": "debian-11",
- "location": "us-chi",
- "extra_ipv4_addresses": 1,
- "hostname": "example.com",
- "note": "My Linux server",
- "licenses": [
- {
- "name": "web-control-panel",
- "value": "cpanel-solo-cloud"
}, - {
- "name": "additional-protection",
- "value": "eset-server-security"
}
]
}
{- "success": true,
- "data": {
- "service_id": 301
}
}