Skip to main content

Endpoint

GET /rules/redirect/:redirectId
Retrieves all rules associated with a specific redirect, ordered by priority (ascending).

Path parameters

redirectId
string
required
The ID of the redirect

Response

rules
Rule[]
Array of rule objects sorted by priority

Examples

import { getRulesForRedirect } from '@quickleap/sdk';

const response = await getRulesForRedirect('redirect_123');
const rules = response.data.rules;

console.log(`Found ${rules.length} rules`);
rules.forEach(rule => {
  console.log(`${rule.priority}: ${rule.name} (${rule.status})`);
});

Get rule by ID

To retrieve a single rule by its ID:
GET /rules/:ruleId

Path parameters

ruleId
string
required
The ID of the rule

Response

rule
Rule
The rule object (same structure as above)

Example

import { getRuleById } from '@quickleap/sdk';

const response = await getRuleById('rule_456');
const rule = response.data.rule;

console.log(`Rule: ${rule.name}`);
console.log(`Status: ${rule.status}`);
console.log(`Priority: ${rule.priority}`);
console.log(`Hit count: ${rule.hitCount}`);
Rules are always returned sorted by priority in ascending order. The first rule in the array has the highest priority and will be evaluated first.