List databases
List the PlanetScale databases connected to a project, with their live state and metrics from PlanetScale.
The top-level fields and planetscale are what Unkey stores about the database. details is what PlanetScale reports right now, and details.metrics holds the last 24 hours of metrics for the default branch.
If PlanetScale can’t answer for a database, for example because it was deleted or the account lost access, the database still appears without details. status is deleted or unreachable, and for unreachable, error tells you why. One unreachable database never fails the whole request.
Results are ordered by database ID. When hasMore is true, pass the returned cursor to fetch the next page.
The workspace needs the databases, connections and app_v2 flags. Without them you get a 403.
Required Permissions
Your root key must have one of these permissions:
unkey:v1:<workspace_id>:projects/*/databases/*#read(any database in any project)unkey:v1:<workspace_id>:projects/<project_id>/databases/*#read(any database in one project)unkey:v1:<workspace_id>:projects/<project_id>/databases/<database_id>#read(one database)
The list only includes databases your key can read.
Replace <workspace_id> with the authenticated workspace ID.
Authorizations
Unkey uses bearer tokens for authentication. Public integrations use root keys, while the dashboard proxy uses short-lived JWTs. To authenticate, include the token in the Authorization header of each request:
Root keys have specific permissions attached to them, controlling what operations they can perform. Resource permissions use Unkey Resource Names plus actions, like unkey:v1:ws_123:projects/*/keyspaces/*/keys/*#write.
Security best practices:
- Keep root keys secure and never expose them in client-side code
- Use different root keys for different environments
- Rotate keys periodically, especially after team member departures
- Create keys with minimal necessary permissions following least privilege principle
- Monitor key usage with audit logs.
Body
Response
The databases of the project.