For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

get
/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter
Path parameters
datamart_idinteger · int64Required
rule_idinteger · int64Required
Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
get/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter
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

post
/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter
Path parameters
datamart_idinteger · int64Required
rule_idinteger · int64Required
Body
Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
post/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter
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

put
/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter
Path parameters
datamart_idinteger · int64Required
rule_idinteger · int64Required
Body
Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
put/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter
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

delete
/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter
Path parameters
datamart_idinteger · int64Required
rule_idinteger · int64Required
Responses
200

Success response

application/json
statusstring · enumRequiredPossible values:
delete/datamarts/{datamart_id}/cleaning_rules/{rule_id}/content_filter
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

get
/datamarts/{datamart_id}/cleaning_rules/{id}/status_history
Path parameters
datamart_idinteger · int64Required
idinteger · int64Required
Query parameters
new_statusstring · enumOptional

Should retrieve the update that led to this status (LIVE or ARCHIVED)

Possible values:
last_statusstring · enumOptional

Should retrieve the update that went from this status (DRAFT or LIVE)

Possible values:
update_bystringOptional

Should retrive the update made by this user (named by its id)

first_resultinteger · int32Optional

Offset from which the search must be performed

max_resultsinteger · int32Optional

Number of maximum items that shall be return by this search

Responses
200

Success !

application/json
countintegerRequired
statusstring · enumRequiredPossible values:
max_resultsintegerRequired
totalintegerRequired
first_resultintegerRequired
get/datamarts/{datamart_id}/cleaning_rules/{id}/status_history
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"
    }
  ]
}

Get cleaning rules

get
/datamarts/{datamart_id}/cleaning_rules
Path parameters
datamart_idinteger · int64Required
Query parameters
archivedbooleanOptional

Should retrieve only the archived cleaning rules

typestring · enumOptional

The Cleaning Rule type

Possible values:
statusstring · enumOptional

The status of the cleaning rule (DRAFT, LIVE, ARCHIVED)

Possible values:
first_resultinteger · int32Optional

Offset from which the search must be performed

max_resultsinteger · int32Optional

Number of maximum items that shall be return by this search

Responses
200

Success !

application/json
first_resultintegerRequired
totalintegerRequired
max_resultsintegerRequired
statusstring · enumRequiredPossible values:
countintegerRequired
get/datamarts/{datamart_id}/cleaning_rules
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
}

Create a cleaning rule

post
/datamarts/{datamart_id}/cleaning_rules
Path parameters
datamart_idinteger · int64Required
Body
or
Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
post/datamarts/{datamart_id}/cleaning_rules
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"
  }
}

Get a cleaning rule with the given id

get
/datamarts/{datamart_id}/cleaning_rules/{id}
Path parameters
datamart_idinteger · int64Required
idinteger · int64Required
Query parameters
typestring · enumOptionalPossible values:
Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
get/datamarts/{datamart_id}/cleaning_rules/{id}
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"
  }
}

Update a cleaning rule

put
/datamarts/{datamart_id}/cleaning_rules/{id}
Path parameters
datamart_idinteger · int64Required
idinteger · int64Required
Body
or
Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
put/datamarts/{datamart_id}/cleaning_rules/{id}
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"
  }
}

Delete a cleaning rule

delete
/datamarts/{datamart_id}/cleaning_rules/{id}
Path parameters
datamart_idinteger · int64Required
idinteger · int64Required
Query parameters
typestring · enumOptionalPossible values:
Responses
200

Success response

application/json
statusstring · enumRequiredPossible values:
delete/datamarts/{datamart_id}/cleaning_rules/{id}
DELETE /v1/datamarts/{datamart_id}/cleaning_rules/{id} HTTP/1.1
Host: api.mediarithmics.local
Accept: */*
{
  "status": "ok"
}

Last updated

Was this helpful?