Skip to main content
POST
/
v1
/
management
/
connections
/
{id}
/
assign
Assign a connection to a product
curl --request POST \
  --url https://reporter.sandbox.lerian.net/v1/management/connections/{id}/assign \
  --header 'X-Product-Name: <x-product-name>'
import requests

url = "https://reporter.sandbox.lerian.net/v1/management/connections/{id}/assign"

headers = {"X-Product-Name": "<x-product-name>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {'X-Product-Name': '<x-product-name>'}};

fetch('https://reporter.sandbox.lerian.net/v1/management/connections/{id}/assign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://reporter.sandbox.lerian.net/v1/management/connections/{id}/assign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Product-Name: <x-product-name>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://reporter.sandbox.lerian.net/v1/management/connections/{id}/assign"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("X-Product-Name", "<x-product-name>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://reporter.sandbox.lerian.net/v1/management/connections/{id}/assign")
.header("X-Product-Name", "<x-product-name>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://reporter.sandbox.lerian.net/v1/management/connections/{id}/assign")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Product-Name"] = '<x-product-name>'

response = http.request(request)
puts response.read_body
{
  "id": "019996b8-f3d1-7d2b-a192-6e91464d82fc",
  "configName": "legacy-transactional-db",
  "productName": "my-product",
  "type": "POSTGRESQL",
  "host": "postgres.cliente.com.br",
  "port": 5432,
  "databaseName": "transaction",
  "userName": "user_legacy_read",
  "schema": "public",
  "ssl": {
    "mode": "require"
  },
  "metadata": {},
  "createdAt": "2025-09-25T10:30:00Z",
  "updatedAt": "2025-09-25T10:35: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 assign to 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"

Path Parameters

id
string<uuid>
required

Unique identifier of the connection (UUID format).

Example:

"019996b8-f3d1-7d2b-a192-6e91464d82fc"

Response

The connection after it was assigned to the product.

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 returned in connection responses. Only the SSL mode is exposed; certificate material (ca, cert, key) is never returned.

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"