Skip to content

Create connection

POST
/connections
curl --request POST \
--url https://api.reflexdb.cloud/v1/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "backend": "mysql", "name": "example", "mysqlHost": "example", "mysqlPort": 3306, "availableSchemas": [ "example" ], "mysqlUser": "example", "mysqlPassword": "example", "syncMode": "poll", "syncInterval": 30, "instance": { "name": "example", "mysqlDb": "example", "instanceSize": "nano", "logLevel": "info", "binlogServerId": 1 } }'

Creates a new source MySQL connection. Optionally creates a first database instance in the same request via the instance field.

Media type application/json
CreateConnectionBody

Parameters for creating a new source database connection

object
backend

Source database engine

string
default: mysql
Allowed values: mysql postgres mssql
name
required

Display name — must be unique per account

string
>= 1 characters <= 100 characters
mysqlHost
required

Hostname or IP of the source database server

string
>= 1 characters
mysqlPort
integer
default: 3306 >= 1 <= 65535
availableSchemas
required

MySQL database names to expose to instances

Array<string>
>= 1 items
mysqlUser
required
string
>= 1 characters
mysqlPassword
required

Stored in SSM Parameter Store — never written to the database

string
>= 1 characters
syncMode

Poll: periodic full reload; binlog: MySQL CDC; logical: PostgreSQL CDC; cdc: SQL Server CDC

string
default: poll
Allowed values: poll binlog logical cdc
syncInterval

Polling interval in seconds (poll mode only)

integer
default: 30 >= 5 <= 3600
instance

Optional: create a first database instance as part of this request

object
name
required
string
>= 1 characters <= 100 characters
mysqlDb
required

Schema to use — must be one of availableSchemas

string
>= 1 characters
instanceSize
string
default: nano
Allowed values: nano small medium large xlarge 2xlarge
logLevel
string
default: info
Allowed values: info debug warn error
binlogServerId
integer
>= 1

Default Response

Media type application/json
object
connection
required
Connection

A source database connection shared by one or more database instances

object
id
required
string format: uuid
customerId
required
string format: uuid
name
required
string
backend
required

Source database engine

string
Allowed values: mysql postgres mssql
mysqlHost
required
string
mysqlPort
required
integer
>= 1 <= 65535
availableSchemas
required

MySQL database names available to instances on this connection

Array<string>
mysqlUser
required
string
allowedSyncModes
required

Sync modes available to instances

Array<string>
Allowed values: poll binlog logical cdc
minSyncInterval
required

Minimum polling interval in seconds — instances may use a higher value

integer
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
database
Database

A database instance config and its current lifecycle status

object
id
required
string format: uuid
customerId
required
string format: uuid
connectionId
required

The connection that provides source MySQL credentials

string format: uuid
name
required
string
mysqlDb
required

The MySQL schema on the source server for this instance

string
syncMode
required

Sync mode for this instance

string
Allowed values: poll binlog logical cdc
syncInterval
required

Polling interval in seconds (>= connection minSyncInterval)

integer
taskCpu
required

ECS task vCPU units (256 = 0.25 vCPU)

integer
taskMemoryMb
required

ECS task memory in MiB

integer
logLevel
required
string
Allowed values: info debug warn error
status
required
string
Allowed values: registered building deploying running pausing paused resuming terminating terminated failed stopped
lastError
string
nullable
endpointUrl

HTTPS base URL of the running instance

string
nullable
healthStatus
string
nullable
Allowed values: ok degraded unreachable cap_exceeded
buildComputeOverride

Forced CodeBuild compute tier for this instance’s builds; null = auto-select

string
nullable
instanceSize
required
string
Allowed values: nano small medium large xlarge 2xlarge
region
required

AWS region this instance is deployed to

string
binlogServerId
integer
nullable
desiredState

Queued goal — reconciler drives the instance toward this state

string
nullable
reflexdbCustomDomain

Vanity subdomain (Teams+ plan). When set, <value>.reflexdb.cloud resolves to this instance.

string
nullable
pauseSchedule

Recurring pause/resume schedule (UTC). null when no schedule is configured.

object
pauseAt
required

HH:MM UTC

string
resumeAt
required

HH:MM UTC

string
days
required

0=Sun…6=Sat; empty = every day

Array<integer>
tags
required
Array<object>
Tag

A label attached to a database for organisation

object
label
required
string
<= 30 characters
color
required
string
Allowed values: gray red orange yellow green teal blue purple
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{
"connection": {
"backend": "mysql",
"allowedSyncModes": [
"poll"
]
},
"database": {
"syncMode": "poll",
"logLevel": "info",
"status": "registered",
"healthStatus": "ok",
"instanceSize": "nano",
"tags": [
{
"color": "gray"
}
]
}
}

Default Response

Media type application/json
Error
object
error
required
string
message
string
Example generated
{
"error": "example",
"message": "example"
}

Default Response

Media type application/json
Error
object
error
required
string
message
string
Example generated
{
"error": "example",
"message": "example"
}

Default Response

Media type application/json
Error
object
error
required
string
message
string
Example generated
{
"error": "example",
"message": "example"
}