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

  1. Navigate to API Tokens in your account settings
  2. Click Create New Token
  3. Give it a descriptive name
  4. Select the appropriate permissions
  5. Copy the token (shown only once)

2. Make Your First Request

Bash
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

Text
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:

Text
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:

JSON
{
  "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

ResourceRead PermissionWrite PermissionDelete Permission
VPS Instancesvps:readvps:writevps:delete
Databasesdatabase:readdatabase:writedatabase:delete
Cache Instancescache:readcache:writecache:delete
Object Storagestorage:readstorage:writestorage:delete
Firewallsfirewall:readfirewall:writefirewall:delete
Snapshotssnapshot:readsnapshot:writesnapshot:delete
SSH Keysssh-key:readssh-key:writessh-key:delete
Webhookswebhook:readwebhook: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:read
  • database:read
  • cache:read
  • storage: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 window
  • X-RateLimit-Remaining - Remaining requests
  • X-RateLimit-Reset - Reset timestamp

Error Handling

The API uses standard HTTP status codes:

  • 200 OK - Request succeeded
  • 201 Created - Resource created successfully
  • 204 No Content - Success with no response body
  • 400 Bad Request - Invalid request parameters
  • 401 Unauthorized - Missing or invalid authentication
  • 403 Forbidden - Insufficient permissions or token scopes
  • 404 Not Found - Resource not found
  • 422 Unprocessable Entity - Validation error
  • 429 Too Many Requests - Rate limit exceeded
  • 500 Internal Server Error - Server error

Error responses include details:

JSON
{
  "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:

Bash
# 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/api in your browser for detailed examples and interactive testing
  • Contact our support team through the support portal
  • Join our community Discord for developer discussions