API Reference

Create & Delete Contract

Create new Business Contracts or delete existing ones via API Key.


GET/api/contracts

Lists all contracts scoped to your account, ordered by creation date.

http
GET /api/contracts X-Reliant-Key: rel_your_api_key
json — 200 OK
{ "contracts": [ { "id": "ctr_...", "name": "Price Validation", "on_violation": "block", "rules": [...], "semantic_rules": [...], "created_at": "2026-08-05T03:00:00Z" } ] }

GET/api/contracts/:id

Returns full details of a single contract. Returns 404 if the contract belongs to another account.

http
GET /api/contracts/:id X-Reliant-Key: rel_your_api_key

POST/api/contracts

Creates a new Business Contract scoped to your account.

Authentication

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

Body

FieldRequiredTypeDescription
nameYesstringContract name.
on_violationYesstringflag marks the response; block returns an error.
descriptionNostringWhat this contract enforces.
schema_idNostringLinks the contract to a specific schema.
rulesNoobject[]Field-level validation rules.
semantic_rulesNoobject[]LLM-evaluated semantic rules.

Example

json — body
{ "name": "Price Validation", "on_violation": "block", "description": "Ensures all extracted prices are valid", "rules": [ { "field": "price", "op": "gt", "value": 0, "message": "Price must be positive" }, { "field": "currency", "op": "not_empty", "message": "Currency is required" } ], "semantic_rules": [ { "description": "Price must reflect realistic market values", "weight": "required" } ] }
json — 201 Created
{ "id": "ctr_...", "name": "Price Validation", "on_violation": "block", "rules": [...], "semantic_rules": [...], "created_at": "2026-08-05T03:00:00Z" }

DELETE/api/contracts/:id

Permanently deletes a contract. Scoped to your account — attempting to delete a contract from another account returns 404.

http
DELETE /api/contracts/:id X-Reliant-Key: rel_your_api_key
json — 200 OK
{ "success": true }

Error responses

StatusCause
400Missing required field (name or on_violation). Invalid on_violation value.
401Missing or invalid X-Reliant-Key.
404Contract not found or belongs to another account.