Request body
For creates, the replication_slots
array must exist and contain exactly one replication slot object.
A name for this database connection. You can use this name to identify the database across the API.
The full connection URL for the database, e.g. postgresql://postgres:secret-password@db.example.com:5432/postgres
. Pass in either this parameter or database
, hostname
, port
, username
, password
. To specify SSL, use the separate ssl
field.
The database server hostname.
The name of the logical database in Postgres.
The database server port. Defaults to 5432
.
Whether to use SSL for the connection. Defaults to true
.
Whether to use IPv6 for the connection. Defaults to false
.
Connection details for the primary database, only needed when connecting to a replica. The primary database server hostname.
The name of the logical database in the primary Postgres instance.
The primary database username.
The primary database password.
The primary database server port. Defaults to 5432
.
Whether to use SSL for the primary connection. Defaults to true
.
The name of the publication to use for this replication slot.
The name of the replication slot.
The replication slot status. Possible values: active
, disabled
. Defaults to active
.
Response
A database object is returned in the response.
The ID of the database connection.
The user-defined name for the database connection.
The hostname of the database server.
The port number for the database connection.
The name of the logical Postgres database to connect to.
The username for authenticating with the database.
The password for authenticating with the database. This will be obfuscated unless show_sensitive=true
is used.
Indicates whether SSL is enabled for the connection.
Indicates whether the hostname resolves to an IPv6 address.
Database connection pool size (internal setting).
Database connection pool queue interval (internal setting).
Database connection pool queue target (internal setting).
Details about the associated replication slot. Will be an empty array if no slot exists. The ID of the replication slot.
The name of the Postgres publication used for replication.
The name of the Postgres replication slot.
status
string (enum: active | disabled)
The current status of the replication slot.
Using URL
Using connection params
Connecting to a replica
curl --request POST \
--url https://api.sequinstream.com/api/postgres_databases \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"name": "example-db",
"url": "postgresql://postgres:secret-password@db.example.com:5432/postgres",
"ssl": true,
"replication_slots": [
{
"publication_name": "sequin_pub",
"slot_name": "sequin_slot"
}
]
}'
{
"id" : "db_01HRMW3ZNE5EFGW9SDXW01TT92" ,
"name" : "example-db" ,
"hostname" : "db.example.com" ,
"database" : "postgres" ,
"username" : "postgres" ,
"password" : "************" ,
"port" : 5432 ,
"ssl" : true ,
"use_local_tunnel" : false ,
"ipv6" : false ,
"replication_slots" : [
{
"id" : "rs_01HRMW3ZNE5EFGW9SDXW01TT93" ,
"publication_name" : "sequin_pub" ,
"slot_name" : "sequin_slot" ,
"status" : "active"
}
]
}