Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dishant0406/quickleap/llms.txt

Use this file to discover all available pages before exploring further.

Update rule

PUT /rules/:ruleId
Updates an existing rule. All fields from the create request are supported, plus priority and status.

Path parameters

ruleId
string
required
The ID of the rule to update

Request body

All fields are optional. Only provided fields will be updated.
name
string
Rule name
description
string
Rule description
type
RuleType
Rule type: force, percentage, or ab_experiment
conditions
RuleCondition[]
Array of conditions. See Create a rule for structure.
conditionLogic
ConditionLogic
Condition combination logic: AND or OR
action
RuleAction
Rule action. See Create a rule for structure.
priority
number
Evaluation priority (lower = higher priority)
status
RuleStatus
Rule status: active, inactive, or draft
startDate
string
ISO 8601 start date
endDate
string
ISO 8601 end date
metadata
Record<string, string | number | boolean>
Custom metadata

Response

rule
Rule
The updated rule object. See List rules for structure.

Examples

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

const response = await updateRule('rule_456', {
  name: 'Updated mobile redirect',
  description: 'Send mobile users to new app URL'
});

console.log(response.data.rule);

Toggle status

PUT /rules/:ruleId/status
Quickly toggle a rule’s status without updating other fields.

Path parameters

ruleId
string
required
The ID of the rule

Request body

status
RuleStatus
required
New status: active, inactive, or draft

Response

rule
Rule
The updated rule object

Examples

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

const response = await toggleRuleStatus('rule_456', {
  status: 'active'
});

console.log(`Rule is now ${response.data.rule.status}`);

Reorder rules

PUT /rules/redirect/:redirectId/reorder
Change rule evaluation order by updating priorities.

Path parameters

redirectId
string
required
The ID of the redirect

Request body

ruleIds
number[]
required
Array of rule IDs in desired order (first = highest priority)

Response

message
string
Success message
rules
Rule[]
Updated rules in new priority order

Example

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

// Move rule 789 to highest priority
const response = await reorderRules('redirect_123', {
  ruleIds: [789, 456, 123]
});

console.log('New order:');
response.data.rules.forEach(rule => {
  console.log(`${rule.priority}: ${rule.name}`);
});

Duplicate rule

POST /rules/:ruleId/duplicate
Create a copy of an existing rule.

Path parameters

ruleId
string
required
The ID of the rule to duplicate

Response

rule
Rule
The newly created rule (copy of original with status draft)

Example

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

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

console.log(`Created duplicate: ${newRule.id}`);
console.log(`Original name: ${newRule.name}`);
console.log(`Status: ${newRule.status}`);
Duplicated rules are created with status draft. Activate them using the toggle status endpoint.

Build docs developers (and LLMs) love