transformations

Embed
Preview of the card
<a href="https://lucidace.com/docs/ref-transformations"><img src="https://lucidace.com/docs/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/da916cd3-c0fc-4b63-b971-b3c13623daf3/pages/2f7ff431-19a8-403b-b509-5d9a50011a8e/social-card.svg?v=3e7ae33eec8b" alt="transformations" width="600" height="315"></a>
GEThttps://lucidace.com/v1/projects/{project_id}/transformation-libraries/{id}/versions

Parameters

project_idstringpathrequired
idstringpathrequired
limitintegerquery
cursorstringquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/transformation-libraries/{id}/versions"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of LibraryVersion, newest first
Example
{
  "data": [
    {
      "created_at": "2024-01-01T00:00:00Z",
      "created_by": "string",
      "source": "string",
      "version": 0
    }
  ],
  "next_cursor": "string"
}
Schema
dataLibraryVersion[]required
Show child parameters
created_atstringrequired
created_bystring
sourcestringrequired
versionintegerrequired
next_cursorstring
404
GEThttps://lucidace.com/v1/projects/{project_id}/transformations

Parameters

project_idstringpathrequired

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/transformations"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of Transformation in application order (a project has at most 50; one page)
Example
{
  "data": [
    {
      "flags": 0,
      "repo": "string"
    }
  ],
  "next_cursor": "string"
}
Schema
dataStored[]required
Show child parameters
flagsintegerrequired
repostringrequired
next_cursorstring
404
POSThttps://lucidace.com/v1/projects/{project_id}/transformations

Parameters

project_idstringpathrequired

Request body

application/json
conditionsobject[]
Property conditions that must all hold (AND): {property, op, value} with op one of eq, neq, contains, not_contains, gt, gte, lt, lte, regex, is_set, is_not_set.
enabledboolean
eventstring
Legacy single event name; combined (OR) with events. Omit both for every event.
eventsstring[]
Event names the rule applies to (OR).
filterstring
Filter expression that must be true, e.g. properties.plan != 'free' and event in ('a','b').
namestringrequired
positioninteger
Application order (ascending); defaults to last.
ruleobjectrequired
{"kind": "drop_event" | "drop_property" | "rename_property" | "hash_property" | "set_property" | "sample" | "code", ...}. code takes source, optional inputs (constants) and secrets (name -> value, sealed at rest and returned blank; send "" to keep a stored secret).
{
  "conditions": [
    {}
  ],
  "enabled": true,
  "event": "string",
  "events": [
    "string"
  ],
  "filter": "string",
  "name": "string",
  "position": 0,
  "rule": {}
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/transformations" \
  -H "Content-Type: application/json" \
  -d '{"conditions":[{}],"enabled":true,"event":"string","events":["string"],"filter":"string","name":"string","position":0,"rule":{}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201
Example
{
  "created_at": "2024-01-01T00:00:00Z",
  "enabled": true,
  "event_name": "string",
  "id": "string",
  "name": "string",
  "position": 0,
  "quarantine_reason": "string",
  "quarantined_until": "2024-01-01T00:00:00Z",
  "rule": {},
  "scope": {},
  "updated_at": "2024-01-01T00:00:00Z"
}
Schema
created_atstringrequired
enabledbooleanrequired
event_namestring
Event name the rule applies to; null = every event.
idstringrequired
namestringrequired
positionintegerrequired
quarantine_reasonstring
quarantined_untilstring
Set while the worker has the rule paused after repeated errors; it re-enables at this time.
ruleobjectrequired
scopeobjectrequired
{events: [], conditions: [], filter: ""} (event_name is the legacy single-event scope).
updated_atstringrequired
400
403
404
GEThttps://lucidace.com/v1/projects/{project_id}/transformations/metrics

Parameters

project_idstringpathrequired
hoursintegerquery

Code samples

cURL
curl -X GET "https://lucidace.com/v1/projects/{project_id}/transformations/metrics"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Page of RuleMetrics: 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[]required
Show child parameters
seriesMetricHour[]required
Hourly buckets with activity, oldest first.
Show child parameters
droppedintegerrequired
errorsintegerrequired
hourstringrequired
modifiedintegerrequired
processedintegerrequired
transformation_idstringrequired
totalsobjectrequired
Show child parameters
droppedintegerrequired
errorsintegerrequired
modifiedintegerrequired
processedintegerrequired
transformation_idstringrequired
next_cursorstring
404
POSThttps://lucidace.com/v1/projects/{project_id}/transformations/test

Parameters

project_idstringpathrequired

Request body

application/json
eventobject
A supplied event: {event, distinct_id?, uuid?, properties}. Exactly one of event and sample is required.
rulesarray
Rules to try; when omitted the project's saved, enabled rules run.
sampleSampleSpec
Show child parameters
eventstring
Restrict the pick to this event name.
{
  "event": {},
  "rules": [
    {
      "conditions": [
        {}
      ],
      "event": "string",
      "events": [
        "string"
      ],
      "filter": "string",
      "rule": {}
    }
  ],
  "sample": {
    "event": "string"
  }
}

Code samples

cURL
curl -X POST "https://lucidace.com/v1/projects/{project_id}/transformations/test" \
  -H "Content-Type: application/json" \
  -d '{"event":{},"rules":[{"conditions":[{}],"event":"string","events":["string"],"filter":"string","rule":{}}],"sample":{"event":"string"}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200
Example
{
  "dropped": "string",
  "input": {},
  "logs": [
    {
      "id": "string",
      "line": "string"
    }
  ],
  "properties": {},
  "salted": true,
  "sampled_out": true,
  "steps": [
    {
      "dropped": true,
      "error": true,
      "id": "string",
      "matched": true,
      "modified": true
    }
  ],
  "warnings": [
    "string"
  ]
}
Schema
droppedstring
Why the event would not be ingested (drop_event, sample:25), if so.
inputobjectrequired
The event the rules ran on (the picked one when sample was used).
logsRuleLog[]required
log(...) lines of code rules, in order.
Show child parameters
idstring
Saved rule id (absent for rules supplied in the request).
linestringrequired
propertiesobjectrequired
saltedbooleanrequired
Whether a hash salt is available (hash rules remove the value without one).
sampled_outbooleanrequired
stepsRuleStep[]required
Show child parameters
droppedbooleanrequired
errorbooleanrequired
idstring
Saved rule id (absent for rules supplied in the request).
matchedbooleanrequired
modifiedbooleanrequired
warningsstring[]required
400
404 Unknown project, or sample found no event in the last 24 hours
503
DELETEhttps://lucidace.com/v1/projects/{project_id}/transformations/{id}

Parameters

project_idstringpathrequired
idstringpathrequired

Code samples

cURL
curl -X DELETE "https://lucidace.com/v1/projects/{project_id}/transformations/{id}"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

204
403
404
PATCHhttps://lucidace.com/v1/projects/{project_id}/transformations/{id}

Parameters

project_idstringpathrequired
idstringpathrequired

Request body

application/json
clear_quarantineboolean
true lifts an auto-quarantine immediately.
conditionsarray
Replaces the conditions when present.
enabledboolean
eventstring
null clears the event scope (applies to every event).
eventsarray
Replaces the event list when present.
filterstring
Replaces the filter expression; an empty string clears it.
namestring
positioninteger
ruleobject
{
  "clear_quarantine": true,
  "conditions": [
    {}
  ],
  "enabled": true,
  "event": "string",
  "events": [
    "string"
  ],
  "filter": "string",
  "name": "string",
  "position": 0,
  "rule": {}
}

Code samples

cURL
curl -X PATCH "https://lucidace.com/v1/projects/{project_id}/transformations/{id}" \
  -H "Content-Type: application/json" \
  -d '{"clear_quarantine":true,"conditions":[{}],"enabled":true,"event":"string","events":["string"],"filter":"string","name":"string","position":0,"rule":{}}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

400
403
404
Updated