---
title: "Register a data source — profile, index, detect joins to all existing sources"
method: POST
path: "/v1/sources/register"
tags: ["Source Registry"]
---

# Register a data source — profile, index, detect joins to all existing sources

`POST /v1/sources/register`

## Request

- Base URL: `https://api.algenta.ai`
- URL: `https://api.algenta.ai/v1/sources/register`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

**One-time registration per data source.**

- Full column scan (handles sparse/late-appearing data)
- Mojo detects A×B≈C formulas within the source
- Mojo detects join keys to every already-registered source
- Result cached in memory (hot) + persisted to disk (survives restarts)

After registration, use `POST /v1/query` with `sources: []` to query all registered sources, or pass `source_ids` to target specific ones.

## Request body

- AppsApiServerRoutersSourcesRegisterRequest
  - `source` DataSource, required: A data source to map. Every format normalizes to list[dict] internally. Inline (no external dependency): `records` — JSON array of objects (fastest) `csv` — raw CSV text `json_str` — raw JSON array/object text (nested JSON is auto-flattened) `url` — HTTP(S) URL; format auto-detected from Content-Type / extension Binary files (base64-encoded for API transport): `excel_b64` — Excel .xlsx file, base64-encoded `parquet_b64`— Parquet file, base64-encoded Connector config (routes through ConnectorRegistry): `connection` — dict with `type` + connector-specific keys: {"type": "sql", "connection_string": "postgresql+asyncpg://...", "query": "SELECT ..."} {"type": "sql", "connection_string": "sqlite+aiosqlite:///db.sqlite", "query": "..."} {"type": "rest_api", "url": "https://...", "data_path": "data.items"} {"type": "s3", "bucket": "my-bucket", "key": "data/sales.parquet"} {"type": "gcs", "bucket": "my-bucket", "blob": "data/orders.csv"} {"type": "azure_blob", "connection_string": "DefaultEndpointsProtocol=...", "container": "data", "blob": "sales.parquet"}
    - `name` string, required: Label for this source (e.g., 'sales', 'orders')
    - `dataset_id` string, nullable: Public dataset ID alias for a registered source.
    - `source_id` string, nullable: Registered source ID; fastest path and avoids re-uploading data.
    - `records` object[], nullable: Inline JSON records
    - `csv` string, nullable: Raw CSV text
    - `json_str` string, nullable: Raw JSON array/object text (nested auto-flattened)
    - `url` string, nullable: HTTP URL — format auto-detected
    - `excel_b64` string, nullable: Excel .xlsx file, base64-encoded
    - `parquet_b64` string, nullable: Parquet file, base64-encoded
    - `connection` object, nullable: Connector config dict — see DataSource docstring for all types
    - `table` string, nullable: Legacy field — use connection instead
  - `description` string, nullable: Optional human description

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/codna/apis/algenta-api.md) · [All operations](https://skmtc.dev/codna/apis/algenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/codna/apis/algenta-api/revisions/35d30f84a5df?raw)
