Preview a rule
curl --request POST \
--url https://api.getlurk.com/v1/rules/{id}/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"days": 30
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({days: 30})
};
fetch('https://api.getlurk.com/v1/rules/{id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/rules/{id}/preview"
payload = { "days": 30 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"trigger": "event",
"schedule": null,
"balance": null,
"rule": "order-points",
"version": 2,
"period": {
"from": "2026-10-08T12:00:00.000Z",
"to": "2026-11-07T12:00:00.000Z"
},
"events": 2,
"users": 1,
"receipts": 2,
"held": 0,
"given": [
{
"unit": "points",
"amount": 169
}
],
"effects": [],
"skipped": [],
"top_users": [
{
"user": "usr_01m2ayvr9gf8e89t8f5cbx71b0",
"given": [
{
"unit": "points",
"amount": 169
}
]
}
],
"truncated": false,
"notes": [
"Every person starts with nothing at the start of the period, so balance conditions only see what this rule gave.",
"Audiences are applied as they are now: nothing keeps a history of who was in one.",
"Limits count from the start of the period; a limit of once ever counts from there too."
]
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Rules
Preview a rule
Replays up to 20,000 recorded events from the past days (1 to 90, default 30) through the real engine and says what the rule would have given. Nothing is given. Send definition to try an unsaved edit. Schedule and balance rules get a forecast, not a replay. An estimate: see notes.
POST
/
v1
/
rules
/
{id}
/
preview
Preview a rule
curl --request POST \
--url https://api.getlurk.com/v1/rules/{id}/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"days": 30
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({days: 30})
};
fetch('https://api.getlurk.com/v1/rules/{id}/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/rules/{id}/preview"
payload = { "days": 30 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"trigger": "event",
"schedule": null,
"balance": null,
"rule": "order-points",
"version": 2,
"period": {
"from": "2026-10-08T12:00:00.000Z",
"to": "2026-11-07T12:00:00.000Z"
},
"events": 2,
"users": 1,
"receipts": 2,
"held": 0,
"given": [
{
"unit": "points",
"amount": 169
}
],
"effects": [],
"skipped": [],
"top_users": [
{
"user": "usr_01m2ayvr9gf8e89t8f5cbx71b0",
"given": [
{
"unit": "points",
"amount": 169
}
]
}
],
"truncated": false,
"notes": [
"Every person starts with nothing at the start of the period, so balance conditions only see what this rule gave.",
"Audiences are applied as they are now: nothing keeps a history of who was in one.",
"Limits count from the start of the period; a limit of once ever counts from there too."
]
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Authorizations
Body
application/json
Response
Preview a rule
Nothing is given. The engine replays recorded events in memory