Developer Documentation

Build with Rulyflow

Everything you need to integrate rule evaluation into your applications. From REST APIs to webhooks, deploy decision logic anywhere.

Authentication

All API requests require an API key passed in the Authorization header. You can generate keys from the Rulyflow dashboard under Settings → API Keys.

Authorization Header
curl -X POST https://api.rulyflow.com/v1/evaluate \
  -H "Authorization: Bearer rf_live_abc123..." \
  -H "Content-Type: application/json"

Quick Start

Install the SDK and evaluate your first rule in under a minute.

1

Install the SDK

npm
npm install @rulyflow/sdk
2

Initialize the client

TypeScript
import { Rulyflow } from "@rulyflow/sdk";

const rulyflow = new Rulyflow({
  apiKey: process.env.RULYFLOW_API_KEY,
});
3

Evaluate a rule

TypeScript
const result = await rulyflow.evaluate({
  ruleId: "loan-approval",
  data: {
    creditScore: 720,
    loanAmount: 250_000,
    annualIncome: 85_000,
  },
});

console.log(result.decision); // "approved"
console.log(result.trace);    // [{ node, passed, ... }]

POST /v1/evaluate

Evaluate a rule against a data payload. Returns a structured decision with a full execution trace.

POST/v1/evaluate

Request Body

  • ruleIdstringrequired

    The unique identifier of the rule to evaluate

  • dataobjectrequired

    Key-value payload matching the rule's input schema

  • options.dryRunboolean

    Run without persisting results

  • options.versionstring

    Pin to a specific rule version

Response

  • decisionstringrequired

    "approved" | "denied" | "review"

  • scorenumberrequired

    Confidence or risk score (0–100)

  • tracearrayrequired

    Ordered list of nodes with pass/fail status

  • metadataobjectrequired

    Rule version, evaluation time, etc.

Example Response
{
  "decision": "approved",
  "score": 82,
  "trace": [
    { "node": "credit-check",   "passed": true,  "value": 720 },
    { "node": "dti-ratio",      "passed": true,  "value": 0.24 },
    { "node": "loan-cap",       "passed": true,  "value": 250000 }
  ],
  "metadata": {
    "ruleVersion": "3.1.0",
    "evaluatedAt": "2025-11-14T09:32:01Z",
    "durationMs": 12
  }
}

Webhooks

Register webhook endpoints to receive real-time notifications. Rulyflow signs every payload with HMAC-SHA256 so you can verify authenticity.

Webhook Payload
{
  "event": "evaluation.completed",
  "ruleId": "loan-approval",
  "decision": "approved",
  "evaluationId": "eval_8f3k2...",
  "timestamp": "2025-11-14T09:32:01Z"
}

Signature Verification

Compare the X-Rulyflow-Signature header against the HMAC-SHA256 digest of the raw request body using your webhook secret.

Rate Limits

API rate limits depend on your plan tier. Limits are applied per API key and reset every 60 seconds.

PlanRequests/minBurst
Free6010
Pro600100
EnterpriseUnlimitedCustom