API Overview
DanubeData provides a comprehensive RESTful API that allows you to programmatically manage all your infrastructure resources.
Interactive API Documentation
Our interactive API documentation is available at: /docs/api
You can access it directly by visiting:
- Production:
https://danubedata.ro/docs/api
Our interactive API documentation provides:
- Complete endpoint reference for all API v1 operations
- Try It functionality - test endpoints directly in your browser
- Request/response examples for every endpoint
- Authentication testing with your API tokens
- OpenAPI 3.0 specification for integration tools
Quick Start
1. Get Your API Token
- Navigate to API Tokens in your account settings
- Click Create New Token
- Give it a descriptive name
- Select the appropriate permissions
- Copy the token (shown only once)
2. Make Your First Request
curl -H "Authorization: Bearer YOUR_TOKEN_HERE" \
https://danubedata.ro/api/v1/vps
Note: Ensure your API token has the appropriate permissions (e.g., vps:read) for the endpoints you want to access.
3. Explore the Documentation
Visit /docs/api to:
- Browse all available endpoints
- See detailed request/response formats
- Test endpoints with your token
- Download the OpenAPI specification
API Base URL
Production: https://danubedata.ro/api/v1
All API requests should be made to this base URL followed by the specific endpoint path.
Authentication
All API requests require authentication using a bearer token:
Authorization: Bearer YOUR_TOKEN_HERE
Learn more about authentication in the Authentication Guide.
Available Resources
The API provides access to manage:
Infrastructure
- VPS Instances - Create and manage virtual private servers
- Database Instances - PostgreSQL and MySQL databases
- Cache Instances - Redis cache servers
Storage
- Object Storage - S3-compatible storage buckets
- Access Keys - S3 credentials management
Networking
- Firewalls - Configure security rules
- SSH Keys - Manage access credentials
Operations
- Snapshots - Backup and restore operations
- Webhooks - Event notifications
- Metrics - Resource monitoring
Response Format
All API responses are returned in JSON format:
{
"data": [...],
"pagination": {
"current_page": 1,
"last_page": 5,
"per_page": 15,
"total": 72
}
}
API Token Permissions
API tokens support granular, resource-specific permissions to control access to different parts of the API. When creating an API token, you can select which permissions to grant:
Available Scopes
| Resource | Read Permission | Write Permission | Delete Permission |
|---|---|---|---|
| VPS Instances | vps:read | vps:write | vps:delete |
| Databases | database:read | database:write | database:delete |
| Cache Instances | cache:read | cache:write | cache:delete |
| Object Storage | storage:read | storage:write | storage:delete |
| Firewalls | firewall:read | firewall:write | firewall:delete |
| Snapshots | snapshot:read | snapshot:write | snapshot:delete |
| SSH Keys | ssh-key:read | ssh-key:write | ssh-key:delete |
| Webhooks | webhook:read | webhook:write | - |
Permission Mapping
- Read: Allows viewing/listing resources and their details
- Write: Allows creating, updating, and performing actions on resources
- Delete: Allows deleting resources
Default Permissions
New API tokens are created with basic read permissions by default:
vps:readdatabase:readcache:readstorage:read
Predefined Roles
- Editor: Read and write access to all resources
- Admin: Full access including delete permissions
Rate Limiting
API requests are rate-limited based on your account tier. Rate limit information is included in response headers:
X-RateLimit-Limit- Maximum requests per windowX-RateLimit-Remaining- Remaining requestsX-RateLimit-Reset- Reset timestamp
Error Handling
The API uses standard HTTP status codes:
200 OK- Request succeeded201 Created- Resource created successfully204 No Content- Success with no response body400 Bad Request- Invalid request parameters401 Unauthorized- Missing or invalid authentication403 Forbidden- Insufficient permissions or token scopes404 Not Found- Resource not found422 Unprocessable Entity- Validation error429 Too Many Requests- Rate limit exceeded500 Internal Server Error- Server error
Error responses include details:
{
"message": "The given data was invalid.",
"errors": {
"name": ["The name field is required."]
}
}
SDK and Client Libraries
You can generate client SDKs in any language using our OpenAPI specification:
# Download the spec
curl https://danubedata.ro/docs/api.json > api-spec.json
# Generate a Python client
openapi-generator-cli generate \
-i api-spec.json \
-g python \
-o danubedata-python-client
# Or JavaScript/TypeScript
openapi-generator-cli generate \
-i api-spec.json \
-g typescript-axios \
-o danubedata-ts-client
Next Steps
To access the interactive API documentation, open a new browser tab and navigate to:
/docs/api(or click your browser's address bar and type this path)
Or explore these guides:
- Authentication Guide - Learn about API tokens
- Rate Limits - Understand usage limits
Need Help?
- Visit
/docs/apiin your browser for detailed examples and interactive testing - Contact our support team through the support portal
- Join our community Discord for developer discussions