Skip to main content
POST
/
v1
/
datasources
Register a datasource
curl --request POST \
  --url https://api.abloatai.com/v1/datasources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "connectionString": "<string>",
  "connection": "direct",
  "schema": "<string>",
  "metadata": {}
}
'
{
  "object": "datasource",
  "id": "<string>",
  "livemode": true,
  "metadata": {},
  "created": 123,
  "provider": "postgresql",
  "host": "<string>",
  "database": "<string>",
  "schema": "<string>",
  "display_name": "<string>",
  "endpoint": "<string>",
  "key_last4": "<string>",
  "cursor": "<string>",
  "event_lag": 123,
  "retry_count": 123,
  "last_request_at": 123,
  "last_success_at": 123,
  "last_error": "<string>"
}

Authorizations

Authorization
string
header
required

API key (sk_live_…) or a scoped capability token. The same header carries both — the server discriminates by token shape.

Body

application/json

Register your Postgres by connection string — what Ablo({ databaseUrl }) calls. Sent once over TLS, stored sealed, never returned. The calling key's mode picks the environment (an sk_test_ key registers your sandbox data plane).

connectionString
string
required

postgres:// / postgresql:// URL. Use a non-superuser, non-BYPASSRLS role; public hosts only.

connection
enum<string>
Available options:
direct
schema
string

Postgres schema of the synced tables (default public).

metadata
object

Response

The registered datasource (safe projection — no credential).

A database connection registered for the caller's org. connection discriminates the kind; credentials never appear (no field exists for them).

object
enum<string>
required
Available options:
datasource
id
string
required

Typed id: ds_… (direct, live), ds_test_… (direct, sandbox), dse_… (endpoint).

connection
enum<string>
required
Available options:
direct,
endpoint
status
enum<string>
required
Available options:
unverified,
active,
rejected
livemode
boolean
required
metadata
object
required
created
integer
required

Unix seconds.

provider
enum<string>

Direct kind only.

Available options:
postgresql
host
string

Direct kind only — safe to display.

database
string

Direct kind only.

schema
string

Direct kind only — Postgres schema of the synced tables.

display_name
string

Direct kind only — credential-free summary.

environment
enum<string>

Endpoint kind only.

Available options:
test,
live
endpoint
string

Endpoint kind only — the signed HTTPS endpoint URL.

key_last4
string | null

Endpoint kind only — last 4 chars of the signing key.

cursor
string | null

Endpoint kind only — event-feed cursor.

event_lag
integer

Endpoint kind only.

retry_count
integer

Endpoint kind only.

last_request_at
integer | null

Endpoint kind only — Unix seconds.

last_success_at
integer | null

Endpoint kind only — Unix seconds.

last_error
string | null

Endpoint kind only.