What a Contract Contains
| Field | Required | Description |
|---|---|---|
name | ✅ | Human-readable label for this contract. Must be unique per account. |
schema.columns | ✅ | Array of column definitions |
schema.columns[].name | ✅ | Column name — case-sensitive |
schema.columns[].type | ✅ | Expected data type — see supported types below |
schema.columns[].required | ✅ | If true, this column must be present in every check. Absence scores +40 severity points. If false, absence scores +20. |
Supported Column Types
DriftGuard enforces a fixed set of column types. Any type outside this list will be rejected with a400 error.
| Type | Description |
|---|---|
string | Text values |
integer | Whole numbers |
number | Floating point / decimal numbers |
boolean | True / false values |
date | Date without time (YYYY-MM-DD) |
timestamp | Date with time |
json | Nested JSON / object values |
Contract Versioning
Every contract has aversion field that starts at 1. It is designed to
increment each time the contract schema is updated — so you always know which
version of a contract a historical check was run against.
The
PUT /api/v1/contracts/{id} update endpoint is not yet available.
To change a contract’s schema today, create a new contract via
POST /api/v1/contracts with the updated
column definitions.One Contract Per Dataset
Use one contract per logical dataset, table, or feed. For example:- One contract per warehouse table (
users,orders,events) - One contract per partner data feed
- One contract per dbt model output
breaking result comes in.
Inferring a Contract from Sample Data
Not sure what columns to define? Use the infer endpoint to generate a contract schema automatically from a sample JSON payload:schema.columns array you can pass
directly into POST /api/v1/contracts.
Creating and Managing Contracts
| Action | Endpoint |
|---|---|
| Create a contract | POST /api/v1/contracts |
| List all contracts | GET /api/v1/contracts |
| Get a single contract | GET /api/v1/contracts/ |
| Infer schema from sample | POST /api/v1/contracts/infer |
Run a Check
Learn how checks compare incoming schemas against contracts.
Severity Levels
Understand how the required vs optional distinction affects your severity score.
