Skip to main content
POST
/
v1
/
management
/
connections
Create a connection
curl --request POST \
  --url https://reporter.sandbox.lerian.net/v1/management/connections \
  --header 'Content-Type: application/json' \
  --header 'X-Product-Name: <x-product-name>' \
  --data '
{
  "configName": "production-db",
  "type": "POSTGRESQL",
  "host": "db.example.com",
  "port": 5432,
  "databaseName": "mydatabase",
  "userName": "dbuser",
  "password": "secretpassword",
  "schema": "public",
  "ssl": {
    "mode": "require",
    "ca": "-----BEGIN CERTIFICATE-----\nMIIDdzCCAl+gAwIBAgIEbV...\n-----END CERTIFICATE-----\n"
  },
  "metadata": {
    "environment": "production",
    "team": "data-engineering"
  }
}
'
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "configName": "production-db",
  "productName": "my-product",
  "type": "POSTGRESQL",
  "host": "db.example.com",
  "port": 5432,
  "databaseName": "mydatabase",
  "userName": "dbuser",
  "schema": "public",
  "ssl": {
    "mode": "require"
  },
  "metadata": {
    "environment": "production",
    "team": "data-engineering"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Headers

Authorization
string

The authorization token in the Bearer <token> format.

Important: This header is required if your environment has Access Manager enabled. For more information, refer to the Access Manager documentation.

Example:

"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

X-Product-Name
string
required

The product name to associate with this connection. Must contain only alphanumeric characters, underscores, and hyphens (max 100 characters). The value is normalized to lowercase.

Maximum string length: 100
Pattern: ^[a-zA-Z0-9_-]+$
Example:

"my-product"

Body

application/json

Request body for creating a new database connection.

configName
string
required

Unique identifier name for this connection configuration. Must be between 3 and 100 characters. Must be unique within the organization.

Required string length: 3 - 100
Example:

"production-db"

type
enum<string>
required

Database engine type. Supported values: ORACLE, SQL_SERVER, POSTGRESQL, MONGODB, MYSQL. Note that the data source type field in the List Data Sources endpoint returns lowercase identifiers (postgresql, mongodb).

Available options:
ORACLE,
SQL_SERVER,
POSTGRESQL,
MONGODB,
MYSQL
Example:

"POSTGRESQL"

host
string
required

Hostname or IP address of the database server.

Example:

"db.example.com"

port
integer
required

Network port number for the database connection.

Required range: 1 <= x <= 65535
Example:

5432

databaseName
string
required

Name of the database to connect to on the target server.

Example:

"mydatabase"

userName
string
required

Username credential for database authentication.

Example:

"dbuser"

password
string<password>
required

Password credential for database authentication. This value is encrypted upon storage.

Example:

"secretpassword"

schema
string

Database schema name (for example, public, my_schema). Useful for PostgreSQL databases with custom schemas. If omitted, Reporter defaults to the public schema.

Example:

"public"

ssl
object

SSL configuration object containing certificate and security options.

metadata
object

An object containing key-value pairs for storing additional connection-related information. Keys (max 100 characters) and values (max 2000 characters) must be strings. Nested objects are not allowed.

Example:
{
"environment": "production",
"team": "data-engineering"
}

Response

Indicates that the connection was successfully created.

Response object containing connection details.

id
string<uuid>
required

Unique identifier of the connection (UUID format).

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

configName
string
required

Unique identifier name for this connection configuration.

Example:

"production-db"

type
enum<string>
required

Database engine type. Supported values: ORACLE, SQL_SERVER, POSTGRESQL, MONGODB, MYSQL. Note that the data source type field in the List Data Sources endpoint returns lowercase identifiers (postgresql, mongodb).

Available options:
ORACLE,
SQL_SERVER,
POSTGRESQL,
MONGODB,
MYSQL
Example:

"POSTGRESQL"

host
string
required

Hostname or IP address of the database server.

Example:

"db.example.com"

port
integer
required

Network port number for the database connection.

Example:

5432

databaseName
string
required

Name of the database to connect to on the target server.

Example:

"mydatabase"

userName
string
required

Username credential for database authentication.

Example:

"dbuser"

createdAt
string<date-time>
required

ISO 8601 timestamp indicating when the connection was created.

Example:

"2024-01-15T10:30:00Z"

productName
string

The product name associated with this connection. May be empty if the connection has not been assigned to a product.

Example:

"my-product"

schema
string

Database schema name, when set.

Example:

"public"

ssl
object

SSL configuration object containing certificate and security options.

metadata
object

An object containing key-value pairs for storing additional connection-related information. Keys (max 100 characters) and values (max 2000 characters) must be strings. Nested objects are not allowed.

Example:
{
"environment": "production",
"team": "data-engineering"
}
updatedAt
string<date-time>

ISO 8601 timestamp indicating when the connection was last updated.

Example:

"2024-01-15T10:30:00Z"