transformations
GET
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/event-filter Parameters
project_idstringpathrequiredCode samples
cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/event-filter"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"counts": {
"dropped": 0,
"processed": 0,
"would_drop": 0
},
"failing_tests": [
0
],
"mode": "string",
"root": {},
"tests": [
{}
]
}Schema
countsobjectrequiredShow child parameters
droppedintegerrequiredprocessedintegerrequiredwould_dropintegerrequiredMatched while in dry run (would have been dropped live).
failing_testsinteger[]requiredIndexes of saved tests whose expectation does not hold.
modestringrequiredoff | dry_run | liverootobjectrequired{type: and|or, children} / {type: not, child} / {type: condition, field: event|distinct_id, op: equals|contains|starts_with|ends_with|regex, value}testsobject[]required[{event, distinct_id, expect_drop}]404 no filter configured
PUT
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/event-filter Parameters
project_idstringpathrequiredRequest body
application/json
Up to 20 conditions, 5 levels deep, 50 test cases.
modestringrequiredoff | dry_run | live; live needs every test case to pass.rootobjectrequiredtestsobject[]{
"mode": "string",
"root": {},
"tests": [
{}
]
}Code samples
cURL
curl -X PUT "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/event-filter" \
-H "Content-Type: application/json" \
-d '{"mode":"string","root":{},"tests":[{}]}'TypeScript
Python
Go
PHP
Ruby
Java
DELETE
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/event-filter Parameters
project_idstringpathrequiredCode samples
cURL
curl -X DELETE "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/event-filter"TypeScript
Python
Go
PHP
Ruby
Java
Responses
204
403
404
POST
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/event-filter/test Parameters
project_idstringpathrequiredRequest body
application/json
eventsobject[]requiredEvents to try:
[{event, distinct_id}] (at most 100).filterFilterBodyShow child parameters
modestringrequiredoff | dry_run | live; live needs every test case to pass.rootobjectrequiredtestsobject[]{
"events": [
{}
],
"filter": {
"mode": "string",
"root": {},
"tests": [
{}
]
}
}Code samples
cURL
curl -X POST "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/event-filter/test" \
-H "Content-Type: application/json" \
-d '{"events":[{}],"filter":{"mode":"string","root":{},"tests":[{}]}}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"drops": [
true
],
"failing_tests": [
0
]
}Schema
dropsboolean[]requiredPer event, in order: whether the tree matches (the event would be dropped when live).
failing_testsinteger[]required400
404
GET
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/js_rules Parameters
project_idstringpathrequiredCode samples
cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/js_rules"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Page of JsRule in application order (a project has at most 20; one page)
404
POST
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/js_rules Parameters
project_idstringpathrequiredRequest body
application/json
enabledbooleannamestringrequiredpositionintegerApplication order (ascending); defaults to last.
sourcestringrequiredJavaScript defining
transform(event); at most 64 KiB.{
"enabled": true,
"name": "string",
"position": 0,
"source": "string"
}Code samples
cURL
curl -X POST "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/js_rules" \
-H "Content-Type: application/json" \
-d '{"enabled":true,"name":"string","position":0,"source":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
201
Example
{
"created_at": "2024-01-01T00:00:00Z",
"enabled": true,
"id": "string",
"name": "string",
"position": 0,
"quarantine_reason": "string",
"quarantined_until": "2024-01-01T00:00:00Z",
"source": "string",
"updated_at": "2024-01-01T00:00:00Z"
}Schema
created_atstringrequiredenabledbooleanrequiredidstringrequirednamestringrequiredpositionintegerrequiredquarantine_reasonstringquarantined_untilstringSet while the worker has the rule paused after repeated errors; it re-enables at this time.
sourcestringrequiredupdated_atstringrequired400
403
404
GET
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/js_rules/kv Parameters
project_idstringpathrequiredprefixstringqueryOnly keys starting with this.
limitintegerquerycursorstringqueryCode samples
cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/js_rules/kv"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Page of KvRow in key order
400
404
DELETE
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/js_rules/kv Delete one key, a prefix, or (no parameters) every key; admins only, audited.
Parameters
project_idstringpathrequiredkeystringqueryDelete exactly this key.
prefixstringqueryDelete every key starting with this. With neither, the whole store is cleared.
Code samples
cURL
curl -X DELETE "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/js_rules/kv"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"deleted": 0
}Schema
deletedintegerrequired400
403
404
PUT
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/js_rules/kv/quota Set the project's key-value quota; admins only. Writes past it are refused in rule code.
Parameters
project_idstringpathrequiredRequest body
application/json
max_bytesintegerrequired1024 to 67108864.
max_keysintegerrequired1 to 100000.
{
"max_bytes": 0,
"max_keys": 0
}Code samples
cURL
curl -X PUT "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/js_rules/kv/quota" \
-H "Content-Type: application/json" \
-d '{"max_bytes":0,"max_keys":0}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"bytes": 0,
"keys": 0,
"max_bytes": 0,
"max_keys": 0
}Schema
bytesintegerrequiredkeysintegerrequiredmax_bytesintegerrequiredmax_keysintegerrequired400
403
404
GET
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/js_rules/kv/usage Parameters
project_idstringpathrequiredCode samples
cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/js_rules/kv/usage"TypeScript
Python
Go
PHP
Ruby
Java
GET
https://lucida.15-204-158-166.sslip.io /v1/projects/{project_id}/js_rules/metrics Parameters
project_idstringpathrequiredhoursintegerqueryCode samples
cURL
curl -X GET "https://lucida.15-204-158-166.sslip.io/v1/projects/{project_id}/js_rules/metrics"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Page of RuleMetrics (transformation_id is the JS rule id): totals and an hourly series per rule that ran in the window (one page)
404
Updated