> 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/experiment/experiment-criteria.md).

# Experiment Criteria

Operations related to Experiment Criteria for defining test parameters and success metrics in experimentation frameworks.

## GET /datamarts/{datamart\_id}/experiments/criteria

> Search for experiments criteria in a datamart

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Experiment Criteria","description":"Operations related to Experiment Criteria for defining test parameters and success metrics in experimentation frameworks."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/experiments/criteria":{"get":{"description":"","tags":["Experiment Criteria"],"summary":"Search for experiments criteria in a datamart","parameters":[{"description":"The Datamart id from which to get the representativeness criteria","name":"datamart_id","in":"path","required":true,"explode":false,"style":"simple","schema":{"type":"integer","format":"int64"}},{"explode":true,"description":"If true the result will contain only archived experiments criteria","schema":{"type":"boolean"},"style":"form","in":"query","name":"archived","required":false},{"explode":true,"description":"Offset from which the search must be performed","in":"query","required":false,"name":"first_result","style":"form","schema":{"type":"integer","format":"int32"}},{"schema":{"type":"integer","format":"int32"},"description":"Number of maximum items that shall be return by this search","required":false,"explode":true,"name":"max_results","style":"form","in":"query"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"first_result":{"type":"integer"},"max_results":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ExperimentCriterionResource"}},"status":{"type":"string","enum":["ok"]},"total":{"type":"integer"},"count":{"type":"integer"}},"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"}},"operationId":"findExperimentCriteria"}}},"components":{"schemas":{"ExperimentCriterionResource":{"type":"object","properties":{"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"last_modified_by":{"type":"string","readOnly":true},"query_id":{"type":"string","readOnly":false},"created_by":{"type":"string","readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":true},"archived_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"name":{"type":"string","readOnly":false},"archived_by":{"type":"string","readOnly":true}},"required":["archived","created_by","created_ts","datamart_id","id","last_modified_by","last_modified_ts","name","query_id"]},"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}/experiments/criteria

> Create a representativeness criterion in a datamart

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Experiment Criteria","description":"Operations related to Experiment Criteria for defining test parameters and success metrics in experimentation frameworks."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/experiments/criteria":{"post":{"summary":"Create a representativeness criterion in a datamart","parameters":[{"explode":false,"description":"The Datamart id from which to get the representativeness criteria","name":"datamart_id","schema":{"type":"integer","format":"int64"},"style":"simple","in":"path","required":true}],"description":"","tags":["Experiment Criteria"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ExperimentCriterionResource"}},"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 representativeness criterion to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentCriterionResource"}}},"required":true},"operationId":"createExperimentCriterion"}}},"components":{"schemas":{"ExperimentCriterionResource":{"type":"object","properties":{"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"last_modified_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":false},"last_modified_by":{"type":"string","readOnly":true},"query_id":{"type":"string","readOnly":false},"created_by":{"type":"string","readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":true},"archived_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"id":{"type":"string","readOnly":true},"name":{"type":"string","readOnly":false},"archived_by":{"type":"string","readOnly":true}},"required":["archived","created_by","created_ts","datamart_id","id","last_modified_by","last_modified_ts","name","query_id"]},"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"}}}}}}}
```


---

# 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/experiment/experiment-criteria.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.
