> 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/identity-and-access-management-iam/user-preferences.md).

# User Preferences

Operations related to User Preferences for managing user-specific settings such as communication preferences and platform customization.

## GET /user\_communication\_preferences/definitions

> Get a list of all user communication preferences available for Mediarithmics users

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"User Preferences","description":"Operations related to User Preferences for managing user-specific settings such as communication preferences and platform customization."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/user_communication_preferences/definitions":{"get":{"tags":["User Preferences"],"summary":"Get a list of all user communication preferences available for Mediarithmics users","operationId":"getUserCommunicationPreferencesDefinitions","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"max_results":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/UserCommunicationPreferenceDefinitionResource"}},"total":{"type":"integer"},"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"}}}}},"components":{"schemas":{"UserCommunicationPreferenceDefinitionResource":{"type":"object","properties":{"id":{"type":"string","readOnly":false},"is_active":{"type":"boolean","default":false,"readOnly":false},"is_internal":{"type":"boolean","default":false,"readOnly":false},"description":{"type":"string","readOnly":false},"business_unit_id":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_at":{"type":"string","readOnly":false},"updated_at":{"type":"string","readOnly":false},"purpose":{"type":"string","readOnly":false},"name":{"type":"string","readOnly":false},"is_default":{"type":"boolean","default":false,"readOnly":false},"communication_method":{"type":"string","readOnly":false}},"required":["business_unit_id","communication_method","id","is_active","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 /users/{user\_id}/communication\_preferences

> Get user communication preferences

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"User Preferences","description":"Operations related to User Preferences for managing user-specific settings such as communication preferences and platform customization."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/users/{user_id}/communication_preferences":{"get":{"summary":"Get user communication preferences","parameters":[{"in":"path","schema":{"type":"string"},"style":"simple","name":"user_id","explode":false,"required":true,"description":"The id of the user"}],"operationId":"getUserCommunicationPreferences","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"count":{"type":"integer"},"first_result":{"type":"integer"},"status":{"type":"string","enum":["ok"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/UserCommunicationPreferenceResource"}},"max_results":{"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":["User Preferences"]}}},"components":{"schemas":{"UserCommunicationPreferenceResource":{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":true},"user_id":{"type":"integer","format":"int64","default":0,"readOnly":true},"timestamp":{"type":"string","readOnly":true},"business_unit_id":{"type":"integer","format":"int64","default":0,"readOnly":true},"subscription_name":{"type":"string","readOnly":true},"subscriber_id_string":{"type":"string","readOnly":true},"legal_basis":{"type":"string","readOnly":false},"status":{"type":"string","readOnly":false},"subscription_id":{"type":"string","readOnly":true},"set_status_success_reason":{"type":"string","readOnly":true},"source":{"type":"string","readOnly":true},"legal_basis_explanation":{"type":"string","readOnly":false},"channel":{"type":"string","readOnly":false}},"required":["business_unit_id","channel","legal_basis","legal_basis_explanation","organisation_id","status","subscriber_id_string","subscription_id","subscription_name","timestamp","user_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 /users/{user\_id}/communication\_preferences

> Update the user communication preferences

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"User Preferences","description":"Operations related to User Preferences for managing user-specific settings such as communication preferences and platform customization."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/users/{user_id}/communication_preferences":{"post":{"requestBody":{"description":"The list of user communication preferences to update","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCommunicationPreferencesResource"}}},"required":true},"tags":["User Preferences"],"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":"Update the user communication preferences","parameters":[{"required":true,"schema":{"type":"string"},"name":"user_id","description":"The id of the user","style":"simple","explode":false,"in":"path"}],"operationId":"updateUserCommunicationPreferences"}}},"components":{"schemas":{"UserCommunicationPreferencesResource":{"type":"object","properties":{"user_preferences":{"type":"array","items":{"$ref":"#/components/schemas/UserCommunicationPreferenceResource"},"readOnly":false}},"required":["user_preferences"]},"UserCommunicationPreferenceResource":{"type":"object","properties":{"organisation_id":{"type":"string","readOnly":true},"user_id":{"type":"integer","format":"int64","default":0,"readOnly":true},"timestamp":{"type":"string","readOnly":true},"business_unit_id":{"type":"integer","format":"int64","default":0,"readOnly":true},"subscription_name":{"type":"string","readOnly":true},"subscriber_id_string":{"type":"string","readOnly":true},"legal_basis":{"type":"string","readOnly":false},"status":{"type":"string","readOnly":false},"subscription_id":{"type":"string","readOnly":true},"set_status_success_reason":{"type":"string","readOnly":true},"source":{"type":"string","readOnly":true},"legal_basis_explanation":{"type":"string","readOnly":false},"channel":{"type":"string","readOnly":false}},"required":["business_unit_id","channel","legal_basis","legal_basis_explanation","organisation_id","status","subscriber_id_string","subscription_id","subscription_name","timestamp","user_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":{"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"}}}}}}}
```


---

# 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/identity-and-access-management-iam/user-preferences.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.
