← All documentation · Dashboard · REST API
Create contracts, validate payloads and monitor API data from Python. The SDK uses only the Python standard library and supports Python 3.9+.
git clone https://github.com/ssitdeveloper/zorqelio-monetization.git cd zorqelio-monetization/sdks/python python -m pip install .
Create an account in the dashboard, then copy the one-time workspace API token into an environment variable. Use the workspace API token for long-running server integrations; account session tokens expire after 14 days.
export ZORQELIO_API_TOKEN="your-workspace-api-token"
import os
from zorqelio import ZorqelioClient, ZorqelioError
client = ZorqelioClient(os.environ["ZORQELIO_API_TOKEN"])
contract = client.create_contract(
"Orders API",
{
"type": "object",
"required": ["id", "status"],
"properties": {
"id": {"type": "string"},
"status": {"type": "string"},
},
"additionalProperties": False,
},
)
contract_id = contract["contract"]["contractId"]
result = client.validate(contract_id, {"id": "ord_123", "status": "paid"})
if result["decision"] == "BLOCK":
print(result["issues"])
monitor = client.create_monitor(
contract_id,
"Orders production API",
expected_interval_minutes=15,
endpoint_url="https://api.example.com/orders/health",
)
print(monitor["monitor"])
Scheduled checks accept public HTTPS JSON endpoints. They do not currently support custom authentication headers or redirects. Omit endpoint_url to create a push monitor.
get_workspace() — workspace, usage and resource overview.create_contract(name, schema, description=None) — create a versioned JSON Schema contract.validate(contract_id, payload) — return ALLOW/BLOCK and validation evidence.create_monitor(contract_id, label, expected_interval_minutes=60, endpoint_url=None) — create a push or scheduled monitor.try:
workspace = client.get_workspace()
except ZorqelioError as exc:
print(exc.status_code, exc.code, str(exc))ZorqelioError exposes the HTTP status, machine-readable error code and parsed response details. Network failures are also reported as this exception.