Skip to main content
Database methods return the API response data directly. Use the database’s _id as databaseId: string. The SDK rejects blank IDs and the URL segments . and .., and encodes valid IDs. The API checks access and can return HTTP 404.

Parameters

Methods

getDatabases

GET /v1/databases Options: page?: number (integer 1–100,000, default 1), limit?: number (integer 1–100, default 10) and team?: string to list a team’s databases. Returns DatabaseListResponse.

createDatabase

POST /v1/databases/create Pass name, type, memoryMB, password and optionally team. The SDK accepts mysql, postgresql, mongodb and redis. The SQL engines require non-blank username and database. MongoDB requires username and rejects database. Redis rejects both. Returns DatabaseResponseData.
The API can return HTTP 400 for invalid credentials or 403 for insufficient plan resources.

getDatabase

GET /v1/databases/{databaseId} Pass databaseId. Returns DatabaseResponseData, including public connection fields.
Keep the password supplied at creation or rotation. See the connection URL recipe.

updateDatabase

PUT /v1/databases/{databaseId} Pass databaseId and at least one of name: string or memoryMB: number. The validation above applies to every supplied field. Returns DatabaseMutationResponse.

deleteDatabase

DELETE /v1/databases/{databaseId} Pass databaseId. Returns MessageResponse.

updateDatabaseCredentials

POST /v1/databases/{databaseId}/update-credentials Pass databaseId and a new password: string following the rules above. Returns DatabaseMutationResponse.

startDatabase

POST /v1/databases/{databaseId}/start Pass databaseId to start the database. Returns DatabaseResponseData.

stopDatabase

POST /v1/databases/{databaseId}/stop Pass databaseId to stop the database. Returns DatabaseResponseData.

restartDatabase

POST /v1/databases/{databaseId}/restart Pass databaseId to restart the database. Returns DatabaseResponseData.

getDatabaseMetrics

GET /v1/databases/{databaseId}/metrics Pass databaseId and optional hours: number. It must be an integer from 1 to 720 and defaults to 24. Returns DatabaseMetricSeries.

getDatabaseInsights

GET /v1/databases/{databaseId}/insights Pass databaseId. Returns DatabaseInsightsResponse, with insights: null until a sample exists.

getDatabaseLogs

GET /v1/databases/{databaseId}/logs Pass databaseId and optional LogStreamOptions. The SDK requires an integer tail from 0 to 500 if provided (default 100). Pass signal: AbortSignal to cancel. Returns Readable with raw SSE frames.
See Live console for frame handling, cancellation and stream errors.