Endpoint
POST /api/v1/pipeline/profile
Parameters
Example
Response
The endpoint returns a JSON object with three sections:Response fields
Suggested data quality rules
ThesuggestedDataQuality section provides a complete, copy-paste-ready dataQuality configuration based on what the AI observed in the data:
aiRule— a single comprehensive plain-English instruction covering all validation checks: format patterns (emails, phone numbers, dates), value ranges, cross-column relationships (e.g., high >= low), and business logic. If no validation rule is appropriate, this field is omitted.
How it works
- You upload a file — no pipeline registration needed
- For large CSV files, the pipeline randomly samples
sampleSizerows (keeping the header) - The sampled content is sent to the AI model with a profiling prompt
- The AI analyzes the data and returns a structured JSON profile
Use cases
- Explore new data — understand the structure, types, and quality of an unfamiliar file before writing a pipeline configuration
- Discover quality issues — find missing values, outliers, format inconsistencies, and suspicious patterns
- Generate rule ideas — the AI suggests aiRule instructions and transformations based on what it observes
- Validate assumptions — confirm that a file matches expected schema and data quality before loading
Sampling
For CSV files larger thansampleSize rows, the profiling endpoint automatically samples a random subset. The header row is always included. For JSON and XML files, the content is truncated if it exceeds the AI model’s context window.
The default sample of 200 rows is typically sufficient to detect patterns, types, and quality issues. Increase sampleSize for more thorough profiling at the cost of slower response times.
When the model declines
An AI provider’s safety classifier can decline to look at a file, most often one that looks like personal data. Profiling then still returns200 with the server’s own statistics only: summary.rowCount, summary.columnCount and summary.columns computed over every row of a CSV file (inferred type, nulls, distinct count, value lengths; sampleValues empty; empty for JSON and XML files), empty qualityIssues and recommendations, no suggestedDataQuality, a top-level "aiDeclined": true and a fixed note: “the model declined this request; statistics only”. The provider’s own text is never included. Read an empty qualityIssues list with aiDeclined as “no AI review”, not as a clean file.
Only response-side declines are recognised. Azure OpenAI’s prompt-side content filter answers with HTTP 400 (
code: content_filter) and is still returned as an error. Nothing else counts as a decline: a missing or wrong provider key, a timeout, a rate limit or any other provider error is still returned as an error, so a misconfiguration is not hidden.
Other AI features (search answers, CodeGen, tap generation, fix suggestions and the rest) have no local fallback: a decline there, including a content_filter finish that used to return the cut-off text, is reported as an error.
Values withheld
When the server setsDATRIS_AI_SAMPLE_VALUES=false, no row value is sent to the model. For a CSV file the model gets per-column statistics computed over every row (inferred type, count, nulls, distinct count, minimum and maximum value length); for JSON, NDJSON and XML (by the .json, .ndjson, .jsonl or .xml extension; for an unrecognised extension, by content that starts with {, [ or <) it gets a value-free skeleton of the document. .csv, .tsv, .psv and .txt files are always profiled as delimited. A header cell that does not look like a plain column name is sent as column_N, and a first line that looks like data (a dash next to a digit, an @, or a long run of digits in any cell) is counted as a row and every column is numbered. A cell with more than two digits or no letter at all also marks line 1 as data. A headerless first row made only of words still passes as names and is sent: single words in any case (John,Smith,Boston,MA; jane,doe,asthma,f; Diabetes,Type,Two), all-caps or lower-case multi-word cells (JOHN SMITH, jane doe), and names the capitalised-words test misses (John A Smith, McDonald Smith, O Brien). header defaults to true: profile a headerless file with header=false so no cell of its first line is sent. sampleValues are empty for every column and the response carries a top-level "valuesWithheld": true. Quality issues and the suggested rule are then based on names, types and statistics only. If the model’s reply cannot be read as JSON (for example a very wide file whose reply is cut off), or the model call fails for any reason (the model declines the request, a provider error, a timeout), the response holds the server’s statistics only: summary.columns (empty for JSON and XML files), empty qualityIssues and recommendations, "valuesWithheld": true and a note giving the cause in the server’s own words; the provider’s error text is never included. A missing or misconfigured provider key or model also produces this note when values are withheld; check it with datris doctor. With values sent (the default), a failed model call still returns an error; only a model decline falls back, as described in When the model declines (with aiDeclined, not valuesWithheld). See Field Protection.
Requirements
ai.enabled: truemust be set inapplication.yaml- A configured AI provider (see AI Configuration)
- Cloud providers (Anthropic, OpenAI, Azure OpenAI, Amazon Bedrock, Grok) recommended for best results
