Rules API

The Rules API supports the operational lifecycle for fraud controls: listing rules, creating or updating rule definitions, pausing or activating rules, and inspecting rule metadata.

Rules are evaluated by MADIE when active. Inactive rules can be tested through the Rule Testing API without affecting live decisions.

Common Operations

GET/v1/rules/{orgId}

List rules for an organization, with pagination, search, filtering, and sorting.

POST/v1/rules/{orgId}

Create a new rule definition.

GET/v1/rules/{orgId}/{ruleId}

Fetch one rule and its metadata.

PUT/v1/rules/{orgId}/{ruleId}

Update a rule definition or metadata.

PATCH/v1/rules/{orgId}/{ruleId}/status

Activate, pause, or deactivate a rule when the caller has permission.

DELETE/v1/rules/{orgId}/{ruleId}

Delete or archive a rule, depending on deployment policy.

Listing, Search, and Pagination

The list endpoint supports server-side pagination, search, filtering, and sorting, so clients render large rule catalogs without fetching everything.

bash
curl "https://api.runloci.com/v1/rules/your_loci_org_id?limit=50&search=velocity&status=active&sortBy=name&sortOrder=asc" \
  -H "Authorization: Bearer your_token"

Query parameters:

Parameter Description
limit Page size
cursor Opaque cursor from the previous page's pageInfo.nextCursor
search Case-insensitive match against rule name and description
status Filter by active or paused
sortBy Field to sort by, applied server-side before pagination
sortOrder asc or desc
bustCache Set true to bypass the server cache and read fresh (also honored via a Cache-Control: no-cache header)

Response shape:

json
{
  "status": "success",
  "data": [ ],
  "pageInfo": {
    "nextCursor": "50",
    "morePages": true,
    "count": 50,
    "total": 214
  }
}

pageInfo.total is the total after search and status filters, so a paginated UI can show "50 of 214 matching rules" without a second request.

Governance Notes

Production deployments should use a governed lifecycle: draft, review, inactive test, approval, activation, monitoring, and revision.

See Rules And FLM.