Create connection
const url = 'https://api.reflexdb.cloud/v1/connections';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Parameters for creating a new source database connection
object
Source database engine
Display name — must be unique per account
Hostname or IP of the source database server
MySQL database names to expose to instances
Stored in SSM Parameter Store — never written to the database
Poll: periodic full reload; binlog: MySQL CDC; logical: PostgreSQL CDC; cdc: SQL Server CDC
Polling interval in seconds (poll mode only)
Optional: create a first database instance as part of this request
object
Schema to use — must be one of availableSchemas
Responses
Section titled “ Responses ”Default Response
object
A source database connection shared by one or more database instances
object
Source database engine
MySQL database names available to instances on this connection
Sync modes available to instances
Minimum polling interval in seconds — instances may use a higher value
A database instance config and its current lifecycle status
object
The connection that provides source MySQL credentials
The MySQL schema on the source server for this instance
Sync mode for this instance
Polling interval in seconds (>= connection minSyncInterval)
ECS task vCPU units (256 = 0.25 vCPU)
ECS task memory in MiB
HTTPS base URL of the running instance
Forced CodeBuild compute tier for this instance’s builds; null = auto-select
AWS region this instance is deployed to
Queued goal — reconciler drives the instance toward this state
Vanity subdomain (Teams+ plan). When set, <value>.reflexdb.cloud resolves to this instance.
Recurring pause/resume schedule (UTC). null when no schedule is configured.
object
HH:MM UTC
HH:MM UTC
0=Sun…6=Sat; empty = every day
A label attached to a database for organisation
object
Example
{ "connection": { "backend": "mysql", "allowedSyncModes": [ "poll" ] }, "database": { "syncMode": "poll", "logLevel": "info", "status": "registered", "healthStatus": "ok", "instanceSize": "nano", "tags": [ { "color": "gray" } ] }}Default Response
object
Example generated
{ "error": "example", "message": "example"}Default Response
object
Example generated
{ "error": "example", "message": "example"}Default Response
object
Example generated
{ "error": "example", "message": "example"}