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.string
required
A name for this database connection. You can use this name to identify the database across the API.
string
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.string
required
The database server hostname.
string
required
The name of the logical database in Postgres.
string
required
The database username.
string
required
The database password.
integer
The database server port. Defaults to
5432.boolean
Whether to use SSL for the connection. Defaults to
true.boolean
Whether to use IPv6 for the connection. Defaults to
false.object
Connection details for the primary database, only needed when connecting to a replica.
Show primary properties
Show primary properties
string
required
The primary database server hostname.
string
required
The name of the logical database in the primary Postgres instance.
string
required
The primary database username.
string
required
The primary database password.
integer
The primary database server port. Defaults to
5432.boolean
Whether to use SSL for the primary connection. Defaults to
true.array
required
Response
A database object is returned in the response.Show properties
Show properties
string (uuid)
The ID of the database connection.
string
The user-defined name for the database connection.
string
The hostname of the database server.
integer
The port number for the database connection.
string
The name of the logical Postgres database to connect to.
string
The username for authenticating with the database.
string
The password for authenticating with the database. This will be obfuscated unless
show_sensitive=true is used.boolean
Indicates whether SSL is enabled for the connection.
boolean
Indicates whether the hostname resolves to an IPv6 address.
boolean
Indicates whether this database connection uses the Sequin local tunnel.
integer
Database connection pool size (internal setting).
integer
Database connection pool queue interval (internal setting).
integer
Database connection pool queue target (internal setting).
array
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

