Rules API
Evaluates a data-only rule set against every record and returns the rules that matched, each with its opaque `then` payload. The engine has no code evaluation and a fixed operator set, so rules can never execute arbitrary logic. Deterministic; billed per credit.
What it does
Evaluate a data-only rule set against every record.
When to use it
Reach for Rules when you need to answer: “Which of my rules does this record trigger?” It sits in the Decide stage of the catalog — score records and verify claims.
Endpoint & cost
POST /api/v1/rules
Cost: Per credit. Zaps draw down your shared monthly allowance; requests that fail validation are not charged.
Authentication
Send your key as a bearer token: Authorization: Bearer zap_live_…. See Authentication for key management and the alternate header.
Example request
curl https://zapinner.com/api/v1/rules \
-H "Authorization: Bearer zap_live_••••••" \
-H "Content-Type: application/json" \
-d '{"data":{"amount":"1500","region":"US"},"rules":[{"name":"high_value","when":[{"field":"amount","op":"gt","value":1000}],"then":{"tier":"priority"}}]}'request_id. Full field-level request and response schemas for this endpoint live in the OpenAPI spec and the API reference.Errors & limits
Errors use one consistent shape ( error.code, error.message, request_id). See Errors and Rate limits.
SDK
Rules has typed methods in both the JavaScript and Python SDKs. Both are implemented and package-ready but not yet published to npm / PyPI — until they ship, vendor the package source or install from a git ref, or call the endpoint over HTTPS with the example above.
Try it
Select Rules in the playground to see the request, or run it live with your API key.
Related APIs
- Score — Produce a structured priority score with a transparent factor breakdown.
- Verification — Check whether a claim is actually supported by the evidence you supply.
- Route — Assign each record a destination by first-match-wins rules.
