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
| Field | Required | Type | Description |
|---|---|---|---|
| name | Yes | string | Contract name. |
| on_violation | Yes | string | flag marks the response; block returns an error. |
| description | No | string | What this contract enforces. |
| schema_id | No | string | Links the contract to a specific schema. |
| rules | No | object[] | Field-level validation rules. |
| semantic_rules | No | object[] | 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
| Status | Cause |
|---|---|
400 | Missing required field (name or on_violation). Invalid on_violation value. |
401 | Missing or invalid X-Reliant-Key. |
404 | Contract not found or belongs to another account. |