# List databases

`GET /v1/databases`

Returns all databases the token has access to. Optionally filter by project ID.

## [Authorization](#authorization)

AuthorizationBearer \<token>

OAuth2 authentication

In: `header`

Scope: `workspace:admin, offline_access`

## [Query Parameters](#query-parameters)

cursor?|

Cursor for pagination

limit?number

Limit for pagination

Default`100`

projectId?string

Filter databases by project ID

Match`^(proj_)?([cC][^\s-]{8,}|[a-z0-9]+)$`

logicalId?string

Declared identity of the resource, unique within its branch. Set by the tool that declares the resource.

Match`^[A-Za-z0-9][A-Za-z0-9._-]*$`

Length`length <= 255`

branchId?string|

branchGitName?string

Length`1 <= length`

## [Response Body](#response-body)

### `application/json`

### `application/json`

### `application/json`

::::tabs
:::tab{title="cURL"}
```
curl -X GET "https://example.com/v1/databases"
```
:::

:::tab{title="JavaScript"}
```
{
  "data": [
    {
      "id": "string",
      "type": "database",
      "url": "http://example.com",
      "name": "string",
      "status": "failure",
      "createdAt": "2019-08-24T14:15:22Z",
      "isDefault": true,
      "defaultConnectionId": "string",
      "connections": [
        {
          "id": "string",
          "type": "connection",
          "url": "http://example.com",
          "name": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "kind": "postgres",
          "endpoints": {
            "direct": {
              "host": "string",
              "port": 0
            },
            "pooled": {
              "host": "string",
              "port": 0
            },
            "accelerate": {
              "host": "string",
              "port": 0
            }
          },
          "directConnection": {
            "host": "string",
            "pass": "string",
            "user": "string"
          },
          "database": {
            "id": "string",
            "url": "http://example.com",
            "name": "string"
          }
        }
      ],
      "project": {
        "id": "string",
        "url": "http://example.com",
        "name": "string"
      },
      "region": {
        "id": "string",
        "name": "string"
      },
      "source": {
        "type": "empty"
      },
      "branchId": "string",
      "logicalId": "string"
    }
  ],
  "pagination": {
    "nextCursor": "string",
    "hasMore": true
  }
}
```
:::

:::tab{title="Go"}
:::

:::tab{title="Python"}
:::

:::tab{title="Java"}
:::

:::tab{title="C#"}
:::

:::tab{title="Rust"}
:::
::::

## Related pages

- [Authentication & Tools](./authentication-tools-index.md)
- [Build](./build-index.md)
- [Changelog](../changelog.md)
- [Concepts](./concepts-index.md)
- [Console commands](./console-commands-index.md)
- [Contract Authoring](./contract-authoring-index.md)
- [Core Concepts](./core-concepts-index.md)
- [Data Modeling](./data-modeling-index.md)
- [Database](./database-index.md)
- [DB commands](./db-commands-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
