API Setup
Octos Cloud exposes a REST API that lets you manage your infrastructure programmatically — create virtual machines, configure networks, provision storage, and monitor resources without touching the portal UI.
Enable the API and generate a token
Before making any API calls, you need to enable API access and generate a Bearer token from the Octos Cloud Portal.
Step 1 — Log in to the portal
Open cloud.octosinfra.com and sign in with your account credentials.
Step 2 — Open your profile
Click on your Profile avatar in the upper-right corner of the portal.
Step 3 — Navigate to API settings
In the dropdown menu, select API.
Step 4 — Enable API access
Click the Enable API button. This activates API access for your account.
Step 5 — Set token expiry
Select a Date of Expiry for your authentication token. You can choose a specific expiration date, or leave it empty for a non-expiring token.
Once confirmed, the portal generates a Bearer token. Copy and store this token securely — it will not be shown again.
Treat your API token like a password. Anyone with access to this token can manage your cloud resources. If you suspect a token has been compromised, disable API access immediately from the same profile menu and re-enable it to generate a new token.
Authenticating requests
All API requests require the Authorization header with your Bearer token:
curl -X GET "https://cloud.octosinfra.com/backend/api/virtual-machines" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
Enable API (programmatic)
If you already have a session token (from /login), you can enable API access programmatically:
curl -X POST "https://cloud.octosinfra.com/backend/api/profile/api/enable" \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-F "token_name=My API Token" \
-F "expires_at=2026-12-31"
Response:
{
"status": "Success",
"message": "API enabled successfully",
"data": {
"message": "API enabled successfully",
"token": "9e130f81-xxxx-xxxx-xxxx-xxxxxxxxxxxx|SzVg1D6a5ZZ..."
}
}
Retrieve existing token
curl -X GET "https://cloud.octosinfra.com/backend/api/profile/api/access-token" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
Response:
{
"status": "Success",
"message": "Ok",
"data": {
"token": "9e254ec7-xxxx-xxxx-xxxx-xxxxxxxxxxxx|csJK7LAd...",
"expires_at": "07-02-2025 02:02 PM"
}
}
Disable API access
curl -X DELETE "https://cloud.octosinfra.com/backend/api/profile/api/disable" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Examples
Explore common tasks you can automate with the API:
- Create a Virtual Machine — Provision compute, set access credentials, and manage VM lifecycle
- Manage Networks — Create virtual networks and attach them to VMs
- Manage Block Storage Volumes — Provision, attach, resize, and snapshot persistent storage
- Monitor Infrastructure — Query CPU, memory, disk, and network metrics
Quick reference: All API sections
| Category | Key endpoints |
|---|---|
| Authentication | /login, /register, /reset-password |
| Projects | /projects |
| Virtual Machines | /virtual-machines |
| Block Storage | /blockstorages |
| Snapshots | /blockstorages/snapshots |
| Backups | /blockstorages/backups |
| Networks | /networks, /network/categories |
| Virtual Routers | /virtual-routers |
| IP Addresses | /ip-addresses |
| Security Groups | /security-groups |
| Load Balancers | /loadbalancers |
| Monitoring | /monitoring |
| DNS | /dns |
| Billing | /billing |
| Profile | /profile |
| Support | /support-tickets |
For the complete endpoint list with request/response schemas, visit the Interactive API Documentation.