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

Computed Fields

Operations related to Computed Fields, the plugins that manage dynamic fields within the Datamart schema, automatically calculating values based on complex logic (e.g., Lifetime Value computed from transaction data).

Get a computed field

get
/computed_fields/{computed_field_id}
Path parameters
computed_field_idstringRequired
Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
get/computed_fields/{computed_field_id}
GET /v1/computed_fields/{computed_field_id} HTTP/1.1
Host: api.mediarithmics.local
Accept: */*
{
  "status": "ok",
  "data": {
    "created_by": "text",
    "version_id": "text",
    "version_value": "text",
    "artifact_id": "text",
    "id": "text",
    "plugin_id": "text",
    "archived": false,
    "name": "text",
    "description": "text",
    "technical_name": "text",
    "organisation_id": "text",
    "cache_max_duration": 0,
    "filter_graphql_query": "text",
    "datamart_id": "text",
    "last_periodic_evaluation_ts": 0,
    "created_ts": 0,
    "group_id": "text",
    "status": "INITIAL"
  }
}

Update a computed field

put
/computed_fields/{computed_field_id}
Path parameters
computed_field_idstringRequired
Body
created_bystringRead-onlyRequired
version_idstringRequired
version_valuestringRead-onlyRequired
artifact_idstringRead-onlyRequired
idstringRead-onlyRequired
plugin_idstringRead-onlyRequired
archivedbooleanRequiredDefault: false
namestringRequired
descriptionstringOptional
technical_namestringRequired
organisation_idstringRequired
cache_max_durationinteger · int64RequiredDefault: 0
filter_graphql_querystringRequired
datamart_idstringRequired
last_periodic_evaluation_tsinteger · int64OptionalDefault: 0
created_tsinteger · int64Read-onlyRequiredDefault: 0
group_idstringRead-onlyRequired
statusstring · enumRequiredPossible values:
Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
put/computed_fields/{computed_field_id}
PUT /v1/computed_fields/{computed_field_id} HTTP/1.1
Host: api.mediarithmics.local
Content-Type: application/json
Accept: */*
Content-Length: 247

{
  "version_id": "text",
  "archived": false,
  "name": "text",
  "description": "text",
  "technical_name": "text",
  "organisation_id": "text",
  "cache_max_duration": 0,
  "filter_graphql_query": "text",
  "datamart_id": "text",
  "last_periodic_evaluation_ts": 0,
  "status": "INITIAL"
}
{
  "status": "ok",
  "data": {
    "created_by": "text",
    "version_id": "text",
    "version_value": "text",
    "artifact_id": "text",
    "id": "text",
    "plugin_id": "text",
    "archived": false,
    "name": "text",
    "description": "text",
    "technical_name": "text",
    "organisation_id": "text",
    "cache_max_duration": 0,
    "filter_graphql_query": "text",
    "datamart_id": "text",
    "last_periodic_evaluation_ts": 0,
    "created_ts": 0,
    "group_id": "text",
    "status": "INITIAL"
  }
}

Delete a computed field

delete
/computed_fields/{computed_field_id}
Path parameters
computed_field_idstringRequired
Responses
200

Success response

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

Search for computed fields

get
/computed_fields
Query parameters
organisation_idstringOptional

Id of the organisation owning the computed fields

datamart_idstringOptional

Id of the datamart owning the computed fields

plugin_version_idstringOptional

ID of the plugin version

namestringOptional

Name

archivedbooleanOptional
first_resultinteger · int32Optional

Offset from which the search will be performed

max_resultsinteger · int32Optional

Maximum number of results

Responses
200

Success !

application/json
countintegerRequired
max_resultsintegerRequired
first_resultintegerRequired
totalintegerRequired
statusstring · enumRequiredPossible values:
get/computed_fields
GET /v1/computed_fields HTTP/1.1
Host: api.mediarithmics.local
Accept: */*
{
  "count": 1,
  "max_results": 1,
  "first_result": 1,
  "total": 1,
  "data": [
    {
      "created_by": "text",
      "version_id": "text",
      "version_value": "text",
      "artifact_id": "text",
      "id": "text",
      "plugin_id": "text",
      "archived": false,
      "name": "text",
      "description": "text",
      "technical_name": "text",
      "organisation_id": "text",
      "cache_max_duration": 0,
      "filter_graphql_query": "text",
      "datamart_id": "text",
      "last_periodic_evaluation_ts": 0,
      "created_ts": 0,
      "group_id": "text",
      "status": "INITIAL"
    }
  ],
  "status": "ok"
}

Create a computed field

post
/computed_fields
Body
created_bystringRead-onlyRequired
version_idstringRequired
version_valuestringRead-onlyRequired
artifact_idstringRead-onlyRequired
idstringRead-onlyRequired
plugin_idstringRead-onlyRequired
archivedbooleanRequiredDefault: false
namestringRequired
descriptionstringOptional
technical_namestringRequired
organisation_idstringRequired
cache_max_durationinteger · int64RequiredDefault: 0
filter_graphql_querystringRequired
datamart_idstringRequired
last_periodic_evaluation_tsinteger · int64OptionalDefault: 0
created_tsinteger · int64Read-onlyRequiredDefault: 0
group_idstringRead-onlyRequired
statusstring · enumRequiredPossible values:
Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
post/computed_fields
POST /v1/computed_fields HTTP/1.1
Host: api.mediarithmics.local
Content-Type: application/json
Accept: */*
Content-Length: 247

{
  "version_id": "text",
  "archived": false,
  "name": "text",
  "description": "text",
  "technical_name": "text",
  "organisation_id": "text",
  "cache_max_duration": 0,
  "filter_graphql_query": "text",
  "datamart_id": "text",
  "last_periodic_evaluation_ts": 0,
  "status": "INITIAL"
}
{
  "status": "ok",
  "data": {
    "created_by": "text",
    "version_id": "text",
    "version_value": "text",
    "artifact_id": "text",
    "id": "text",
    "plugin_id": "text",
    "archived": false,
    "name": "text",
    "description": "text",
    "technical_name": "text",
    "organisation_id": "text",
    "cache_max_duration": 0,
    "filter_graphql_query": "text",
    "datamart_id": "text",
    "last_periodic_evaluation_ts": 0,
    "created_ts": 0,
    "group_id": "text",
    "status": "INITIAL"
  }
}

Test build result for a given state

post
/datamarts/{datamart_id}/user_points/{user_point_id}/computed_fields/{computed_field_id}/tests/build_result
Path parameters
datamart_idstringRequired
user_point_idstring · uuidRequired
computed_field_idstringRequired
Body
stateobject · JsonNodeOptional

raw json

Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
post/datamarts/{datamart_id}/user_points/{user_point_id}/computed_fields/{computed_field_id}/tests/build_result
POST /v1/datamarts/{datamart_id}/user_points/{user_point_id}/computed_fields/{computed_field_id}/tests/build_result HTTP/1.1
Host: api.mediarithmics.local
Content-Type: application/json
Accept: */*
Content-Length: 12

{
  "state": {}
}
{
  "status": "ok",
  "data": {
    "state": {},
    "result": {},
    "user_point_id": "123e4567-e89b-12d3-a456-426614174000",
    "execution_time": 0,
    "message": "text",
    "status": "text"
  }
}

Call on_update route of the given computed field plugin with the related body

post
/datamarts/{datamart_id}/user_points/{user_point_id}/computed_fields/{computed_field_id}/tests/on_update
Path parameters
datamart_idstringRequired
user_point_idstring · uuidRequired
computed_field_idstringRequired
Body
stateobject · JsonNodeOptional

raw json

Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
post/datamarts/{datamart_id}/user_points/{user_point_id}/computed_fields/{computed_field_id}/tests/on_update
POST /v1/datamarts/{datamart_id}/user_points/{user_point_id}/computed_fields/{computed_field_id}/tests/on_update HTTP/1.1
Host: api.mediarithmics.local
Content-Type: application/json
Accept: */*
Content-Length: 82

{
  "update": {
    "data_type": "USER_ACTIVITY",
    "operation": "UPSERT",
    "data": {}
  },
  "state": {}
}
{
  "status": "ok",
  "data": {
    "previous_state": {},
    "event": {},
    "user_point_id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "text",
    "next_state": {},
    "message": "text",
    "execution_time": 0
  }
}

Apply a given action on a computed field

post
/computed_fields/{computed_field_id}/actions
Path parameters
computed_field_idstringRequired
Body
object · PauseComputedFieldActionOptional
orand
object · UnpauseComputedFieldActionOptional
orand
object · ArchiveComputedFieldActionOptional
Responses
200

Success !

application/json
statusstring · enumRequiredPossible values:
post/computed_fields/{computed_field_id}/actions
POST /v1/computed_fields/{computed_field_id}/actions HTTP/1.1
Host: api.mediarithmics.local
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "type": "PAUSE"
}
{
  "status": "ok",
  "data": {
    "created_by": "text",
    "version_id": "text",
    "version_value": "text",
    "artifact_id": "text",
    "id": "text",
    "plugin_id": "text",
    "archived": false,
    "name": "text",
    "description": "text",
    "technical_name": "text",
    "organisation_id": "text",
    "cache_max_duration": 0,
    "filter_graphql_query": "text",
    "datamart_id": "text",
    "last_periodic_evaluation_ts": 0,
    "created_ts": 0,
    "group_id": "text",
    "status": "INITIAL"
  }
}

Last updated

Was this helpful?