Cleaning Rules
Operations related to Cleaning Rules, the configurations that define expiration delays for ingested data, ensuring automatic removal after a specific period to comply with data retention policies and legal requirements. Rules can have KEEP or DELETE actions and apply to profiles or events with optional filters by channel, compartment, or activity type. Expiration timestamps are computed at ingestion time and are non-retroactive.
Relevant documentation:
Get a user activity content filter
Success !
Error response
Error response
Error response
Error response
Error response
Error response
GET /v1/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter HTTP/1.1
Host: api.mediarithmics.local
Accept: */*
{
"status": "ok",
"data": {
"content_type": "EVENT_NAME_FILTER",
"filter": "text"
}
}Create a user activity content filter
Success !
Error response
Error response
Error response
Error response
Error response
Error response
POST /v1/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter HTTP/1.1
Host: api.mediarithmics.local
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"content_type": "EVENT_NAME_FILTER",
"filter": "text"
}{
"status": "ok",
"data": {
"content_type": "EVENT_NAME_FILTER",
"filter": "text"
}
}Update a user activity content filter
Success !
Error response
Error response
Error response
Error response
Error response
Error response
PUT /v1/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter HTTP/1.1
Host: api.mediarithmics.local
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"content_type": "EVENT_NAME_FILTER",
"filter": "text"
}{
"status": "ok",
"data": {
"content_type": "EVENT_NAME_FILTER",
"filter": "text"
}
}Delete a user activity content filter
Success response
Error response
Error response
Error response
Error response
Error response
Error response
DELETE /v1/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter HTTP/1.1
Host: api.mediarithmics.local
Accept: */*
{
"status": "ok"
}Get the history of status updates for a given cleaning rule
Should retrieve the update that led to this status (LIVE or ARCHIVED)
Should retrieve the update that went from this status (DRAFT or LIVE)
Should retrive the update made by this user (named by its id)
Offset from which the search must be performed
Number of maximum items that shall be return by this search
Success !
Error response
Error response
Error response
Error response
Error response
Error response
GET /v1/datamarts/{datamart_id}/cleaning_rules/{id}/status_history HTTP/1.1
Host: api.mediarithmics.local
Accept: */*
{
"count": 1,
"status": "ok",
"max_results": 1,
"total": 1,
"first_result": 1,
"data": [
{
"update_ts": 0,
"update_by": "text",
"new_status": "DRAFT",
"cleaning_rule_id": "text",
"last_status": "DRAFT"
}
]
}Should retrieve only the archived cleaning rules
The Cleaning Rule type
The status of the cleaning rule (DRAFT, LIVE, ARCHIVED)
Offset from which the search must be performed
Number of maximum items that shall be return by this search
Success !
Error response
Error response
Error response
Error response
Error response
Error response
GET /v1/datamarts/{datamart_id}/cleaning_rules HTTP/1.1
Host: api.mediarithmics.local
Accept: */*
{
"first_result": 1,
"total": 1,
"data": [
{
"action": "KEEP",
"activity_type_filter": "ALL",
"status": "DRAFT",
"life_duration": "text",
"archived": false,
"id": "text",
"channel_filter": "text",
"datamart_id": "text"
}
],
"max_results": 1,
"status": "ok",
"count": 1
}Success !
Error response
Error response
Error response
Error response
Error response
Error response
POST /v1/datamarts/{datamart_id}/cleaning_rules HTTP/1.1
Host: api.mediarithmics.local
Content-Type: application/json
Accept: */*
Content-Length: 161
{
"type": "USER_EVENT_CLEANING_RULE",
"action": "KEEP",
"activity_type_filter": "ALL",
"status": "DRAFT",
"life_duration": "text",
"archived": false,
"channel_filter": "text"
}{
"status": "ok",
"data": {
"type": "USER_EVENT_CLEANING_RULE",
"action": "KEEP",
"activity_type_filter": "ALL",
"status": "DRAFT",
"life_duration": "text",
"archived": false,
"id": "text",
"channel_filter": "text",
"datamart_id": "text"
}
}Success !
Error response
Error response
Error response
Error response
Error response
Error response
GET /v1/datamarts/{datamart_id}/cleaning_rules/{id} HTTP/1.1
Host: api.mediarithmics.local
Accept: */*
{
"status": "ok",
"data": {
"type": "USER_EVENT_CLEANING_RULE",
"action": "KEEP",
"activity_type_filter": "ALL",
"status": "DRAFT",
"life_duration": "text",
"archived": false,
"id": "text",
"channel_filter": "text",
"datamart_id": "text"
}
}Success !
Error response
Error response
Error response
Error response
Error response
Error response
PUT /v1/datamarts/{datamart_id}/cleaning_rules/{id} HTTP/1.1
Host: api.mediarithmics.local
Content-Type: application/json
Accept: */*
Content-Length: 161
{
"type": "USER_EVENT_CLEANING_RULE",
"action": "KEEP",
"activity_type_filter": "ALL",
"status": "DRAFT",
"life_duration": "text",
"archived": false,
"channel_filter": "text"
}{
"status": "ok",
"data": {
"type": "USER_EVENT_CLEANING_RULE",
"action": "KEEP",
"activity_type_filter": "ALL",
"status": "DRAFT",
"life_duration": "text",
"archived": false,
"id": "text",
"channel_filter": "text",
"datamart_id": "text"
}
}Success response
Error response
Error response
Error response
Error response
Error response
Error response
DELETE /v1/datamarts/{datamart_id}/cleaning_rules/{id} HTTP/1.1
Host: api.mediarithmics.local
Accept: */*
{
"status": "ok"
}Last updated
Was this helpful?