transformations
GET
https://lucidace.com /v1/projects/{project_id}/js_rules/metrics Scope settings:readParameters
project_idstringpathrequiredhoursintegerqueryCode samples
cURL
curl -X GET "https://lucidace.com/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)
Example
{
"data": [
{
"series": [
{
"dropped": 0,
"errors": 0,
"hour": "2024-01-01T00:00:00Z",
"modified": 0,
"processed": 0,
"transformation_id": "string"
}
],
"totals": {
"dropped": 0,
"errors": 0,
"modified": 0,
"processed": 0
},
"transformation_id": "string"
}
],
"next_cursor": "string"
}Schema
dataRuleMetrics[]requiredShow child parameters
seriesMetricHour[]requiredHourly buckets with activity, oldest first.
Show child parameters
droppedintegerrequirederrorsintegerrequiredhourstringrequiredmodifiedintegerrequiredprocessedintegerrequiredtransformation_idstringrequiredtotalsobjectrequiredShow child parameters
droppedintegerrequirederrorsintegerrequiredmodifiedintegerrequiredprocessedintegerrequiredtransformation_idstringrequirednext_cursorstring404
POST
https://lucidace.com /v1/projects/{project_id}/js_rules/test Scope settings:readParameters
project_idstringpathrequiredRequest body
application/json
eventobjectrequiredThe event to run:
{event, distinct_id, properties, ...}.sourcestringA draft rule to try; omit to run the project's saved enabled rules in order.
{
"event": {},
"source": "string"
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/js_rules/test" \
-H "Content-Type: application/json" \
-d '{"event":{},"source":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"dropped": true,
"errors": [
"string"
],
"event": {},
"kv_ops": [
{}
],
"logs": [
"string"
]
}Schema
droppedbooleanrequirederrorsstring[]requiredPer-rule failures (the rule was skipped for this event).
eventobjectThe event after the rules;
null when a rule dropped it.kv_opsobject[]requiredKey-value writes the rules made (N-ANA-19); a test run never applies them.
logsstring[]requiredconsole.log lines.400
404
503 The lc-codebox sandbox is not installed or failed
DELETE
https://lucidace.com /v1/projects/{project_id}/js_rules/{id} Scope settings:writeParameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/js_rules/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
204
403
404
PATCH
https://lucidace.com /v1/projects/{project_id}/js_rules/{id} Scope settings:writeParameters
project_idstringpathrequiredidstringpathrequiredRequest body
application/json
clear_quarantinebooleantrue lifts an auto-quarantine immediately.enabledbooleannamestringpositionintegersourcestring{
"clear_quarantine": true,
"enabled": true,
"name": "string",
"position": 0,
"source": "string"
}Code samples
cURL
curl -X PATCH "https://lucidace.com/v1/projects/{project_id}/js_rules/{id}" \
-H "Content-Type: application/json" \
-d '{"clear_quarantine":true,"enabled":true,"name":"string","position":0,"source":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
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://lucidace.com /v1/projects/{project_id}/transformation-libraries Parameters
project_idstringpathrequiredlimitintegerquerycursorstringqueryCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/transformation-libraries"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Page of Library by name
Example
{
"data": [
{
"created_at": "2024-01-01T00:00:00Z",
"description": "string",
"id": "string",
"latest_version": 0,
"name": "string",
"source": "string",
"updated_at": "2024-01-01T00:00:00Z"
}
],
"next_cursor": "string"
}Schema
dataLibrary[]requiredShow child parameters
created_atstringrequireddescriptionstringrequiredidstringrequiredlatest_versionintegerrequirednamestringrequiredsourcestringrequiredupdated_atstringrequirednext_cursorstring404
POST
https://lucidace.com /v1/projects/{project_id}/transformation-libraries Parameters
project_idstringpathrequiredRequest body
application/json
descriptionstringnamestringrequired[a-z][a-z0-9_]{0,62}; rules call <name>.<proc>.sourcestringrequireddef <proc> { statements } blocks (the code rule language, without inputs or secrets).{
"description": "string",
"name": "string",
"source": "string"
}Code samples
cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/transformation-libraries" \
-H "Content-Type: application/json" \
-d '{"description":"string","name":"string","source":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
201
Example
{
"created_at": "2024-01-01T00:00:00Z",
"description": "string",
"id": "string",
"latest_version": 0,
"name": "string",
"source": "string",
"updated_at": "2024-01-01T00:00:00Z"
}Schema
created_atstringrequireddescriptionstringrequiredidstringrequiredlatest_versionintegerrequirednamestringrequiredsourcestringrequiredupdated_atstringrequired400
403
404
409
GET
https://lucidace.com /v1/projects/{project_id}/transformation-libraries/{id} Parameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/transformation-libraries/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200
Example
{
"created_at": "2024-01-01T00:00:00Z",
"description": "string",
"id": "string",
"latest_version": 0,
"name": "string",
"source": "string",
"updated_at": "2024-01-01T00:00:00Z",
"used_by": [
{
"id": "string",
"name": "string"
}
]
}Schema
created_atstringrequireddescriptionstringrequiredidstringrequiredlatest_versionintegerrequirednamestringrequiredsourcestringrequiredupdated_atstringrequiredused_byDependent[]requiredShow child parameters
idstringrequirednamestringrequired404
DELETE
https://lucidace.com /v1/projects/{project_id}/transformation-libraries/{id} Parameters
project_idstringpathrequiredidstringpathrequiredCode samples
cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/transformation-libraries/{id}"TypeScript
Python
Go
PHP
Ruby
Java
Responses
204
403
404
409 transformations still import the library
PATCH
https://lucidace.com /v1/projects/{project_id}/transformation-libraries/{id} Parameters
project_idstringpathrequiredidstringpathrequiredRequest body
application/json
descriptionstringsourcestringA changed source is saved as the next version.
{
"description": "string",
"source": "string"
}Code samples
cURL
curl -X PATCH "https://lucidace.com/v1/projects/{project_id}/transformation-libraries/{id}" \
-H "Content-Type: application/json" \
-d '{"description":"string","source":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Updated