> 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/userpoint/userpoint-consent.md).

# Userpoint Consent

Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:

* **Legal basis types** - CONSENT (opt-in required), LEGITIMATE\_INTEREST (opt-out allowed)
* **Acceptance value** - true (allow processing) or false (block processing)
* **Privacy walls** - Automatic enforcement on channels, compartments, and segments
* **Capture methods** - $set\_user\_choice events, dedicated APIs, JavaScript tag integration

UserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.

Relevant documentation:

* [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)
* [Consent management](https://userguides.mediarithmics.io/basics/consent-management)

## GET /datamarts/{datamart\_id}/user\_points/{user\_point\_identifier}/user\_choices/processing\_id={processing\_id}/change\_log

> Get a user choice's change log

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Userpoint Consent","description":"Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:\n- **Legal basis types** - CONSENT (opt-in required), LEGITIMATE_INTEREST (opt-out allowed)\n- **Acceptance value** - true (allow processing) or false (block processing)\n- **Privacy walls** - Automatic enforcement on channels, compartments, and segments\n- **Capture methods** - $set_user_choice events, dedicated APIs, JavaScript tag integration\n\nUserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.\n\nRelevant documentation:\n- [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)\n- [Consent management](https://userguides.mediarithmics.io/basics/consent-management)\n"}],"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_identifier}/user_choices/processing_id={processing_id}/change_log":{"get":{"tags":["Userpoint Consent"],"operationId":"getUserChoiceChangeLog","description":"","summary":"Get a user choice's change log","parameters":[{"schema":{"type":"integer","format":"int64"},"in":"path","style":"simple","required":true,"name":"datamart_id","explode":false},{"in":"path","schema":{"$ref":"#/components/schemas/PublicUserIdentifiers"},"required":true,"explode":false,"name":"user_point_identifier","style":"simple"},{"name":"processing_id","style":"simple","explode":false,"schema":{"type":"string"},"required":true,"in":"path"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/UserChoiceResource"}},"first_result":{"type":"integer"},"total":{"type":"integer"},"max_results":{"type":"integer"},"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"}}}}},"components":{"schemas":{"PublicUserIdentifiers":{"type":"string","description":"User identifier in one of the following format : - a UUID (a.k.a userpoint id) - user_point_id=xxx where xxx is a UUID - compartment_id=xxx,user_account_id=yyy - user_agent_id=xxx - email_hash=xxx ","pattern":"^([0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}|user_point_id=[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}|compartment_id=\\d+,user_account_id=\\S+|user_account_id=\\S+(,compartment_id=\\d+)?|user_agent_id=\\S+|email_hash=\\S+)$"},"UserChoiceResource":{"type":"object","properties":{"choice_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"choice_source_token":{"type":"string","readOnly":true},"email_hash":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_account_id":{"type":"string","readOnly":false},"user_agent_id":{"$ref":"#/components/schemas/UserAgentId"},"user_point_id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"choice_acceptance_value":{"type":"boolean","default":false,"readOnly":false},"channel_id":{"type":"string","readOnly":false},"compartment_id":{"type":"string","readOnly":false},"choice_source_id":{"type":"string","readOnly":false}},"required":["choice_acceptance_value","choice_ts","creation_ts"]},"UserAgentId":{"allOf":[{"$ref":"#/components/schemas/UserIdentifier"},{"type":"object"}]},"UserIdentifier":{"type":"object"},"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}/user\_points/compartment\_id={compartment\_id}/user\_account\_id={user\_account\_id}/user\_choices/processing\_id={processing\_id}/change\_log

> Get user choice by compartment id / user account id change log

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Userpoint Consent","description":"Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:\n- **Legal basis types** - CONSENT (opt-in required), LEGITIMATE_INTEREST (opt-out allowed)\n- **Acceptance value** - true (allow processing) or false (block processing)\n- **Privacy walls** - Automatic enforcement on channels, compartments, and segments\n- **Capture methods** - $set_user_choice events, dedicated APIs, JavaScript tag integration\n\nUserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.\n\nRelevant documentation:\n- [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)\n- [Consent management](https://userguides.mediarithmics.io/basics/consent-management)\n"}],"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/compartment_id={compartment_id}/user_account_id={user_account_id}/user_choices/processing_id={processing_id}/change_log":{"get":{"summary":"Get user choice by compartment id / user account id change log","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"max_results":{"type":"integer"},"first_result":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"total":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/UserChoiceResource"}}},"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"}},"tags":["Userpoint Consent"],"description":"","operationId":"getUserChoiceByCompartmentChangeLog","parameters":[{"name":"datamart_id","required":true,"style":"simple","in":"path","schema":{"type":"integer","format":"int64"},"explode":false},{"style":"simple","in":"path","schema":{"type":"string"},"required":true,"name":"compartment_id","explode":false},{"style":"simple","required":true,"schema":{"type":"string"},"explode":false,"name":"user_account_id","in":"path"},{"schema":{"type":"string"},"name":"processing_id","in":"path","style":"simple","required":true,"explode":false}]}}},"components":{"schemas":{"UserChoiceResource":{"type":"object","properties":{"choice_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"choice_source_token":{"type":"string","readOnly":true},"email_hash":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_account_id":{"type":"string","readOnly":false},"user_agent_id":{"$ref":"#/components/schemas/UserAgentId"},"user_point_id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"choice_acceptance_value":{"type":"boolean","default":false,"readOnly":false},"channel_id":{"type":"string","readOnly":false},"compartment_id":{"type":"string","readOnly":false},"choice_source_id":{"type":"string","readOnly":false}},"required":["choice_acceptance_value","choice_ts","creation_ts"]},"UserAgentId":{"allOf":[{"$ref":"#/components/schemas/UserIdentifier"},{"type":"object"}]},"UserIdentifier":{"type":"object"},"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}/user\_points/{user\_point\_identifier}/user\_choices/processing\_id={processing\_id}

> Get a user choice

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Userpoint Consent","description":"Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:\n- **Legal basis types** - CONSENT (opt-in required), LEGITIMATE_INTEREST (opt-out allowed)\n- **Acceptance value** - true (allow processing) or false (block processing)\n- **Privacy walls** - Automatic enforcement on channels, compartments, and segments\n- **Capture methods** - $set_user_choice events, dedicated APIs, JavaScript tag integration\n\nUserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.\n\nRelevant documentation:\n- [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)\n- [Consent management](https://userguides.mediarithmics.io/basics/consent-management)\n"}],"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_identifier}/user_choices/processing_id={processing_id}":{"get":{"summary":"Get a user choice","description":"","parameters":[{"schema":{"type":"integer","format":"int64"},"style":"simple","in":"path","required":true,"explode":false,"name":"datamart_id"},{"in":"path","required":true,"schema":{"$ref":"#/components/schemas/PublicUserIdentifiers"},"name":"user_point_identifier","style":"simple","explode":false},{"schema":{"type":"string"},"name":"processing_id","explode":false,"style":"simple","required":true,"in":"path"}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/UserChoiceResource"}},"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":["Userpoint Consent"],"operationId":"getUserChoice"}}},"components":{"schemas":{"PublicUserIdentifiers":{"type":"string","description":"User identifier in one of the following format : - a UUID (a.k.a userpoint id) - user_point_id=xxx where xxx is a UUID - compartment_id=xxx,user_account_id=yyy - user_agent_id=xxx - email_hash=xxx ","pattern":"^([0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}|user_point_id=[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}|compartment_id=\\d+,user_account_id=\\S+|user_account_id=\\S+(,compartment_id=\\d+)?|user_agent_id=\\S+|email_hash=\\S+)$"},"UserChoiceResource":{"type":"object","properties":{"choice_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"choice_source_token":{"type":"string","readOnly":true},"email_hash":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_account_id":{"type":"string","readOnly":false},"user_agent_id":{"$ref":"#/components/schemas/UserAgentId"},"user_point_id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"choice_acceptance_value":{"type":"boolean","default":false,"readOnly":false},"channel_id":{"type":"string","readOnly":false},"compartment_id":{"type":"string","readOnly":false},"choice_source_id":{"type":"string","readOnly":false}},"required":["choice_acceptance_value","choice_ts","creation_ts"]},"UserAgentId":{"allOf":[{"$ref":"#/components/schemas/UserIdentifier"},{"type":"object"}]},"UserIdentifier":{"type":"object"},"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 /datamarts/{datamart\_id}/user\_points/{user\_point\_identifier}/user\_choices/processing\_id={processing\_id}

> Upsert a user choice

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Userpoint Consent","description":"Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:\n- **Legal basis types** - CONSENT (opt-in required), LEGITIMATE_INTEREST (opt-out allowed)\n- **Acceptance value** - true (allow processing) or false (block processing)\n- **Privacy walls** - Automatic enforcement on channels, compartments, and segments\n- **Capture methods** - $set_user_choice events, dedicated APIs, JavaScript tag integration\n\nUserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.\n\nRelevant documentation:\n- [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)\n- [Consent management](https://userguides.mediarithmics.io/basics/consent-management)\n"}],"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_identifier}/user_choices/processing_id={processing_id}":{"put":{"description":"","summary":"Upsert a user choice","tags":["Userpoint Consent"],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/UserChoiceResource"}},"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":[{"name":"datamart_id","explode":false,"style":"simple","required":true,"schema":{"type":"integer","format":"int64"},"in":"path"},{"schema":{"$ref":"#/components/schemas/PublicUserIdentifiers"},"in":"path","required":true,"explode":false,"name":"user_point_identifier","style":"simple"},{"schema":{"type":"string"},"explode":false,"in":"path","name":"processing_id","required":true,"style":"simple"},{"required":false,"explode":true,"schema":{"type":"boolean","default":false},"style":"form","in":"query","name":"force_replace","description":"Force replace"}],"requestBody":{"description":"The new value of the user choice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserChoiceResource"}}},"required":true},"operationId":"upsertUserChoice"}}},"components":{"schemas":{"UserChoiceResource":{"type":"object","properties":{"choice_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"choice_source_token":{"type":"string","readOnly":true},"email_hash":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_account_id":{"type":"string","readOnly":false},"user_agent_id":{"$ref":"#/components/schemas/UserAgentId"},"user_point_id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"choice_acceptance_value":{"type":"boolean","default":false,"readOnly":false},"channel_id":{"type":"string","readOnly":false},"compartment_id":{"type":"string","readOnly":false},"choice_source_id":{"type":"string","readOnly":false}},"required":["choice_acceptance_value","choice_ts","creation_ts"]},"UserAgentId":{"allOf":[{"$ref":"#/components/schemas/UserIdentifier"},{"type":"object"}]},"UserIdentifier":{"type":"object"},"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"]},"PublicUserIdentifiers":{"type":"string","description":"User identifier in one of the following format : - a UUID (a.k.a userpoint id) - user_point_id=xxx where xxx is a UUID - compartment_id=xxx,user_account_id=yyy - user_agent_id=xxx - email_hash=xxx ","pattern":"^([0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}|user_point_id=[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}|compartment_id=\\d+,user_account_id=\\S+|user_account_id=\\S+(,compartment_id=\\d+)?|user_agent_id=\\S+|email_hash=\\S+)$"}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## DELETE /datamarts/{datamart\_id}/user\_points/{user\_point\_identifier}/user\_choices/processing\_id={processing\_id}

> Delete a user choice

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Userpoint Consent","description":"Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:\n- **Legal basis types** - CONSENT (opt-in required), LEGITIMATE_INTEREST (opt-out allowed)\n- **Acceptance value** - true (allow processing) or false (block processing)\n- **Privacy walls** - Automatic enforcement on channels, compartments, and segments\n- **Capture methods** - $set_user_choice events, dedicated APIs, JavaScript tag integration\n\nUserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.\n\nRelevant documentation:\n- [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)\n- [Consent management](https://userguides.mediarithmics.io/basics/consent-management)\n"}],"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_identifier}/user_choices/processing_id={processing_id}":{"delete":{"description":"","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"}},"summary":"Delete a user choice","operationId":"deleteUserChoice","tags":["Userpoint Consent"],"parameters":[{"explode":false,"schema":{"type":"integer","format":"int64"},"in":"path","name":"datamart_id","style":"simple","required":true},{"name":"user_point_identifier","style":"simple","schema":{"$ref":"#/components/schemas/PublicUserIdentifiers"},"required":true,"in":"path","explode":false},{"explode":false,"in":"path","name":"processing_id","required":true,"schema":{"type":"string"},"style":"simple"}]}}},"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"]},"PublicUserIdentifiers":{"type":"string","description":"User identifier in one of the following format : - a UUID (a.k.a userpoint id) - user_point_id=xxx where xxx is a UUID - compartment_id=xxx,user_account_id=yyy - user_agent_id=xxx - email_hash=xxx ","pattern":"^([0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}|user_point_id=[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}|compartment_id=\\d+,user_account_id=\\S+|user_account_id=\\S+(,compartment_id=\\d+)?|user_agent_id=\\S+|email_hash=\\S+)$"}}}}
```

## GET /datamarts/{datamart\_id}/user\_points/compartment\_id={compartment\_id}/user\_account\_id={user\_account\_id}/user\_choices

> Get user choices by compartment id / user account id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Userpoint Consent","description":"Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:\n- **Legal basis types** - CONSENT (opt-in required), LEGITIMATE_INTEREST (opt-out allowed)\n- **Acceptance value** - true (allow processing) or false (block processing)\n- **Privacy walls** - Automatic enforcement on channels, compartments, and segments\n- **Capture methods** - $set_user_choice events, dedicated APIs, JavaScript tag integration\n\nUserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.\n\nRelevant documentation:\n- [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)\n- [Consent management](https://userguides.mediarithmics.io/basics/consent-management)\n"}],"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/compartment_id={compartment_id}/user_account_id={user_account_id}/user_choices":{"get":{"operationId":"getUserChoicesByCompartment","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/UserChoiceResource"}},"status":{"type":"string","enum":["ok"]},"first_result":{"type":"integer"},"max_results":{"type":"integer"},"total":{"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"}},"summary":"Get user choices by compartment id / user account id","description":"","tags":["Userpoint Consent"],"parameters":[{"required":true,"name":"datamart_id","schema":{"type":"integer","format":"int64"},"in":"path","explode":false,"style":"simple"},{"name":"compartment_id","style":"simple","explode":false,"schema":{"type":"string"},"in":"path","required":true},{"schema":{"type":"string"},"required":true,"name":"user_account_id","style":"simple","explode":false,"in":"path"},{"explode":true,"style":"form","required":false,"name":"consent_value","in":"query","schema":{"type":"boolean"}},{"name":"processing_id","required":false,"in":"query","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":true}]}}},"components":{"schemas":{"UserChoiceResource":{"type":"object","properties":{"choice_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"choice_source_token":{"type":"string","readOnly":true},"email_hash":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_account_id":{"type":"string","readOnly":false},"user_agent_id":{"$ref":"#/components/schemas/UserAgentId"},"user_point_id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"choice_acceptance_value":{"type":"boolean","default":false,"readOnly":false},"channel_id":{"type":"string","readOnly":false},"compartment_id":{"type":"string","readOnly":false},"choice_source_id":{"type":"string","readOnly":false}},"required":["choice_acceptance_value","choice_ts","creation_ts"]},"UserAgentId":{"allOf":[{"$ref":"#/components/schemas/UserIdentifier"},{"type":"object"}]},"UserIdentifier":{"type":"object"},"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}/user\_points/compartment\_id={compartment\_id}/user\_account\_id={user\_account\_id}/user\_choices/processing\_id={processing\_id}

> Get user choice by compartment id / user account id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Userpoint Consent","description":"Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:\n- **Legal basis types** - CONSENT (opt-in required), LEGITIMATE_INTEREST (opt-out allowed)\n- **Acceptance value** - true (allow processing) or false (block processing)\n- **Privacy walls** - Automatic enforcement on channels, compartments, and segments\n- **Capture methods** - $set_user_choice events, dedicated APIs, JavaScript tag integration\n\nUserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.\n\nRelevant documentation:\n- [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)\n- [Consent management](https://userguides.mediarithmics.io/basics/consent-management)\n"}],"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/compartment_id={compartment_id}/user_account_id={user_account_id}/user_choices/processing_id={processing_id}":{"get":{"description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/UserChoiceResource"}},"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":[{"style":"simple","name":"datamart_id","required":true,"in":"path","explode":false,"schema":{"type":"integer","format":"int64"}},{"required":true,"schema":{"type":"string"},"in":"path","name":"compartment_id","style":"simple","explode":false},{"name":"user_account_id","schema":{"type":"string"},"style":"simple","explode":false,"required":true,"in":"path"},{"name":"processing_id","style":"simple","schema":{"type":"string"},"required":true,"explode":false,"in":"path"}],"tags":["Userpoint Consent"],"operationId":"getUserChoiceByCompartment","summary":"Get user choice by compartment id / user account id"}}},"components":{"schemas":{"UserChoiceResource":{"type":"object","properties":{"choice_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"choice_source_token":{"type":"string","readOnly":true},"email_hash":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_account_id":{"type":"string","readOnly":false},"user_agent_id":{"$ref":"#/components/schemas/UserAgentId"},"user_point_id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"choice_acceptance_value":{"type":"boolean","default":false,"readOnly":false},"channel_id":{"type":"string","readOnly":false},"compartment_id":{"type":"string","readOnly":false},"choice_source_id":{"type":"string","readOnly":false}},"required":["choice_acceptance_value","choice_ts","creation_ts"]},"UserAgentId":{"allOf":[{"$ref":"#/components/schemas/UserIdentifier"},{"type":"object"}]},"UserIdentifier":{"type":"object"},"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 /datamarts/{datamart\_id}/user\_points/compartment\_id={compartment\_id}/user\_account\_id={user\_account\_id}/user\_choices/processing\_id={processing\_id}

> Upsert user choice by compartment id / user account id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Userpoint Consent","description":"Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:\n- **Legal basis types** - CONSENT (opt-in required), LEGITIMATE_INTEREST (opt-out allowed)\n- **Acceptance value** - true (allow processing) or false (block processing)\n- **Privacy walls** - Automatic enforcement on channels, compartments, and segments\n- **Capture methods** - $set_user_choice events, dedicated APIs, JavaScript tag integration\n\nUserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.\n\nRelevant documentation:\n- [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)\n- [Consent management](https://userguides.mediarithmics.io/basics/consent-management)\n"}],"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/compartment_id={compartment_id}/user_account_id={user_account_id}/user_choices/processing_id={processing_id}":{"put":{"requestBody":{"description":"The new value of the user choice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserChoiceResource"}}},"required":true},"parameters":[{"explode":false,"in":"path","required":true,"style":"simple","schema":{"type":"integer","format":"int64"},"name":"datamart_id"},{"explode":false,"schema":{"type":"string"},"style":"simple","name":"compartment_id","in":"path","required":true},{"required":true,"in":"path","explode":false,"schema":{"type":"string"},"name":"user_account_id","style":"simple"},{"name":"processing_id","in":"path","style":"simple","required":true,"schema":{"type":"string"},"explode":false},{"required":false,"description":"Force replace","in":"query","schema":{"type":"boolean","default":false},"name":"force_replace","explode":true,"style":"form"}],"tags":["Userpoint Consent"],"operationId":"upsertUserChoiceByCompartment","description":"","summary":"Upsert user choice by compartment id / user account id","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/UserChoiceResource"}},"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"}}}}},"components":{"schemas":{"UserChoiceResource":{"type":"object","properties":{"choice_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"choice_source_token":{"type":"string","readOnly":true},"email_hash":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_account_id":{"type":"string","readOnly":false},"user_agent_id":{"$ref":"#/components/schemas/UserAgentId"},"user_point_id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"choice_acceptance_value":{"type":"boolean","default":false,"readOnly":false},"channel_id":{"type":"string","readOnly":false},"compartment_id":{"type":"string","readOnly":false},"choice_source_id":{"type":"string","readOnly":false}},"required":["choice_acceptance_value","choice_ts","creation_ts"]},"UserAgentId":{"allOf":[{"$ref":"#/components/schemas/UserIdentifier"},{"type":"object"}]},"UserIdentifier":{"type":"object"},"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}/user\_points/compartment\_id={compartment\_id}/user\_account\_id={user\_account\_id}/user\_choices/processing\_id={processing\_id}

> Delete user choice by compartment id / user account id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Userpoint Consent","description":"Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:\n- **Legal basis types** - CONSENT (opt-in required), LEGITIMATE_INTEREST (opt-out allowed)\n- **Acceptance value** - true (allow processing) or false (block processing)\n- **Privacy walls** - Automatic enforcement on channels, compartments, and segments\n- **Capture methods** - $set_user_choice events, dedicated APIs, JavaScript tag integration\n\nUserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.\n\nRelevant documentation:\n- [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)\n- [Consent management](https://userguides.mediarithmics.io/basics/consent-management)\n"}],"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/compartment_id={compartment_id}/user_account_id={user_account_id}/user_choices/processing_id={processing_id}":{"delete":{"summary":"Delete user choice by compartment id / user account id","parameters":[{"schema":{"type":"integer","format":"int64"},"name":"datamart_id","style":"simple","required":true,"in":"path","explode":false},{"name":"compartment_id","style":"simple","explode":false,"schema":{"type":"string"},"required":true,"in":"path"},{"schema":{"type":"string"},"name":"user_account_id","style":"simple","required":true,"in":"path","explode":false},{"style":"simple","required":true,"in":"path","name":"processing_id","schema":{"type":"string"},"explode":false}],"tags":["Userpoint Consent"],"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"}},"operationId":"deleteUserChoiceByCompartment","description":""}}},"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 /datamarts/{datamart\_id}/user\_points/{user\_point\_identifier}/user\_choices

> Get user choices

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Userpoint Consent","description":"Operations related to **UserPoint Consent** (UserChoices), the tracking of user privacy preferences and consent for data processing in compliance with GDPR and data protection regulations:\n- **Legal basis types** - CONSENT (opt-in required), LEGITIMATE_INTEREST (opt-out allowed)\n- **Acceptance value** - true (allow processing) or false (block processing)\n- **Privacy walls** - Automatic enforcement on channels, compartments, and segments\n- **Capture methods** - $set_user_choice events, dedicated APIs, JavaScript tag integration\n\nUserChoices automatically block data processing when consent is missing or withdrawn, with changelog tracking for audit compliance.\n\nRelevant documentation:\n- [User choices](https://developer.mediarithmics.io/advanced-usages/data-privacy-compliance/user-choices)\n- [Consent management](https://userguides.mediarithmics.io/basics/consent-management)\n"}],"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_identifier}/user_choices":{"get":{"operationId":"getUserChoices","summary":"Get user choices","parameters":[{"name":"datamart_id","schema":{"type":"integer","format":"int64"},"style":"simple","in":"path","explode":false,"required":true},{"name":"user_point_identifier","schema":{"$ref":"#/components/schemas/PublicUserIdentifiers"},"in":"path","explode":false,"required":true,"style":"simple"},{"in":"query","explode":true,"style":"form","required":false,"name":"consent_value","schema":{"type":"boolean"}},{"style":"form","explode":true,"name":"processing_id","in":"query","schema":{"type":"array","items":{"type":"string"}},"required":false}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UserChoiceResource"}},"max_results":{"type":"integer"},"total":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"count":{"type":"integer"},"first_result":{"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"}},"tags":["Userpoint Consent"],"description":""}}},"components":{"schemas":{"PublicUserIdentifiers":{"type":"string","description":"User identifier in one of the following format : - a UUID (a.k.a userpoint id) - user_point_id=xxx where xxx is a UUID - compartment_id=xxx,user_account_id=yyy - user_agent_id=xxx - email_hash=xxx ","pattern":"^([0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}|user_point_id=[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}|compartment_id=\\d+,user_account_id=\\S+|user_account_id=\\S+(,compartment_id=\\d+)?|user_agent_id=\\S+|email_hash=\\S+)$"},"UserChoiceResource":{"type":"object","properties":{"choice_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"choice_source_token":{"type":"string","readOnly":true},"email_hash":{"type":"string","readOnly":false},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"user_account_id":{"type":"string","readOnly":false},"user_agent_id":{"$ref":"#/components/schemas/UserAgentId"},"user_point_id":{"type":"string","readOnly":false},"processing_id":{"type":"string","readOnly":false},"choice_acceptance_value":{"type":"boolean","default":false,"readOnly":false},"channel_id":{"type":"string","readOnly":false},"compartment_id":{"type":"string","readOnly":false},"choice_source_id":{"type":"string","readOnly":false}},"required":["choice_acceptance_value","choice_ts","creation_ts"]},"UserAgentId":{"allOf":[{"$ref":"#/components/schemas/UserIdentifier"},{"type":"object"}]},"UserIdentifier":{"type":"object"},"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/userpoint/userpoint-consent.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.
