The prototype exposes integration contracts through CLI commands rather than a hosted API service.
Command:
datalex import sql <schema.sql> --out imported.model.yamlContract:
- Input: SQL DDL with
CREATE TABLEstatements. - Output: YAML model conforming to
schemas/model.schema.json. - Relationship mapping: FK -> one-to-many relationship.
Command:
datalex import dbml <schema.dbml> --out imported.model.yamlContract:
- Input: DBML table/ref declarations.
- Output: YAML model conforming to
schemas/model.schema.json.
datalex generate sql model.yaml --dialect postgres --out model.sqlOutput:
- SQL create table statements
- FK constraints derived from relationships
datalex generate dbt model.yaml --out-dir ./dbtOutput files:
dbt_project.ymlmodels/staging/*.sqlmodels/staging/schema.ymlmodels/sources.yml
datalex generate metadata model.yaml --out metadata.jsonOutput:
- canonical model metadata JSON for external system ingestion.
datalex migrate old.model.yaml new.model.yaml --dialect snowflake --out migration.sqlOutput:
- ordered migration SQL (CREATE/DROP/ALTER/INDEX)
- header with model version transition and dialect
# Optional direct apply command (typically CI/CD-only)
datalex apply snowflake --sql-file migration.sql --dry-runOutput:
- execution summary (statement count, migration name, checksum)
- optional migration ledger entry in
datalex_migrations - in product mode, apply is expected through Git-hosted CI/CD pipelines
POST /api/forward/generate-sql
- body:
{ model_path, dialect, out? }
POST /api/forward/migrate
- body:
{ old_model, new_model, dialect, out? }
POST /api/forward/apply
- disabled by default in product GitOps mode
- enable only with env:
DM_ENABLE_DIRECT_APPLY=true - when enabled, body supports exactly one input mode:
{ connector, dialect?, sql_file, ...connectionParams }{ connector, dialect?, sql, ...connectionParams }{ connector, dialect?, old_model, new_model, model_schema?, ...connectionParams }
- options:
dry_run,skip_ledger,ledger_table,migration_name,allow_destructive - policy preflight:
policy_pack,skip_policy_check(model-diff mode) - observability/artifacts:
output_json,report_json,write_sql
POST /api/git/branch/create- body:
{ projectId, branch, from? } - creates branch or checks out existing branch
- body:
POST /api/git/push- body:
{ projectId, branch?, remote?, set_upstream? } - pushes branch to remote (defaults to
origin)
- body:
POST /api/git/pull- body:
{ projectId, remote?, branch?, ff_only? } - pulls latest changes (defaults to fast-forward only)
- body:
POST /api/git/github/pr- body:
{ projectId, token, title, body?, base?, head?, draft? } - opens a GitHub pull request using the project remote
- body:
These endpoints power the OSS workflow:
Connect dbt repo -> AI Setup -> Readiness -> Generate -> Review -> Contracts -> Publish
-
GET /api/ai/settings- query:
projectId - returns redacted OpenAI, Claude, and Ollama provider settings plus env var status
- never returns raw API keys
- query:
-
POST /api/ai/settings- body:
{ projectId, provider, model?, baseUrl?, apiKey? } - stores project-private runtime settings under
<project>/.datalex/agent/provider-settings.json - never writes AI provider secrets under versioned
DataLex/
- body:
-
POST /api/ai/settings/test- body:
{ projectId, provider, model?, baseUrl?, apiKey? } - saves the provider input, calls the provider, and marks it
passedorfailed - generation requires a passed provider test
- body:
-
POST /api/ai/context/build- body:
{ projectId } - rebuilds the local AI context index from dbt manifest/YAML, semantic metrics, tests, exposures, descriptions, and DataLex artifacts
- body:
-
GET /api/ai/context/status- query:
projectId - returns whether the local AI context index exists and how many records it contains
- query:
-
POST /api/enterprise/scan- body:
{ projectId?, dbtProjectPath? } - scans dbt manifest/YAML, semantic models, metrics, exposures, tests, owners, DataLex artifacts, AI readiness, and optional DQL references
- returns domain readiness, proposal priorities, contract status, and optional DQL readiness inputs
- body:
-
GET /api/enterprise/readiness- query:
projectIdordbtProjectPath - returns the cached readiness model used by the Readiness and Domains views
- query:
-
POST /api/enterprise/generate- body:
{ projectId?, domain?, packType?, scopeSize?, scope? } - requires a saved and test-passed AI provider
- returns
409withAI_PROVIDER_REQUIREDwhen AI is missing or untested - writes a small AI-generated
kind: proposaldraft under the canonicalDataLex/<domain>/proposals/path - includes evidence, confidence, assumptions, open questions, and exact proposed files
- body:
-
POST /api/proposals/validate- proposal mode body:
{ projectId, proposalPath } - validates proposal shape and required review evidence before apply/certify
- change-array mode remains available for low-level AI file patches
- proposal mode body:
-
POST /api/proposals/apply- proposal mode body:
{ projectId, proposalPath, status? } - updates proposal lifecycle state for
draft,reviewed, orrejected - use
/api/proposals/certifyfor certification because that may write approved artifacts - change-array mode remains available for low-level AI file patches
- proposal mode body:
-
POST /api/proposals/certify- body:
{ projectId, proposalPath } - creates certified artifacts from approved proposals: contracts, diagrams, glossary, metric contracts, and generated dbt suggestions as appropriate for the proposal type
- body:
-
POST /api/datalex/manifest/build- body:
{ projectId, out?, outputJson? } - builds
datalex-manifest.json; only certified contracts and metric contracts are exported
- body:
-
POST /api/dql/readiness- body:
{ projectId, datalexManifest?, dqlPath? } - optional OSS integration endpoint; Publish calls it only when DQL integration is explicitly enabled in
datalex.yaml - checks whether certified DQL blocks resolve their
datalex_contractreferences - when a DQL folder and CLI are available, also runs
dql compile <dqlPath> --datalex-manifest <manifest> - returns
compile.statusaspassed,failed,skipped, ornot_configured
- body:
datalex validate model.yamlExit codes:
0: pass1: validation errors
datalex policy-check model.yaml --policy policies/default.policy.yamlExit codes:
0: no error-severity policy violations1: policy errors or invalid model/policy pack
datalex gate old.yaml new.yamlExit codes:
0: pass1: validation failure2: breaking changes (without override)