Quickstart
This guide walks through the whole path: create a workspace, connect two data sources, define a reconciliation job, trigger a run, and fetch the results. Pick one tab and follow it straight through — each step builds on the IDs from the one before it.
All examples assume DATARECS_API_KEY is set (for the CLI and REST tabs) and that you’re targeting https://api.datarecs.io (the default).
1. Create a workspace
Section titled “1. Create a workspace”- Log in to the DataRecs Console.
- Click New Workspace from the workspace selector.
- Enter a name and click Create.
datarecs auth login --company your-company-slugdatarecs workspaces create --name "quickstart" --description "Quickstart workspace"auth login is a device-code flow and needs your company (tenant) slug via --company.
resource "datarecs_workspace" "quickstart" { name = "quickstart" description = "Quickstart workspace"}curl -X POST https://api.datarecs.io/workspaces \ -H "Authorization: Bearer $DATARECS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "quickstart", "description": "Quickstart workspace", "metadata": {}}'Note the returned id — every following step needs it as workspace_id.
2. Add two connections
Section titled “2. Add two connections”A reconciliation job compares exactly two sources, so create one connection per source. This example uses Postgres for both; credentials is a flat object whose shape differs by connector type — see Creating a connection for every type.
- Navigate to Connections in the sidebar.
- Click New Connection.
- Select your database type, enter credentials, and click Test & Save.
- Repeat for the second source.
connections create needs a JSON file for database credentials — there’s no --host/--port flag path for SQL sources:
{ "name": "source-a", "type": "postgres", "workspace_id": "<workspace-id>", "credentials": { "host": "db-a.example.com", "port": 5432, "database": "sales", "username": "readonly_user", "password": "..." }}datarecs connections test --file source-a.jsondatarecs connections create --file source-a.json# repeat with source-b.json for the second connectionresource "datarecs_connection" "source_a" { name = "source-a" type = "postgres" workspace_id = datarecs_workspace.quickstart.id credentials = { host = "db-a.example.com" port = "5432" database = "sales" username = "readonly_user" password = var.source_a_password }}# repeat a "source_b" resource for the second connectioncurl -X POST https://api.datarecs.io/connections \ -H "Authorization: Bearer $DATARECS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "source-a", "type": "postgres", "workspace_id": "<workspace-id>", "credentials": { "host": "db-a.example.com", "port": 5432, "database": "sales", "username": "readonly_user", "password": "..." } }'# repeat for source-bNote both ids — you’ll reference them as connection_id in the job below.
3. Define a job
Section titled “3. Define a job”A job needs, at minimum, one dimension, one measure, the two connections (with column mappings), and one stage. This example counts rows per region:
- Navigate to Jobs and click New Job.
- Pick your two connections, map their columns to shared dimension/measure names, and add a stage.
- Save.
{ "name": "quickstart-job", "workspace_id": "<workspace-id>", "dimensions": ["Region"], "measures": [ { "name": "rowcount", "aggregation": "COUNT_STAR" } ], "connections": [ { "connection_id": "<source-a-id>", "source_schema": "public", "source_table": "orders", "column_mapping": { "Region": "region" } }, { "connection_id": "<source-b-id>", "source_schema": "public", "source_table": "orders", "column_mapping": { "Region": "region" } } ], "stages": [ { "dimensions": ["Region"], "tolerances": [ { "measure_name": "rowcount", "type": "ABSOLUTE", "value": 0 } ] } ], "stage_execution_strategy": "DRILL_DOWN_ON_FAILURE"}datarecs jobs create --file job.jsonresource "datarecs_job" "quickstart" { name = "quickstart-job" workspace_id = datarecs_workspace.quickstart.id dimensions = ["Region"]
measures = [ { name = "rowcount", aggregation = "COUNT_STAR" } ]
connections = [ { connection_id = datarecs_connection.source_a.id source_schema = "public" source_table = "orders" column_mapping = { Region = "region" } }, { connection_id = datarecs_connection.source_b.id source_schema = "public" source_table = "orders" column_mapping = { Region = "region" } } ]
stages = [ { dimensions = ["Region"] tolerances = [ { measure_name = "rowcount", type = "ABSOLUTE", value = 0 } ] } ]}curl -X POST https://api.datarecs.io/jobs \ -H "Authorization: Bearer $DATARECS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "quickstart-job", "workspace_id": "<workspace-id>", "dimensions": ["Region"], "measures": [{ "name": "rowcount", "aggregation": "COUNT_STAR" }], "connections": [ { "connection_id": "<source-a-id>", "source_schema": "public", "source_table": "orders", "column_mapping": { "Region": "region" } }, { "connection_id": "<source-b-id>", "source_schema": "public", "source_table": "orders", "column_mapping": { "Region": "region" } } ], "stages": [ { "dimensions": ["Region"], "tolerances": [{ "measure_name": "rowcount", "type": "ABSOLUTE", "value": 0 }] } ], "stage_execution_strategy": "DRILL_DOWN_ON_FAILURE" }'Every field here is explained in full in Configuring a Reconciliation Job.
4. Trigger a run
Section titled “4. Trigger a run”Terraform manages job definitions, not one-off runs — trigger from the Console, CLI, or REST API:
Open the job and click Run now.
datarecs jobs runs trigger <job-id> --workspace-id <workspace-id>Not applicable — trigger from the Console, CLI, or REST API instead. Use datarecs_job_schedule if you want DataRecs to trigger runs on a cron schedule.
curl -X POST https://api.datarecs.io/jobs/<job-id>/runs/trigger \ -H "Authorization: Bearer $DATARECS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"job_id": "<job-id>"}'Note the returned run_id.
5. Fetch the results
Section titled “5. Fetch the results”Open the run from the job’s run history to see the summary and any mismatched rows.
datarecs jobs runs results view <job-id> <run-id> --workspace-id <workspace-id>Not applicable — results are read via the Console, CLI, or REST API.
curl https://api.datarecs.io/jobs/<job-id>/runs/<run-id>/results/summary \ -H "Authorization: Bearer $DATARECS_API_KEY"