> 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-privacy/compartment-x-processing.md).

# Compartment X Processing

Operations related to Compartment Processings that link legal processing basis to specific Compartments.

## GET /datamarts/{datamart\_id}/compartments/{compartment\_selection\_id}/processing\_selections

> Find processing selections for compartment

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Compartment x Processing","description":"Operations related to Compartment Processings that link legal processing basis to specific Compartments."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/compartments/{compartment_selection_id}/processing_selections":{"get":{"description":"","operationId":"findProcessingSelectionsByCompartment","tags":["Compartment x Processing"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"first_result":{"type":"integer"},"max_results":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ProcessingSelectionResource"}},"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"}},"parameters":[{"required":true,"schema":{"type":"integer","format":"int64"},"style":"simple","in":"path","explode":false,"name":"datamart_id"},{"schema":{"type":"integer","format":"int64"},"in":"path","explode":false,"name":"compartment_selection_id","required":true,"style":"simple"}],"summary":"Find processing selections for compartment"}}},"components":{"schemas":{"ProcessingSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"processing_name":{"type":"string","readOnly":true}},"required":["id","processing_id","processing_name"]},"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}/compartments/{compartment\_selection\_id}/processing\_selections

> Create processing selection for compartment

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Compartment x Processing","description":"Operations related to Compartment Processings that link legal processing basis to specific Compartments."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/compartments/{compartment_selection_id}/processing_selections":{"post":{"tags":["Compartment x Processing"],"description":"","requestBody":{"description":"The processing selection to create","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessingSelectionResource"}}},"required":true},"operationId":"createProcessingSelectionByCompartment","summary":"Create processing selection for compartment","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ProcessingSelectionResource"}},"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":[{"schema":{"type":"integer","format":"int64"},"required":true,"explode":false,"style":"simple","in":"path","name":"datamart_id"},{"style":"simple","required":true,"name":"compartment_selection_id","in":"path","explode":false,"schema":{"type":"integer","format":"int64"}}]}}},"components":{"schemas":{"ProcessingSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"processing_name":{"type":"string","readOnly":true}},"required":["id","processing_id","processing_name"]},"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"}}}}}}}
```

## GET /datamarts/{datamart\_id}/compartments/{compartment\_selection\_id}/processing\_selections/{id}

> Get processing selection by compartment and processing selection id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Compartment x Processing","description":"Operations related to Compartment Processings that link legal processing basis to specific Compartments."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/compartments/{compartment_selection_id}/processing_selections/{id}":{"get":{"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ProcessingSelectionResource"}},"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":"","parameters":[{"schema":{"type":"integer","format":"int64"},"style":"simple","in":"path","name":"datamart_id","required":true,"explode":false},{"style":"simple","explode":false,"schema":{"type":"integer","format":"int64"},"name":"compartment_selection_id","required":true,"in":"path"},{"style":"simple","name":"id","in":"path","schema":{"type":"integer","format":"int64"},"required":true,"explode":false}],"summary":"Get processing selection by compartment and processing selection id","tags":["Compartment x Processing"],"operationId":"getProcessingSelectionByCompartment"}}},"components":{"schemas":{"ProcessingSelectionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"processing_name":{"type":"string","readOnly":true}},"required":["id","processing_id","processing_name"]},"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 /datamarts/{datamart\_id}/compartments/{compartment\_selection\_id}/processing\_selections/{id}

> Delete processing selection by compartment and processing selection id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Compartment x Processing","description":"Operations related to Compartment Processings that link legal processing basis to specific Compartments."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/datamarts/{datamart_id}/compartments/{compartment_selection_id}/processing_selections/{id}":{"delete":{"description":"","parameters":[{"explode":false,"style":"simple","name":"datamart_id","in":"path","schema":{"type":"integer","format":"int64"},"required":true},{"schema":{"type":"integer","format":"int64"},"name":"compartment_selection_id","explode":false,"style":"simple","required":true,"in":"path"},{"in":"path","explode":false,"required":true,"style":"simple","schema":{"type":"integer","format":"int64"},"name":"id"}],"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"}},"tags":["Compartment x Processing"],"summary":"Delete processing selection by compartment and processing selection id","operationId":"deleteProcessingSelectionByCompartment"}}},"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"]}}}}
```


---

# 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-privacy/compartment-x-processing.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.
