Rotate a PostgreSQL instance's credentials

Replace the admin user's password with a new generated one. Open connections keep working. New connections need the new password at once.

POST https://{availability_zone}.betterstackcloud.com/v1/postgres/{id}/credentials/rotate
id string required

The ID of the PostgreSQL instance to rotate.

Authorization string required

Bearer $TOKEN

202 Accepted
{
  "user": "jane@example.com",
  "password": "example",
  "database": "example",
  "uri": "example",
  "pooled_uri": "example",
  "public_uri": "example",
  "public_pooled_uri": "example",
  "ca_certificate": "example"
}

Returns the admin user's connection details with the new password.

user string

The SQL username.

password string

The new password.

database string

The database the URIs connect to.

uri string

The URI to connect to PostgreSQL directly from your networks, with the new password.

pooled_uri string

The URI to connect through PgBouncer from your networks, with the new password.

public_uri string or null

The URI to connect to PostgreSQL directly from the internet, with the new password, or null when public_access is off.

public_pooled_uri string or null

The URI to connect through PgBouncer from the internet, with the new password, or null when public_access is off.

ca_certificate string

Our CA certificate in PEM format, to verify the server's certificate.