# list_collections

Source: https://modulify.ai/docs/api/database/list-collections

Lists the tables in a site database with an exact row count for each.

- Title: List database collections
- Scope: `data:read`
- Access: Read only
- Endpoint: `POST /v1/list_collections`

This is the starting point for any question about the content stored in a site. Each table comes back with its `schema`, `name` and `rowCount`, and the `schema` and `name` are what the other data tools take.

Link tables that hold nothing but two foreign keys, and the join tables behind multi-reference fields, are left out unless you pass `includeHidden`, because they are plumbing rather than content. When you do, they come back with `isHidden` set to true. The field metadata table, `_collection_fields`, is never listed. See [The CMS](https://modulify.ai/docs/data/cms).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/list_collections`, sending the inputs below as a JSON object. The token needs the `data:read` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/list_collections \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'
```

Over MCP, the same method is the [list_collections tool](https://modulify.ai/docs/mcp/database/list-collections).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `includeHidden` | boolean | No | Also lists the internal link tables that join two collections together. Off by default. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.