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"
}
]
}'
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",
"hostname": "db.example.com",
"database": "postgres",
"username": "postgres",
"password": "secret-password",
"port": 5432,
"ssl": true,
"replication_slots": [
{
"publication_name": "sequin_pub",
"slot_name": "sequin_slot"
}
]
}'
curl --request POST \
--url https://api.sequinstream.com/api/postgres_databases \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"name": "replica-db",
"hostname": "replica.example.com",
"database": "postgres",
"username": "postgres",
"password": "replica-password",
"port": 5432,
"ssl": true,
"primary": {
"hostname": "primary.example.com",
"database": "postgres",
"username": "postgres",
"password": "primary-password",
"port": 5432,
"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"
}
]
}
Postgres databases
Create database
Create a new Postgres database connection with a replication slot.
POST
/
api
/
postgres_databases
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"
}
]
}'
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",
"hostname": "db.example.com",
"database": "postgres",
"username": "postgres",
"password": "secret-password",
"port": 5432,
"ssl": true,
"replication_slots": [
{
"publication_name": "sequin_pub",
"slot_name": "sequin_slot"
}
]
}'
curl --request POST \
--url https://api.sequinstream.com/api/postgres_databases \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"name": "replica-db",
"hostname": "replica.example.com",
"database": "postgres",
"username": "postgres",
"password": "replica-password",
"port": 5432,
"ssl": true,
"primary": {
"hostname": "primary.example.com",
"database": "postgres",
"username": "postgres",
"password": "primary-password",
"port": 5432,
"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"
}
]
}
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 username.
The database password.
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.
Show primary properties
Show primary properties
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.Response
A database object is returned in the response.Show properties
Show properties
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.
Indicates whether this database connection uses the Sequin local tunnel.
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.
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"
}
]
}'
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",
"hostname": "db.example.com",
"database": "postgres",
"username": "postgres",
"password": "secret-password",
"port": 5432,
"ssl": true,
"replication_slots": [
{
"publication_name": "sequin_pub",
"slot_name": "sequin_slot"
}
]
}'
curl --request POST \
--url https://api.sequinstream.com/api/postgres_databases \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
"name": "replica-db",
"hostname": "replica.example.com",
"database": "postgres",
"username": "postgres",
"password": "replica-password",
"port": 5432,
"ssl": true,
"primary": {
"hostname": "primary.example.com",
"database": "postgres",
"username": "postgres",
"password": "primary-password",
"port": 5432,
"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"
}
]
}
⌘I

