Back to Documentation
API Reference
Programmatic access to the CapaCloud platform
Overview
CapaCloud provides a REST API for programmatic access to the platform. All API endpoints are prefixed with /api.
Authentication
Most API endpoints require wallet authentication. Include your wallet address in requests as specified by each endpoint.
Endpoints
Authentication
POST /api/auth/login- Login/register with walletGET /api/auth/user- Get user informationAccount
GET /api/account/balance- Get account balancePOST /api/account/balance- Top up or claim balanceGET /api/account/settings- Get account settingsPUT /api/account/settings- Update account settingsMachines
GET /api/machines/list- List available machinesGET /api/machines/pending- List pending machinesPOST /api/machines/register- Register a machineGET /api/machines/[machineId]- Get machine detailsGET /api/machines/check-active-rentals- Check for active rentalsRentals
GET /api/rentals/list- List user rentalsPOST /api/rentals/create- Create a rentalGET /api/rentals/[rentalId]- Get rental detailsPATCH /api/rentals/[rentalId]- Update rental (pause/resume/stop)POST /api/rentals/[rentalId]/console- Execute console commandWorker
POST /api/worker/register- Register worker (heartbeat)Example Requests
Get Account Balance
GET /api/account/balance?walletAddress=YOUR_WALLET_ADDRESSList Available Machines
GET /api/machines/listCreate Rental
POST /api/rentals/create
{
"machineId": "machine_id",
"renterWalletAddress": "wallet_address"
}Response Format
All API responses follow a consistent format:
{
"success": true,
"data": { ... },
"error": null
}Error Handling
Errors are returned with appropriate HTTP status codes:
400Bad Request (missing/invalid parameters)
401Unauthorized (wallet not connected)
403Forbidden (insufficient permissions)
404Not Found
500Internal Server Error
Rate Limiting
API rate limiting may apply to prevent abuse. Contact support if you need higher limits.