POST/v2/databases/{database_cluster_uuid}/pools

Create a PostgreSQL connection pool

Creates a PgBouncer connection pool for a PostgreSQL database cluster. Supply name, mode, size, and db; choose a transaction mode supported by PgBouncer and set the pool size according to the primary node's capacity. The response includes the created pool and its connection details.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 9 body fields
database_cluster_uuidstringrequired
The unique identifier of the database cluster, in UUID format.

Connection pool configuration. name, mode, size, and db are required.

namestringrequired
A unique name for the connection pool. Must be between 3 and 60 characters.
modestringrequired
The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.
sizeintegerrequired
The desired size of the PGBouncer connection pool. The maximum allowed size is determined by the size of the cluster's primary node. 25 backend server connections are allowed for every 1GB of RAM. Three are reserved for maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of 22 backend server connections while one with 4 GB would allow for 97. Note that these are shared across all connection pools in a cluster.
dbstringrequired
The database for use with the connection pool.
userstringoptional
The name of the user for use with the connection pool. When excluded, all sessions connect to the database as the inbound user.
connectionobjectoptional
Generated public connection details for the pool; these are returned by the API rather than set in the request.
private_connectionobjectoptional
Generated private connection details for the pool; these are returned by the API rather than set in the request.
standby_connectionobjectoptional
Generated public standby connection details for the pool; these are returned by the API rather than set in the request.
standby_private_connectionobjectoptional
Generated private standby connection details for the pool; these are returned by the API rather than set in the request.

6 status codes
201Returns a `pool` object containing the created connection pool's configuration and connection details.
poolobjectrequired
401Returned when authentication fails because the credentials are invalid.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404Returned when the requested resource is not found.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429Returned when the API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500Returned when a server error occurs.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 401 is returned when credentials are invalid. A 404 is returned when the requested resource is not found. A 429 indicates that the API rate limit has been exceeded, and a 500 indicates a server error. The database_cluster_uuid path parameter must be a valid UUID; name, mode, size, and db are required, name must be 3 to 60 characters, and mode must be session, transaction, or statement. The maximum size depends on the primary node's RAM.