API Reference

Update Contract

Update a Business Contract via API Key — modify rules, semantic validations, or violation behavior programmatically.


PATCH/api/contracts/:id

Partially updates a contract. Only the fields you send are changed. Scoped to the account that owns the API key — attempting to update a contract from another account returns 404.

Authentication

http
PATCH /api/contracts/:id X-Reliant-Key: rel_your_api_key Content-Type: application/json

Allowed fields

FieldTypeDescription
namestringContract name.
descriptionstringWhat this contract enforces.
on_violationstringflag marks the response; block returns an error.
rulesobject[]Field-level validation rules (replaces the full array).
semantic_rulesobject[]LLM-evaluated semantic rules (replaces the full array).

Rule object

Each item in rules follows this shape:

json
{ "field": "price", "op": "gt", "value": 0, "message": "Price must be positive" }

Available operators: not_null, not_empty, eq, neq, gt, gte, lt, lte, in, not_in, matches.

Semantic rule object

json
{ "description": "Price must be a realistic market value", "weight": "required" }

Weight values: required, important, preferred.


Example

json — body
{ "on_violation": "block", "rules": [ { "field": "email", "op": "not_empty", "message": "Email is required" }, { "field": "score", "op": "gte", "value": 0, "message": "Score must be >= 0" } ] }
json — 200 OK
{ "id": "ctr_...", "name": "Lead Validation", "on_violation": "block", "rules": [...], "semantic_rules": [...], "updated_at": "2026-08-05T03:00:00Z" }

Error responses

StatusCause
400No recognized field was sent in the body.
401Missing or invalid X-Reliant-Key.
404Contract not found or belongs to another account.