---
url: https://talkjs.com/docs/Guides/Control_Content_Masking/
title: "Controlling content masking | Guides | TalkJS Docs"
---

For AI agents: Find a documentation index at https://talkjs.com/llms.txt (full content at https://talkjs.com/llms-full.txt). Get a markdown version of any page by appending .md to its URL path.

# Controlling content masking

Vary masking rules for each participant.

Content masking normally follows a user's role. To apply different masking rules for a specific participant in a specific conversation, set [`takeSettingsFromRole.contentMasking`](https://talkjs.com/docs/Concepts/Participants/#takesettingsfromrole) to the name of another role using the [JavaScript Data API](https://talkjs.com/docs/Data_APIs/JavaScript/Participants/#ParticipantRef__set) or [REST API](https://talkjs.com/docs/REST_API/Participation/#modify-participation).

Configure that role's masking rules in the [dashboard](https://talkjs.com/dashboard). The override controls what the participant sees, including existing messages. Other settings still come from their usual role. Set `contentMasking` to `null` to restore that role's masking rules.

## Example: reveal contact details after a transaction

In a marketplace app, you might want to mask contact details by default, but let the buyer and seller see them after a transaction.

In the dashboard, go to `Chat UI` → `Edit roles` → `Create role` and create a new role named `no_masking`. In that role's Chat UI settings, under `Mask unwanted content`, set `Mode` to `No suppression`. [Publish the role to live](https://talkjs.com/docs/Features/Environments/#publish-your-chat-ui-settings-changes-to-live-mode) when using your live app ID.

Then, update the buyer's participation:

```sh
curl https://api.talkjs.com/v1/<APP_ID>/conversations/order_391_fc/participants/betty_buyer \
  -H "Authorization: Bearer <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -X PATCH \
  -d '{ "takeSettingsFromRole": { "contentMasking": "no_masking" } }'
```

Repeat for the seller and any other participants who should see unmasked content.
