API V1
  • Global information
  • Authentication
  • Data format
  • Rate Limit
  • Errors
  • Pagination
RESOURCES
  • Addon providers
  • Addons
  • Alerts
  • Applications
  • Audit Logs
  • Autoscalers
  • Billing
  • Collaborators
  • Container Sizes
  • Cron Tasks
  • Data Access Consents
  • Databases
    • Create a Database as a Dedicated Resource
    • List Your Dedicated Resource Databases
    • Get a Dedicated Resource Database
  • Deployment
  • Domains
  • Environment variables
  • Event Categories
  • Event Types
  • Events
  • Invoices
  • SSH Keys
  • Log Drains
  • Application Logs
  • Metrics
  • Notification Platforms
  • Notifiers
  • One-off Containers
  • Operations
  • Projects
  • Referral
  • Regions
  • SCM Integrations
  • Integration Link
  • Sources
  • Stacks
  • Tokens
  • User Account
LINKS
  • Addon Provider API
  • Database API
  • One-click Deployment API
  • scalingo.json Schema
  • Main site
  • Dashboard

Databases as Dedicated Resources

Databases endpoints allows you to manage Databases provisioned as Dedicated Resources.

Dedicated Resource databases offer enhanced performance, isolation, and control compared to standard addon databases.

Standard addon databases should be managed via the Addons endpoints.

Database attributes

field type description
id string unique ID
name string name of the database
project_id string ID of the project the database belongs to
technology string database technology (e.g., postgresql-ng)
plan string plan name (e.g., postgresql-dr-starter-4096)

Example object:

{
  "id": "54100930736f7563d5030000",
  "name": "my-postgres-db",
  "project_id": "pr-82a3cac5-9b25-473e-b33d-6272b87e636f",
  "technology": "postgresql-ng",
  "plan": "postgresql-dr-starter-4096"
}

Create a Database as a Dedicated Resource

POST https://$SCALINGO_API_URL/v1/databases

Parameters

  • database.name: Database name. Should have between 6 and 48 lower case alphanumerical characters and hyphens.
  • database.technology: Database technology identifier. Only postgresql-ng is supported for now.
  • database.plan: Plan identifier (e.g., postgresql-dr-starter-4096). Available plans can be retrieved via the Addon Providers endpoint.
  • database.project_id: (Optional) ID of the project to assign the database to. If not provided, the database will be assigned to your default project.

Note: To provision other database types (MySQL, MongoDB, Redis, etc.), please use the Addons provisioning endpoint.

Example

curl -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -X POST https://$SCALINGO_API_URL/v1/databases -d \
  '{
    "database": {
      "name": "my-postgres-db",
      "technology": "postgresql-ng",
      "plan": "postgresql-dr-starter-4096",
      "project_id": "pr-82a3cac5-9b25-473e-b33d-6272b87e636f"
    }
  }'

Returns 201 Created

{
  "database": {
    "id": "54100930736f7563d5030000",
    "name": "my-postgres-db",
    "project_id": "pr-82a3cac5-9b25-473e-b33d-6272b87e636f",
    "technology": "postgresql-ng",
    "plan": "postgresql-dr-starter-4096"
  }
}

List Your Dedicated Resource Databases

GET https://$SCALINGO_API_URL/v1/databases

List all your databases of postgresql-ng technology, including those where you are a collaborator.

Example

curl -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -X GET https://$SCALINGO_API_URL/v1/databases

Returns 200 OK

{
  "databases": [
    {
      "id": "54100930736f7563d5030000",
      "name": "my-postgres-db",
      "project_id": "pr-82a3cac5-9b25-473e-b33d-6272b87e636f",
      "technology": "postgresql-ng",
      "plan": "postgresql-dr-starter-4096"
    },
    {
      "id": "54100930736f7563d5030001",
      "name": "backup-db",
      "project_id": "pr-82a3cac5-9b25-473e-b33d-6272b87e636f",
      "technology": "postgresql-ng",
      "plan": "postgresql-dr-business-4096"
    }
  ]
}

Get a Dedicated Resource Database

GET https://$SCALINGO_API_URL/v1/databases/[:database]

Display a precise database of postgresql-ng technology.

The [:database] parameter can be either the database ID or the database name.

Example request

curl -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -X GET https://$SCALINGO_API_URL/v1/databases/my-postgres-db

Returns 200 OK

{
  "database": {
    "id": "54100930736f7563d5030000",
    "name": "my-postgres-db",
    "project_id": "pr-82a3cac5-9b25-473e-b33d-6272b87e636f",
    "technology": "postgresql-ng",
    "plan": "postgresql-dr-starter-4096"
  }
}

Returns 404 Not Found if the database doesn’t exist

{
  "error": "Database not found"
}