> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dbhost.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Connection limits

> Read and adjust the PgBouncer server connection cap for one database.

`GET /api/v1/databases/{id}/connection-limits` reports the observed
`serverConnectionCap`, `desiredServerConnectionCap`,
`effectiveServerConnectionCap`, `generation`, `policyVersion`, and
`operationStatus`. The allowed range is 2–8. `enforcement` is
`pgbouncer_database_alias`, and `classification` is `admission_cap` after
global rollout. The cap is shared by all roles and PgBouncer pools for that
database. It is not a hard CPU, memory, disk, or client connection quota.

An account owner can request an adjustment with an API key that can write to
the database:

```http theme={null}
POST /api/v1/databases/{id}/connection-limits
Authorization: Bearer <api-key>
Idempotency-Key: <stable-unique-key>
Content-Type: application/json

{"serverConnectionCap":3}
```

Reuse the same idempotency key after a timeout or uncertain result. A pending
change blocks another adjustment until its exact operation is reconciled.
Lowering the cap does not disconnect existing sessions. New connections may
wait for capacity. DBHost checks the complete shared PostgreSQL connection
budget before applying an increase; a request can be rejected even within the
2–8 range when the cluster is full.

The dashboard provides the same change with one confirmation. In the CLI,
use `dbhost databases limits <id>` and
`dbhost databases limits-set <id> <2-8> --idempotency-key KEY`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.