Get a PostgreSQL instance's credentials

Get the admin user's password, the direct and pooled connection URIs, and the ca_certificate that signed the instance's certificate.

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

The ID of the PostgreSQL instance.

Authorization string required

Bearer $TOKEN

200 OK
{
  "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.

user string

The SQL username.

password string

The user's password.

database string

The database the URIs connect to, defaultdb when the instance has it, or else the first database by name.

uri string

The URI to connect to PostgreSQL directly from your networks, with the password and sslmode=verify-full.

pooled_uri string

The URI to connect through PgBouncer from your networks, with the password and sslmode=verify-full.

public_uri string or null

The URI to connect to PostgreSQL directly from the internet, with the password and sslmode=verify-full, or null when public_access is off.

public_pooled_uri string or null

The URI to connect through PgBouncer from the internet, with the password and sslmode=verify-full, or null when public_access is off.

ca_certificate string

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