Managed Databases API · Dashboard
Export & import
Export a database to a file, download it, and import a dump into an instance.
Base URL: https://api.hubfly.space. Use a Dashboard bearer token authorized for the project. Replace :projectId in each path with the Dashboard project ID. JSON routes use Content-Type: application/json.
Database instances live in a project of type managed; other projects return 409 MANAGED_PROJECT_REQUIRED. Replace :instanceId with the database instance ID from the instance list. Each endpoint lists the permission it needs; a token scoped to the database permissions must hold that exact permission.
How to use these endpoints
- Start an export of one database (PostgreSQL offers
nativeorsql; MySQL and SQLite export compressed SQL). Exports are asynchronous; poll the returned operation, then request a download URL, which is valid for 10 minutes. - Exports expire after 7 days. Automatic backups are not available yet, so keep your own copies.
- To import, request an upload URL (files up to 5 GB), upload the file with
PUT, then start the import and poll its operation.
Export a database
curl -X POST "https://api.hubfly.space/api/v1/projects/$PROJECT_ID/managed/instances/$INSTANCE_ID/exports/create" \
-H "Authorization: Bearer $HUBFLY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"databaseName":"app","format":"native"}'The response uses the standard Dashboard envelope: ok, data, and meta on success. On failure, use the returned error code and message to decide whether to correct the request or retry. The exact schema and response codes for each operation are below.
Endpoint reference
Dashboard endpoints (6)
These JSON routes are served by the Hubfly space Dashboard API and use Dashboard project authorization.
| Method | Path | Purpose |
|---|---|---|
| GET | /api/v1/projects/:projectId/managed/instances/:instanceId/backups | Read backup status |
| POST | /api/v1/projects/:projectId/managed/instances/:instanceId/exports/create | Start a database export |
| GET | /api/v1/projects/:projectId/managed/instances/:instanceId/exports | List exports and imports |
| POST | /api/v1/projects/:projectId/managed/instances/:instanceId/exports/:exportId/download | Create an export download link |
| POST | /api/v1/projects/:projectId/managed/instances/:instanceId/imports/upload | Create an import upload URL |
| POST | /api/v1/projects/:projectId/managed/instances/:instanceId/imports/:importId/start | Start an import |
GETRead backup statusDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/backups
Reports backup availability for a database. Automatic backups are coming_soon; manual exports are available today through the exports endpoints.
- Requires
database:read. - Realtime servers return
409 MANAGED_FEATURE_UNSUPPORTED.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
instanceId | path | Yes | string | — |
Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "automatic": { "type": "object", "properties": { "status": { "const": "coming_soon", "type": "string" } }, "required": [ "status" ], "additionalProperties": false }, "manualExports": { "const": true, "type": "boolean" } }, "required": [ "automatic", "manualExports" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "automatic": { "status": "string" }, "manualExports": true }, "meta": { "requestId": "string", "timestamp": "string" } }
POSTStart a database exportDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/exports/create
Starts a dump of one database (the default database when databaseName is omitted) to a file you can download. PostgreSQL supports native and sql formats; MySQL and SQLite export compressed SQL.
- Requires
database:admin. - Asynchronous: returns the export record and an
operationId; poll the instance operation, then request a download link. - The instance must be running (
409 MANAGED_INSTANCE_NOT_RUNNING). Exports are limited to 5 GB. - Finished exports can be downloaded for 7 days.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
instanceId | path | Yes | string | — |
JSON request body
| Field | Type / allowed values | Required |
|---|---|---|
databaseName | string | No |
format | native | sql | No |
Complete request schema
{
"type": "object",
"properties": {
"databaseName": {
"type": "string"
},
"format": {
"type": "string",
"enum": [
"native",
"sql"
]
}
},
"required": [],
"additionalProperties": false
}Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "export": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string", "enum": [ "export", "import" ] }, "status": { "type": "string", "enum": [ "pending", "failed", "succeeded", "expired", "running", "uploading" ] }, "databaseName": { "type": "string", "nullable": true }, "format": { "type": "string", "enum": [ "native", "sql" ] }, "fileName": { "type": "string", "nullable": true }, "sizeBytes": { "type": "number", "nullable": true }, "sha256": { "type": "string", "nullable": true }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": [ "code", "message" ], "additionalProperties": false, "nullable": true }, "createdAt": { "type": "string", "description": "Date string" }, "finishedAt": { "type": "string", "description": "Date string", "nullable": true }, "expiresAt": { "type": "string", "description": "Date string", "nullable": true } }, "required": [ "id", "kind", "status", "databaseName", "format", "fileName", "sizeBytes", "sha256", "error", "createdAt", "finishedAt", "expiresAt" ], "additionalProperties": false }, "operationId": { "type": "string" } }, "required": [ "export", "operationId" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "export": { "id": "string", "kind": "export", "status": "pending", "databaseName": "string", "format": "native", "fileName": "string", "sizeBytes": 0, "sha256": "string", "error": { "code": "string", "message": "string" }, "createdAt": "string", "finishedAt": "string", "expiresAt": "string" }, "operationId": "string" }, "meta": { "requestId": "string", "timestamp": "string" } }
GETList exports and importsDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/exports
Lists up to 100 recent exports and imports for the database, newest first, with status, format, file name, size, checksum, error and expiry. available tells you whether exports are offered for this instance.
- Requires
database:admin. - Still answers after the instance is deleted, so earlier exports stay reachable until they expire.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
instanceId | path | Yes | string | — |
Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string", "enum": [ "export", "import" ] }, "status": { "type": "string", "enum": [ "pending", "failed", "succeeded", "expired", "running", "uploading" ] }, "databaseName": { "type": "string", "nullable": true }, "format": { "type": "string", "enum": [ "native", "sql" ] }, "fileName": { "type": "string", "nullable": true }, "sizeBytes": { "type": "number", "nullable": true }, "sha256": { "type": "string", "nullable": true }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": [ "code", "message" ], "additionalProperties": false, "nullable": true }, "createdAt": { "type": "string", "description": "Date string" }, "finishedAt": { "type": "string", "description": "Date string", "nullable": true }, "expiresAt": { "type": "string", "description": "Date string", "nullable": true } }, "required": [ "id", "kind", "status", "databaseName", "format", "fileName", "sizeBytes", "sha256", "error", "createdAt", "finishedAt", "expiresAt" ], "additionalProperties": false } }, "available": { "type": "boolean" } }, "required": [ "items", "available" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "items": [ { "id": "string", "kind": "export", "status": "pending", "databaseName": "string", "format": "native", "fileName": "string", "sizeBytes": 0, "sha256": "string", "error": { "code": "string", "message": "string" }, "createdAt": "string", "finishedAt": "string", "expiresAt": "string" } ], "available": true }, "meta": { "requestId": "string", "timestamp": "string" } }
POSTCreate an export download linkDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/exports/:exportId/download
Returns a signed URL for downloading a finished export, valid for 10 minutes, with the file name.
- Requires
database:admin. - The URL grants access to the file; the response is sent with
cache-control: no-store. - Errors:
404 MANAGED_EXPORT_NOT_READY(not finished),410 MANAGED_EXPORT_EXPIRED. - Works for exports of a deleted instance until they expire.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
instanceId | path | Yes | string | — |
exportId | path | Yes | string | — |
JSON request body
| Field | Type / allowed values | Required |
|---|
Complete request schema
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "url": { "type": "string" }, "expiresAt": { "type": "string", "description": "Date string" }, "fileName": { "type": "string" } }, "required": [ "url", "expiresAt", "fileName" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "url": "string", "expiresAt": "string", "fileName": "string" }, "meta": { "requestId": "string", "timestamp": "string" } }
POSTCreate an import upload URLDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/imports/upload
Registers an import and returns a signed URL, valid for one hour, to which you upload the dump file with an HTTP PUT. Start the import afterwards with the returned importId.
- Requires
database:admin. sizeBytesmust be between 1 byte and 5 GB (400 MANAGED_IMPORT_TOO_LARGE). PostgreSQL acceptsnativeorsql; MySQL and SQLite acceptsql.- The upload URL grants write access; the response is sent with
cache-control: no-store. - The instance must be running (
409 MANAGED_INSTANCE_NOT_RUNNING).
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
instanceId | path | Yes | string | — |
JSON request body
| Field | Type / allowed values | Required |
|---|---|---|
fileName | string | Yes |
sizeBytes | number | Yes |
format | native | sql | No |
databaseName | string | No |
Complete request schema
{
"type": "object",
"properties": {
"fileName": {
"type": "string"
},
"sizeBytes": {
"type": "number"
},
"format": {
"type": "string",
"enum": [
"native",
"sql"
]
},
"databaseName": {
"type": "string"
}
},
"required": [
"fileName",
"sizeBytes"
],
"additionalProperties": false
}Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "importId": { "type": "string" }, "uploadUrl": { "type": "string" }, "expiresAt": { "type": "string", "description": "Date string" }, "maxBytes": { "type": "number" } }, "required": [ "importId", "uploadUrl", "expiresAt", "maxBytes" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "importId": "string", "uploadUrl": "string", "expiresAt": "string", "maxBytes": 0 }, "meta": { "requestId": "string", "timestamp": "string" } }
POSTStart an importDetails +/api/v1/projects/:projectId/managed/instances/:instanceId/imports/:importId/start
Loads an uploaded file into the database chosen when the upload was created.
- Requires
database:admin. - Asynchronous: returns an
operationId; poll the instance operation until it ends. - Returns
404 MANAGED_IMPORT_NOT_FOUNDif the import is unknown or was already started. The instance must be running.
Request parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
projectId | path | Yes | string | — |
instanceId | path | Yes | string | — |
importId | path | Yes | string | — |
JSON request body
| Field | Type / allowed values | Required |
|---|
Complete request schema
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}Responses
200— Successful responseResponse schema
{ "type": "object", "properties": { "ok": { "const": true, "type": "boolean" }, "data": { "type": "object", "properties": { "operationId": { "type": "string" } }, "required": [ "operationId" ], "additionalProperties": false }, "meta": { "type": "object", "properties": { "requestId": { "type": "string" }, "timestamp": { "type": "string" } }, "required": [ "requestId", "timestamp" ], "additionalProperties": false } }, "required": [ "ok", "data", "meta" ], "additionalProperties": false }Example response
{ "ok": true, "data": { "operationId": "string" }, "meta": { "requestId": "string", "timestamp": "string" } }