> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/api-reference/datamart-management/computed-fields.md).

# 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 /computed\_fields/{computed\_field\_id}

> Get a computed field

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Computed Fields","description":"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)."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/computed_fields/{computed_field_id}":{"get":{"parameters":[{"style":"simple","in":"path","explode":false,"schema":{"type":"string"},"name":"computed_field_id","required":true}],"tags":["Computed Fields"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ComputedFieldResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"description":"","operationId":"getComputedField","summary":"Get a computed field"}}},"components":{"schemas":{"ComputedFieldResource":{"type":"object","properties":{"created_by":{"type":"string","readOnly":true},"version_id":{"type":"string","readOnly":false},"version_value":{"type":"string","readOnly":true},"artifact_id":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"plugin_id":{"type":"string","readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"name":{"type":"string","readOnly":false},"description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"cache_max_duration":{"default":0,"readOnly":false,"type":"integer","format":"int64"},"filter_graphql_query":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"last_periodic_evaluation_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"group_id":{"type":"string","readOnly":true},"status":{"$ref":"#/components/schemas/ComputedFieldStatus"}},"required":["archived","artifact_id","cache_max_duration","created_by","created_ts","datamart_id","filter_graphql_query","group_id","id","name","organisation_id","plugin_id","status","technical_name","version_id","version_value"]},"ComputedFieldStatus":{"type":"string","enum":["INITIAL","INITIAL_LOADING","PAUSED","ACTIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## PUT /computed\_fields/{computed\_field\_id}

> Update a computed field

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Computed Fields","description":"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)."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/computed_fields/{computed_field_id}":{"put":{"description":"","requestBody":{"description":"The computed field to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComputedFieldResource"}}},"required":true},"tags":["Computed Fields"],"parameters":[{"required":true,"name":"computed_field_id","explode":false,"in":"path","style":"simple","schema":{"type":"string"}}],"summary":"Update a computed field","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ComputedFieldResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"updateComputedField"}}},"components":{"schemas":{"ComputedFieldResource":{"type":"object","properties":{"created_by":{"type":"string","readOnly":true},"version_id":{"type":"string","readOnly":false},"version_value":{"type":"string","readOnly":true},"artifact_id":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"plugin_id":{"type":"string","readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"name":{"type":"string","readOnly":false},"description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"cache_max_duration":{"default":0,"readOnly":false,"type":"integer","format":"int64"},"filter_graphql_query":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"last_periodic_evaluation_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"group_id":{"type":"string","readOnly":true},"status":{"$ref":"#/components/schemas/ComputedFieldStatus"}},"required":["archived","artifact_id","cache_max_duration","created_by","created_ts","datamart_id","filter_graphql_query","group_id","id","name","organisation_id","plugin_id","status","technical_name","version_id","version_value"]},"ComputedFieldStatus":{"type":"string","enum":["INITIAL","INITIAL_LOADING","PAUSED","ACTIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## DELETE /computed\_fields/{computed\_field\_id}

> Delete a computed field

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Computed Fields","description":"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)."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/computed_fields/{computed_field_id}":{"delete":{"tags":["Computed Fields"],"operationId":"deleteComputedField","responses":{"200":{"$ref":"#/components/responses/simple"},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"description":"","summary":"Delete a computed field","parameters":[{"schema":{"type":"string"},"explode":false,"in":"path","style":"simple","name":"computed_field_id","required":true}]}}},"components":{"responses":{"simple":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}},"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}}}}
```

## GET /computed\_fields

> Search for computed fields

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Computed Fields","description":"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)."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/computed_fields":{"get":{"summary":"Search for computed fields","operationId":"findComputedFields","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"max_results":{"type":"integer"},"first_result":{"type":"integer"},"total":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ComputedFieldResource"}},"status":{"type":"string","enum":["ok"]}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"description":"","parameters":[{"name":"organisation_id","explode":true,"description":"Id of the organisation owning the computed fields","required":false,"schema":{"type":"string"},"in":"query","style":"form"},{"style":"form","description":"Id of the datamart owning the computed fields","schema":{"type":"string"},"name":"datamart_id","required":false,"in":"query","explode":true},{"explode":true,"name":"plugin_version_id","style":"form","in":"query","schema":{"type":"string"},"description":"ID of the plugin version","required":false},{"schema":{"type":"string"},"name":"name","explode":true,"required":false,"style":"form","description":"Name","in":"query"},{"in":"query","style":"form","schema":{"type":"boolean"},"name":"archived","required":false,"explode":true},{"schema":{"type":"integer","format":"int32"},"name":"first_result","explode":true,"description":"Offset from which the search will be performed","in":"query","style":"form","required":false},{"required":false,"description":"Maximum number of results","schema":{"type":"integer","format":"int32"},"name":"max_results","explode":true,"style":"form","in":"query"}],"tags":["Computed Fields"]}}},"components":{"schemas":{"ComputedFieldResource":{"type":"object","properties":{"created_by":{"type":"string","readOnly":true},"version_id":{"type":"string","readOnly":false},"version_value":{"type":"string","readOnly":true},"artifact_id":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"plugin_id":{"type":"string","readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"name":{"type":"string","readOnly":false},"description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"cache_max_duration":{"default":0,"readOnly":false,"type":"integer","format":"int64"},"filter_graphql_query":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"last_periodic_evaluation_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"group_id":{"type":"string","readOnly":true},"status":{"$ref":"#/components/schemas/ComputedFieldStatus"}},"required":["archived","artifact_id","cache_max_duration","created_by","created_ts","datamart_id","filter_graphql_query","group_id","id","name","organisation_id","plugin_id","status","technical_name","version_id","version_value"]},"ComputedFieldStatus":{"type":"string","enum":["INITIAL","INITIAL_LOADING","PAUSED","ACTIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /computed\_fields

> Create a computed field

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Computed Fields","description":"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)."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/computed_fields":{"post":{"description":"","tags":["Computed Fields"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ComputedFieldResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"requestBody":{"description":"The computed field to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComputedFieldResource"}}},"required":true},"operationId":"createComputedField","summary":"Create a computed field"}}},"components":{"schemas":{"ComputedFieldResource":{"type":"object","properties":{"created_by":{"type":"string","readOnly":true},"version_id":{"type":"string","readOnly":false},"version_value":{"type":"string","readOnly":true},"artifact_id":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"plugin_id":{"type":"string","readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"name":{"type":"string","readOnly":false},"description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"cache_max_duration":{"default":0,"readOnly":false,"type":"integer","format":"int64"},"filter_graphql_query":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"last_periodic_evaluation_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"group_id":{"type":"string","readOnly":true},"status":{"$ref":"#/components/schemas/ComputedFieldStatus"}},"required":["archived","artifact_id","cache_max_duration","created_by","created_ts","datamart_id","filter_graphql_query","group_id","id","name","organisation_id","plugin_id","status","technical_name","version_id","version_value"]},"ComputedFieldStatus":{"type":"string","enum":["INITIAL","INITIAL_LOADING","PAUSED","ACTIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /datamarts/{datamart\_id}/user\_points/{user\_point\_id}/computed\_fields/{computed\_field\_id}/tests/build\_result

> Test build result for a given state

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Computed Fields","description":"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)."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/user_points/{user_point_id}/computed_fields/{computed_field_id}/tests/build_result":{"post":{"description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ComputedFieldBuildResultResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"operationId":"testBuildResult","requestBody":{"description":"The user state to test","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserComputedFieldStateResource"}}},"required":true},"summary":"Test build result for a given state","parameters":[{"name":"datamart_id","required":true,"explode":false,"style":"simple","in":"path","schema":{"type":"string"}},{"in":"path","name":"user_point_id","schema":{"type":"string","format":"uuid"},"explode":false,"required":true,"style":"simple"},{"name":"computed_field_id","schema":{"type":"string"},"in":"path","explode":false,"required":true,"style":"simple"}],"tags":["Computed Fields"]}}},"components":{"schemas":{"ComputedFieldBuildResultResource":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/JsonNode"},"result":{"$ref":"#/components/schemas/JsonNode"},"user_point_id":{"type":"string","format":"uuid","readOnly":false},"execution_time":{"type":"integer","format":"int64","default":0,"readOnly":false},"message":{"type":"string","readOnly":false},"status":{"type":"string","readOnly":false}},"required":["execution_time","status","user_point_id"]},"JsonNode":{"type":"object","description":"raw json"},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]},"UserComputedFieldStateResource":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/JsonNode"}}}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /datamarts/{datamart\_id}/user\_points/{user\_point\_id}/computed\_fields/{computed\_field\_id}/tests/on\_update

> Call on\_update route of the given computed field plugin with the related body

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Computed Fields","description":"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)."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/user_points/{user_point_id}/computed_fields/{computed_field_id}/tests/on_update":{"post":{"description":"","tags":["Computed Fields"],"summary":"Call on_update route of the given computed field plugin with the related body","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ComputedFieldOnUpdateResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"explode":false,"required":true,"style":"simple","schema":{"type":"string"},"name":"datamart_id","in":"path"},{"explode":false,"style":"simple","required":true,"schema":{"type":"string","format":"uuid"},"in":"path","name":"user_point_id"},{"style":"simple","in":"path","schema":{"type":"string"},"explode":false,"name":"computed_field_id","required":true}],"operationId":"testOnUpdate","requestBody":{"description":"The update event pushed to the computed field plugin with an explicit state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComputedFieldUpdateEventWithStateResource"}}},"required":true}}}},"components":{"schemas":{"ComputedFieldOnUpdateResource":{"type":"object","properties":{"previous_state":{"$ref":"#/components/schemas/JsonNode"},"event":{"$ref":"#/components/schemas/JsonNode"},"user_point_id":{"type":"string","format":"uuid","readOnly":false},"status":{"type":"string","readOnly":false},"next_state":{"$ref":"#/components/schemas/JsonNode"},"message":{"type":"string","readOnly":false},"execution_time":{"type":"integer","format":"int64","default":0,"readOnly":false}},"required":["execution_time","status","user_point_id"]},"JsonNode":{"type":"object","description":"raw json"},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]},"ComputedFieldUpdateEventWithStateResource":{"type":"object","properties":{"update":{"$ref":"#/components/schemas/ComputedFieldUserPointUpdate"},"state":{"$ref":"#/components/schemas/JsonNode"}},"required":["update"]},"ComputedFieldUserPointUpdate":{"type":"object","properties":{"data_type":{"$ref":"#/components/schemas/ComputedFieldDataType"},"operation":{"$ref":"#/components/schemas/ComputedFieldDataOperation"},"data":{"$ref":"#/components/schemas/JsonNode"}},"required":["data","data_type","operation"]},"ComputedFieldDataType":{"type":"string","enum":["USER_ACTIVITY","USER_PROFILE"],"readOnly":false},"ComputedFieldDataOperation":{"type":"string","enum":["UPSERT","DELETE"],"readOnly":false}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /computed\_fields/{computed\_field\_id}/actions

> Apply a given action on a computed field

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Computed Fields","description":"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)."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/computed_fields/{computed_field_id}/actions":{"post":{"summary":"Apply a given action on a computed field","operationId":"applyActionOnComputedField","parameters":[{"schema":{"type":"string"},"in":"path","explode":false,"required":true,"style":"simple","name":"computed_field_id"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ComputedFieldResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"tags":["Computed Fields"],"description":"","requestBody":{"description":"The computed field action to apply","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComputedFieldPublicAction"}}},"required":true}}}},"components":{"schemas":{"ComputedFieldResource":{"type":"object","properties":{"created_by":{"type":"string","readOnly":true},"version_id":{"type":"string","readOnly":false},"version_value":{"type":"string","readOnly":true},"artifact_id":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"plugin_id":{"type":"string","readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"name":{"type":"string","readOnly":false},"description":{"type":"string","readOnly":false},"technical_name":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":false},"cache_max_duration":{"default":0,"readOnly":false,"type":"integer","format":"int64"},"filter_graphql_query":{"type":"string","readOnly":false},"datamart_id":{"type":"string","readOnly":false},"last_periodic_evaluation_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"group_id":{"type":"string","readOnly":true},"status":{"$ref":"#/components/schemas/ComputedFieldStatus"}},"required":["archived","artifact_id","cache_max_duration","created_by","created_ts","datamart_id","filter_graphql_query","group_id","id","name","organisation_id","plugin_id","status","technical_name","version_id","version_value"]},"ComputedFieldStatus":{"type":"string","enum":["INITIAL","INITIAL_LOADING","PAUSED","ACTIVE"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]},"ComputedFieldPublicAction":{"allOf":[{"$ref":"#/components/schemas/ComputedFieldAction"}],"properties":{"type":{"type":"string","enum":["PAUSE","UNPAUSE","ARCHIVE"]}},"required":["type"],"oneOf":[{"$ref":"#/components/schemas/PauseComputedFieldAction"},{"$ref":"#/components/schemas/UnpauseComputedFieldAction"},{"$ref":"#/components/schemas/ArchiveComputedFieldAction"}],"discriminator":{"propertyName":"type","mapping":{"PAUSE":"#/components/schemas/PauseComputedFieldAction","UNPAUSE":"#/components/schemas/UnpauseComputedFieldAction","ARCHIVE":"#/components/schemas/ArchiveComputedFieldAction"}}},"ComputedFieldAction":{"type":"object"},"PauseComputedFieldAction":{"type":"object"},"UnpauseComputedFieldAction":{"type":"object"},"ArchiveComputedFieldAction":{"type":"object"}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/api-reference/datamart-management/computed-fields.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
