Skip to main content
POST
/
api
/
v1
/
sources
/
add
/
postgres
curl --request POST \
  --url https://api.camelai.com/api/v1/sources/add/postgres/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "postgres",
  "hostname": "localhost",
  "port": 5432,
  "username": "postgres",
  "password": "password",
  "database_name": "mydb",
  "selected_schemas": [
    "public",
    "analytics"
  ]
}
'
{
  "id": 123
}

Authorizations

Authorization
string
header
required

API key authentication using Bearer scheme

Body

application/json

Serializer for PostgreSQL connection configuration.

type
string
required

Connection type identifier. Must be POSTGRES

Minimum string length: 1
account_name
string
default:PostgreSQL

Display name for the connection

Minimum string length: 1
hostname
string

PostgreSQL server hostname

Required string length: 1 - 255
port
integer
default:5432

Port number

username
string

Database username

Required string length: 1 - 255
password
string

Database password

Minimum string length: 1
database_name
string

Database name

Required string length: 1 - 255
connection_string
string

Alternative: full connection string instead of individual parameters

Minimum string length: 1
selected_schemas
string[]

List of schema names to include in queries and overviews. If empty, all schemas except system schemas will be included.

Required string length: 1 - 255

Response

id
integer

The ID of the created connection