API Overview
The Sparbz Cloud API lets you programmatically manage your infrastructure.
Base URL
https://api.sparbz.cloud/v1
Authentication
All API requests require authentication via API key or JWT token.
API Key
Include your API key in the X-API-Key header:
curl https://api.sparbz.cloud/v1/databases \
-H "X-API-Key: YOUR_API_KEY"
JWT Token
For user authentication, use the Authorization header with a Bearer token:
curl https://api.sparbz.cloud/v1/databases \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response Format
All responses are JSON with a consistent structure:
Success Response
{
"data": { ... },
"meta": {
"request_id": "req_abc123"
}
}
List Response
{
"data": [ ... ],
"meta": {
"total": 100,
"page": 1,
"per_page": 20,
"request_id": "req_abc123"
}
}
Error Response
{
"error": {
"code": "invalid_request",
"message": "The request body is invalid",
"details": { ... }
},
"meta": {
"request_id": "req_abc123"
}
}
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 422 | Validation Error |
| 429 | Rate Limited |
| 500 | Server Error |
Rate Limiting
API requests are rate limited:
- Standard: 1000 requests/minute
- Burst: 100 requests/second
Rate limit headers are included in responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1700000000
Pagination
List endpoints support pagination:
GET /v1/databases?page=2&per_page=50
Parameters:
page: Page number (default: 1)per_page: Items per page (default: 20, max: 100)
Filtering
Most list endpoints support filtering:
GET /v1/databases?status=active&plan=starter
API Reference
Resources
- Databases - PostgreSQL, MySQL, MongoDB, Redis
- Kafka - Event streaming and message queues
- Vault - Secret management and encryption
- VPC - Virtual Private Cloud and networking
- NFS - Network File System for shared storage
- Backups - Backup policies and restoration
- Integrations - GitHub, Cloudflare, Datadog, PagerDuty, Slack
- Usage - Resource usage tracking and quotas
SDKs
Official SDKs are available: