// https://github.com/GetStream/stream-node
await client.moderation.upsertConfig({
key: "chat:messaging",
team: "team-a",
ai_text_config: {
rules: [{ label: "SEXUAL_HARASSMENT", action: "flag" }],
},
ai_image_config: {
rules: [{ label: "Non-Explicit Nudity", action: "flag" }],
},
});Multitenant Moderation
Many applications with chat functionality serve multiple customers or organizations. For example, platforms like Slack or SaaS applications like InVision need to ensure that messages remain private between different customer organizations. Stream Chat addresses this through multi-tenant mode, which organizes users into separate teams that operate independently. For more details on multitenancy setup, see our Multitenancy documentation.
This guide explains how you can provide moderation experience for your customers (tenants) by using team-level moderation policies. This will allow you to build a multitenant dashboard for your customers to manage their moderation policies and also allow them to review flagged content for their team. Basically we are providing you the APIs that Stream users to build the dashboard for their customers and you can use these APIs to build the dashboard for your customers however you want.
Limitations and Prerequisites
- Multi-tenancy is only supported on chat.
- Team level semantic phrase lists are not supported.
Create Moderation Policy
You can create moderation configs at the team level by setting the team field in the UpsertConfig API.
Following moderation configuration will be used for all the messages sent to messaging channel type within the team team-a.
Server Side Integration
The server-side integration provides full control over moderation configs and is typically used for:
- Initial setup of team moderation policies
- Bulk updates to moderation rules
- Administrative operations
# https://github.com/GetStream/stream-py
client.moderation().upsert_config(
key="chat:messaging",
team="team-a",
ai_text_config={
"rules": [{"label": "SEXUAL_HARASSMENT", "action": "flag"}],
},
ai_image_config={
"rules": [{"label": "Non-Explicit Nudity", "action": "flag"}],
},
)// https://github.com/GetStream/getstream-go
client.Moderation().UpsertConfig(ctx, &getstream.UpsertConfigRequest{
Key: "chat:messaging",
Team: getstream.PtrTo("team-a"),
AiTextConfig: &getstream.AiTextConfig{
Rules: []getstream.AiTextRule{
{Label: "SEXUAL_HARASSMENT", Action: "flag"},
},
},
AiImageConfig: &getstream.AiImageConfig{
Rules: []getstream.AiImageRule{
{Label: "Non-Explicit Nudity", Action: "flag"},
},
},
})// https://github.com/GetStream/stream-sdk-java
client.moderation().upsertConfig(UpsertConfigRequest.builder()
.key("chat:messaging")
.team("team-a")
.aiTextConfig(AiTextConfig.builder()
.rules(List.of(AiTextRule.builder().label("SEXUAL_HARASSMENT").action("flag").build()))
.build())
.aiImageConfig(AiImageConfig.builder()
.rules(List.of(AiImageRule.builder().label("Non-Explicit Nudity").action("flag").build()))
.build())
.build())
.execute();// https://github.com/GetStream/getstream-php
$client->moderation()->upsertConfig(new UpsertConfigRequest(
key: 'chat:messaging',
team: 'team-a',
aiTextConfig: new AiTextConfig(
rules: [new AiTextRule(label: 'SEXUAL_HARASSMENT', action: 'flag')],
),
aiImageConfig: new AiImageConfig(
rules: [new AiImageRule(label: 'Non-Explicit Nudity', action: 'flag')],
),
));# https://github.com/GetStream/getstream-ruby
client.moderation.upsert_config(GetStream::Generated::Models::UpsertConfigRequest.new(
key: "chat:messaging",
team: "team-a",
ai_text_config: GetStream::Generated::Models::AiTextConfig.new(
rules: [GetStream::Generated::Models::AiTextRule.new(label: "SEXUAL_HARASSMENT", action: "flag")],
),
ai_image_config: GetStream::Generated::Models::AiImageConfig.new(
rules: [GetStream::Generated::Models::AiImageRule.new(label: "Non-Explicit Nudity", action: "flag")],
),
))// https://github.com/GetStream/getstream-net
await client.Moderation.UpsertConfigAsync(new UpsertConfigRequest
{
Key = "chat:messaging",
Team = "team-a",
AiTextConfig = new AiTextConfig
{
Rules = new List<AiTextRule>
{
new AiTextRule { Label = "SEXUAL_HARASSMENT", Action = "flag" },
},
},
AiImageConfig = new AiImageConfig
{
Rules = new List<AiImageRule>
{
new AiImageRule { Label = "Non-Explicit Nudity", Action = "flag" },
},
},
});Client Side Integration
Client side access to API allows you to give control to your customers (tenants) to manage their own moderation policies. This is particularly useful when:
- Building a self-service moderation dashboard
- Allowing teams to customize their moderation settings
- Providing real-time moderation management
// https://github.com/GetStream/stream-node
const client = new StreamChat("api_key");
await client.connectUser({ id: "user-from-team-a" }, token);
await client.moderation.upsertConfig({
key: "chat:messaging",
team: "team-a",
ai_text_config: {
rules: [{ label: "SEXUAL_HARASSMENT", action: "flag" }],
},
ai_image_config: {
rules: [{ label: "Non-Explicit Nudity", action: "flag" }],
},
});# https://github.com/GetStream/stream-py
client.moderation().upsert_config(
key="chat:messaging",
team="team-a",
ai_text_config={
"rules": [{"label": "SEXUAL_HARASSMENT", "action": "flag"}],
},
ai_image_config={
"rules": [{"label": "Non-Explicit Nudity", "action": "flag"}],
},
)// https://github.com/GetStream/getstream-go
client.Moderation().UpsertConfig(ctx, &getstream.UpsertConfigRequest{
Key: "chat:messaging",
Team: getstream.PtrTo("team-a"),
AiTextConfig: &getstream.AiTextConfig{
Rules: []getstream.AiTextRule{
{Label: "SEXUAL_HARASSMENT", Action: "flag"},
},
},
AiImageConfig: &getstream.AiImageConfig{
Rules: []getstream.AiImageRule{
{Label: "Non-Explicit Nudity", Action: "flag"},
},
},
})// https://github.com/GetStream/stream-sdk-java
client.moderation().upsertConfig(UpsertConfigRequest.builder()
.key("chat:messaging")
.team("team-a")
.aiTextConfig(AiTextConfig.builder()
.rules(List.of(AiTextRule.builder().label("SEXUAL_HARASSMENT").action("flag").build()))
.build())
.aiImageConfig(AiImageConfig.builder()
.rules(List.of(AiImageRule.builder().label("Non-Explicit Nudity").action("flag").build()))
.build())
.build())
.execute();// https://github.com/GetStream/getstream-php
$client->moderation()->upsertConfig(new UpsertConfigRequest(
key: 'chat:messaging',
team: 'team-a',
aiTextConfig: new AiTextConfig(
rules: [new AiTextRule(label: 'SEXUAL_HARASSMENT', action: 'flag')],
),
aiImageConfig: new AiImageConfig(
rules: [new AiImageRule(label: 'Non-Explicit Nudity', action: 'flag')],
),
));# https://github.com/GetStream/getstream-ruby
client.moderation.upsert_config(GetStream::Generated::Models::UpsertConfigRequest.new(
key: "chat:messaging",
team: "team-a",
ai_text_config: GetStream::Generated::Models::AiTextConfig.new(
rules: [GetStream::Generated::Models::AiTextRule.new(label: "SEXUAL_HARASSMENT", action: "flag")],
),
ai_image_config: GetStream::Generated::Models::AiImageConfig.new(
rules: [GetStream::Generated::Models::AiImageRule.new(label: "Non-Explicit Nudity", action: "flag")],
),
))// https://github.com/GetStream/getstream-net
await client.Moderation.UpsertConfigAsync(new UpsertConfigRequest
{
Key = "chat:messaging",
Team = "team-a",
AiTextConfig = new AiTextConfig
{
Rules = new List<AiTextRule>
{
new AiTextRule { Label = "SEXUAL_HARASSMENT", Action = "flag" },
},
},
AiImageConfig = new AiImageConfig
{
Rules = new List<AiImageRule>
{
new AiImageRule { Label = "Non-Explicit Nudity", Action = "flag" },
},
},
});Please check AI Text Supported Harm Categories and AI Image Supported Harm Categories for the list of supported harm categories.
Moderation Policy Scopes
The scope of moderation policies is determined by the combination of the config key and team field. Here's a detailed breakdown:
| Config Key | Team Field | Scope | Use Case |
|---|---|---|---|
chat | Applies to all channels across all teams | Global moderation policies | |
chat | team-a | Applies to all channels in team-a | Team-wide policies |
chat:messaging | Applies to messaging channels across all teams | Channel-type specific policies | |
chat:messaging | team-a | Applies to messaging channels in team-a | Team-specific channel type policies |
chat:messaging:<channel_id> | Applies to channel with id channel_id irrespective of team | Channel-specific policies | |
chat:messaging:<channel_id> | team-a | Applies to channel with id channel_id in team-a | Team-specific channel policies |
Query Moderation Policies
You can query moderation configs at the team level to:
- Audit existing moderation policies
- Review team-specific settings
- Monitor policy changes
Using Server side integration
The server-side query provides comprehensive access to all moderation configs:
// https://github.com/GetStream/stream-node
// Get all the moderation configs for all the teams
const { configs, next } = await client.moderation.queryModerationConfigs({
limit: 2,
});
// Get all the moderation configs for the team `team-a`
const { configs, next } = await client.moderation.queryModerationConfigs({
filter: { team: "team-a" },
sort: [{ field: "created_at", direction: -1 }],
limit: 2,
});# https://github.com/GetStream/stream-py
# Get all the moderation configs for all the teams
client.moderation().query_moderation_configs(limit=2)
# Get all the moderation configs for the team `team-a`
client.moderation().query_moderation_configs(
filter={"team": "team-a"},
sort=[{"field": "created_at", "direction": -1}],
limit=2,
)// https://github.com/GetStream/getstream-go
// Get all the moderation configs for all the teams
client.Moderation().QueryModerationConfigs(ctx, &getstream.QueryModerationConfigsRequest{
Limit: getstream.PtrTo(2),
})
// Get all the moderation configs for the team `team-a`
client.Moderation().QueryModerationConfigs(ctx, &getstream.QueryModerationConfigsRequest{
Filter: map[string]interface{}{"team": "team-a"},
Sort: []getstream.SortParam{{Field: "created_at", Direction: getstream.PtrTo(-1)}},
Limit: getstream.PtrTo(2),
})// https://github.com/GetStream/stream-sdk-java
// Get all the moderation configs for all the teams
client.moderation().queryModerationConfigs(QueryModerationConfigsRequest.builder()
.limit(2)
.build())
.execute();
// Get all the moderation configs for the team `team-a`
client.moderation().queryModerationConfigs(QueryModerationConfigsRequest.builder()
.filter(Map.of("team", "team-a"))
.sort(List.of(SortParam.builder().field("created_at").direction(-1).build()))
.limit(2)
.build())
.execute();// https://github.com/GetStream/getstream-php
// Get all the moderation configs for all the teams
$client->moderation()->queryModerationConfigs(new QueryModerationConfigsRequest(
limit: 2,
));
// Get all the moderation configs for the team `team-a`
$client->moderation()->queryModerationConfigs(new QueryModerationConfigsRequest(
filter: ['team' => 'team-a'],
sort: [new SortParam(field: 'created_at', direction: -1)],
limit: 2,
));# https://github.com/GetStream/getstream-ruby
# Get all the moderation configs for all the teams
client.moderation.query_moderation_configs(GetStream::Generated::Models::QueryModerationConfigsRequest.new(
limit: 2,
))
# Get all the moderation configs for the team `team-a`
client.moderation.query_moderation_configs(GetStream::Generated::Models::QueryModerationConfigsRequest.new(
filter: { "team" => "team-a" },
sort: [GetStream::Generated::Models::SortParam.new(field: "created_at", direction: -1)],
limit: 2,
))// https://github.com/GetStream/getstream-net
// Get all the moderation configs for all the teams
await client.Moderation.QueryModerationConfigsAsync(new QueryModerationConfigsRequest
{
Limit = 2,
});
// Get all the moderation configs for the team `team-a`
await client.Moderation.QueryModerationConfigsAsync(new QueryModerationConfigsRequest
{
Filter = new Dictionary<string, object> { { "team", "team-a" } },
Sort = new List<SortParam>
{
new SortParam { Field = "created_at", Direction = -1 },
},
Limit = 2,
});Using Client side integration
Client-side queries are restricted to the team context of the authenticated user:
// https://github.com/GetStream/stream-node
// Get all the moderation configs for the team that the user belongs to
const { configs, next } = await client.moderation.queryModerationConfigs({
limit: 2,
});# https://github.com/GetStream/stream-py
# Get all the moderation configs for the team that the user belongs to
client.moderation().query_moderation_configs(limit=2)// https://github.com/GetStream/getstream-go
// Get all the moderation configs for the team that the user belongs to
client.Moderation().QueryModerationConfigs(ctx, &getstream.QueryModerationConfigsRequest{
Limit: getstream.PtrTo(2),
})// https://github.com/GetStream/stream-sdk-java
// Get all the moderation configs for the team that the user belongs to
client.moderation().queryModerationConfigs(QueryModerationConfigsRequest.builder()
.limit(2)
.build())
.execute();// https://github.com/GetStream/getstream-php
// Get all the moderation configs for the team that the user belongs to
$client->moderation()->queryModerationConfigs(new QueryModerationConfigsRequest(
limit: 2,
));# https://github.com/GetStream/getstream-ruby
# Get all the moderation configs for the team that the user belongs to
client.moderation.query_moderation_configs(GetStream::Generated::Models::QueryModerationConfigsRequest.new(
limit: 2,
))// https://github.com/GetStream/getstream-net
// Get all the moderation configs for the team that the user belongs to
await client.Moderation.QueryModerationConfigsAsync(new QueryModerationConfigsRequest
{
Limit = 2,
});Query Review Queue
The review queue is a crucial component of the moderation system that allows teams to:
- Review flagged content
- Take action on moderated messages
- Track moderation history
- Maintain audit trails
You can query the review queue at the team level to using QueryReviewQueue API.
Server Side Integration
Server-side access provides complete control over the review queue:
// https://github.com/GetStream/stream-node
// Get all the review queue for all the teams
const { reviews, next } = await client.moderation.queryReviewQueue({
limit: 2,
});
// Get all the review queue for the team `team-a`
const { reviews, next } = await client.moderation.queryReviewQueue({
filter: { teams: "team-a" },
sort: [{ field: "created_at", direction: -1 }],
limit: 2,
});
// Get all the review queue for the team `team-a` and `team-b`
const { reviews, next } = await client.moderation.queryReviewQueue({
filter: { teams: { $in: ["team-a", "team-b"] } },
sort: [{ field: "created_at", direction: -1 }],
limit: 2,
});# https://github.com/GetStream/stream-py
# Get all the review queue for all the teams
client.moderation().query_review_queue(limit=2)
# Get all the review queue for the team `team-a`
client.moderation().query_review_queue(
filter={"teams": "team-a"},
sort=[{"field": "created_at", "direction": -1}],
limit=2,
)
# Get all the review queue for the team `team-a` and `team-b`
client.moderation().query_review_queue(
filter={"teams": {"$in": ["team-a", "team-b"]}},
sort=[{"field": "created_at", "direction": -1}],
limit=2,
)// https://github.com/GetStream/getstream-go
// Get all the review queue for all the teams
client.Moderation().QueryReviewQueue(ctx, &getstream.QueryReviewQueueRequest{
Limit: getstream.PtrTo(2),
})
// Get all the review queue for the team `team-a`
client.Moderation().QueryReviewQueue(ctx, &getstream.QueryReviewQueueRequest{
Filter: map[string]interface{}{"teams": "team-a"},
Sort: []getstream.SortParam{{Field: "created_at", Direction: getstream.PtrTo(-1)}},
Limit: getstream.PtrTo(2),
})
// Get all the review queue for the team `team-a` and `team-b`
client.Moderation().QueryReviewQueue(ctx, &getstream.QueryReviewQueueRequest{
Filter: map[string]interface{}{"teams": map[string]interface{}{"$in": []string{"team-a", "team-b"}}},
Sort: []getstream.SortParam{{Field: "created_at", Direction: getstream.PtrTo(-1)}},
Limit: getstream.PtrTo(2),
})// https://github.com/GetStream/stream-sdk-java
// Get all the review queue for all the teams
client.moderation().queryReviewQueue(QueryReviewQueueRequest.builder()
.limit(2)
.build())
.execute();
// Get all the review queue for the team `team-a`
client.moderation().queryReviewQueue(QueryReviewQueueRequest.builder()
.filter(Map.of("teams", "team-a"))
.sort(List.of(SortParam.builder().field("created_at").direction(-1).build()))
.limit(2)
.build())
.execute();
// Get all the review queue for the team `team-a` and `team-b`
client.moderation().queryReviewQueue(QueryReviewQueueRequest.builder()
.filter(Map.of("teams", Map.of("$in", List.of("team-a", "team-b"))))
.sort(List.of(SortParam.builder().field("created_at").direction(-1).build()))
.limit(2)
.build())
.execute();// https://github.com/GetStream/getstream-php
// Get all the review queue for all the teams
$client->moderation()->queryReviewQueue(new QueryReviewQueueRequest(
limit: 2,
));
// Get all the review queue for the team `team-a`
$client->moderation()->queryReviewQueue(new QueryReviewQueueRequest(
filter: ['teams' => 'team-a'],
sort: [new SortParam(field: 'created_at', direction: -1)],
limit: 2,
));
// Get all the review queue for the team `team-a` and `team-b`
$client->moderation()->queryReviewQueue(new QueryReviewQueueRequest(
filter: ['teams' => ['$in' => ['team-a', 'team-b']]],
sort: [new SortParam(field: 'created_at', direction: -1)],
limit: 2,
));# https://github.com/GetStream/getstream-ruby
# Get all the review queue for all the teams
client.moderation.query_review_queue(GetStream::Generated::Models::QueryReviewQueueRequest.new(
limit: 2,
))
# Get all the review queue for the team `team-a`
client.moderation.query_review_queue(GetStream::Generated::Models::QueryReviewQueueRequest.new(
filter: { "teams" => "team-a" },
sort: [GetStream::Generated::Models::SortParam.new(field: "created_at", direction: -1)],
limit: 2,
))
# Get all the review queue for the team `team-a` and `team-b`
client.moderation.query_review_queue(GetStream::Generated::Models::QueryReviewQueueRequest.new(
filter: { "teams" => { "$in" => ["team-a", "team-b"] } },
sort: [GetStream::Generated::Models::SortParam.new(field: "created_at", direction: -1)],
limit: 2,
))// https://github.com/GetStream/getstream-net
// Get all the review queue for all the teams
await client.Moderation.QueryReviewQueueAsync(new QueryReviewQueueRequest
{
Limit = 2,
});
// Get all the review queue for the team `team-a`
await client.Moderation.QueryReviewQueueAsync(new QueryReviewQueueRequest
{
Filter = new Dictionary<string, object> { { "teams", "team-a" } },
Sort = new List<SortParam>
{
new SortParam { Field = "created_at", Direction = -1 },
},
Limit = 2,
});
// Get all the review queue for the team `team-a` and `team-b`
await client.Moderation.QueryReviewQueueAsync(new QueryReviewQueueRequest
{
Filter = new Dictionary<string, object>
{
{ "teams", new Dictionary<string, object> { { "$in", new[] { "team-a", "team-b" } } } },
},
Sort = new List<SortParam>
{
new SortParam { Field = "created_at", Direction = -1 },
},
Limit = 2,
});Client Side Integration
The client-side review queue access enables building custom moderation dashboards:
// https://github.com/GetStream/stream-node
// Get all the review queue for all the teams that the user belongs to.
const { reviews, next } = await client.moderation.queryReviewQueue({
limit: 2,
});
// Get all the review queue for the team `team-a`
// This will return all the review queue for the team `team-a`, only if the user belongs to `team-a`
const { reviews, next } = await client.moderation.queryReviewQueue({
filter: { team: "team-a" },
sort: [{ field: "created_at", direction: -1 }],
limit: 2,
});# https://github.com/GetStream/stream-py
# Get all the review queue for all the teams that the user belongs to.
client.moderation().query_review_queue(limit=2)
# Get all the review queue for the team `team-a`
client.moderation().query_review_queue(
filter={"team": "team-a"},
sort=[{"field": "created_at", "direction": -1}],
limit=2,
)// https://github.com/GetStream/getstream-go
// Get all the review queue for all the teams that the user belongs to.
client.Moderation().QueryReviewQueue(ctx, &getstream.QueryReviewQueueRequest{
Limit: getstream.PtrTo(2),
})
// Get all the review queue for the team `team-a`
client.Moderation().QueryReviewQueue(ctx, &getstream.QueryReviewQueueRequest{
Filter: map[string]interface{}{"team": "team-a"},
Sort: []getstream.SortParam{{Field: "created_at", Direction: getstream.PtrTo(-1)}},
Limit: getstream.PtrTo(2),
})// https://github.com/GetStream/stream-sdk-java
// Get all the review queue for all the teams that the user belongs to.
client.moderation().queryReviewQueue(QueryReviewQueueRequest.builder()
.limit(2)
.build())
.execute();
// Get all the review queue for the team `team-a`
client.moderation().queryReviewQueue(QueryReviewQueueRequest.builder()
.filter(Map.of("team", "team-a"))
.sort(List.of(SortParam.builder().field("created_at").direction(-1).build()))
.limit(2)
.build())
.execute();// https://github.com/GetStream/getstream-php
// Get all the review queue for all the teams that the user belongs to.
$client->moderation()->queryReviewQueue(new QueryReviewQueueRequest(
limit: 2,
));
// Get all the review queue for the team `team-a`
$client->moderation()->queryReviewQueue(new QueryReviewQueueRequest(
filter: ['team' => 'team-a'],
sort: [new SortParam(field: 'created_at', direction: -1)],
limit: 2,
));# https://github.com/GetStream/getstream-ruby
# Get all the review queue for all the teams that the user belongs to.
client.moderation.query_review_queue(GetStream::Generated::Models::QueryReviewQueueRequest.new(
limit: 2,
))
# Get all the review queue for the team `team-a`
client.moderation.query_review_queue(GetStream::Generated::Models::QueryReviewQueueRequest.new(
filter: { "team" => "team-a" },
sort: [GetStream::Generated::Models::SortParam.new(field: "created_at", direction: -1)],
limit: 2,
))// https://github.com/GetStream/getstream-net
// Get all the review queue for all the teams that the user belongs to.
await client.Moderation.QueryReviewQueueAsync(new QueryReviewQueueRequest
{
Limit = 2,
});
// Get all the review queue for the team `team-a`
await client.Moderation.QueryReviewQueueAsync(new QueryReviewQueueRequest
{
Filter = new Dictionary<string, object> { { "team", "team-a" } },
Sort = new List<SortParam>
{
new SortParam { Field = "created_at", Direction = -1 },
},
Limit = 2,
});Team level blocklists
Team level blocklists gives your customers the ability to manage blocklists for their team. These blocklists can be used in moderation policies to flag or remove messages that contain specific words or phrases.
CRUD APIs to maintain team level blocklists are accessible on client side integration. This means that you can build a custom moderation dashboard for your teams to maintain the blocklists. Its important to note that team level blocklists can only be created/updated/deleted by team admins and moderators who have the following permissions:
CreateBlockListUpdateBlockListReadBlockListsDeleteBlockList
Limitations
- Maximum 4 blocklists per team
- Maximum 20,000 blocklists per app (including global blocklists)
- Maximum 200,000 words in total across all blocklists of an app
Create a Team Level Blocklist
You can create a blocklist specific to a team using the following code:
// https://github.com/GetStream/stream-node
await client.createBlockList({
name: "myblocklist",
team: "team-a",
words: ["bad-word-1", "bad-word-2"],
type: "word",
});# https://github.com/GetStream/stream-py
client.create_block_list(
name="myblocklist",
team="team-a",
words=["bad-word-1", "bad-word-2"],
type="word",
)// https://github.com/GetStream/getstream-go
client.CreateBlockList(ctx, &getstream.CreateBlockListRequest{
Name: "myblocklist",
Team: getstream.PtrTo("team-a"),
Words: []string{"bad-word-1", "bad-word-2"},
Type: "word",
})// https://github.com/GetStream/stream-sdk-java
client.createBlockList(CreateBlockListRequest.builder()
.name("myblocklist")
.team("team-a")
.words(List.of("bad-word-1", "bad-word-2"))
.type("word")
.build())
.execute();// https://github.com/GetStream/getstream-php
$client->createBlockList(new CreateBlockListRequest(
name: 'myblocklist',
team: 'team-a',
words: ['bad-word-1', 'bad-word-2'],
type: 'word',
));# https://github.com/GetStream/getstream-ruby
client.create_block_list(GetStream::Generated::Models::CreateBlockListRequest.new(
name: "myblocklist",
team: "team-a",
words: ["bad-word-1", "bad-word-2"],
type: "word",
))// https://github.com/GetStream/getstream-net
await client.CreateBlockListAsync(new CreateBlockListRequest
{
Name = "myblocklist",
Team = "team-a",
Words = new List<string> { "bad-word-1", "bad-word-2" },
Type = "word",
});Update a Team Level Blocklist
To update an existing team blocklist:
// https://github.com/GetStream/stream-node
await client.updateBlockList("myblocklist", {
words: ["test3", "test4"],
team: "team-a",
});# https://github.com/GetStream/stream-py
client.update_block_list("myblocklist",
words=["test3", "test4"],
team="team-a",
)// https://github.com/GetStream/getstream-go
client.UpdateBlockList(ctx, "myblocklist", &getstream.UpdateBlockListRequest{
Words: []string{"test3", "test4"},
Team: getstream.PtrTo("team-a"),
})// https://github.com/GetStream/stream-sdk-java
client.updateBlockList("myblocklist", UpdateBlockListRequest.builder()
.words(List.of("test3", "test4"))
.team("team-a")
.build())
.execute();// https://github.com/GetStream/getstream-php
$client->updateBlockList('myblocklist', new UpdateBlockListRequest(
words: ['test3', 'test4'],
team: 'team-a',
));# https://github.com/GetStream/getstream-ruby
client.update_block_list("myblocklist", GetStream::Generated::Models::UpdateBlockListRequest.new(
words: ["test3", "test4"],
team: "team-a",
))// https://github.com/GetStream/getstream-net
await client.UpdateBlockListAsync("myblocklist", new UpdateBlockListRequest
{
Words = new List<string> { "test3", "test4" },
Team = "team-a",
});Delete a Team Level Blocklist
To delete a team blocklist:
// https://github.com/GetStream/stream-node
await client.deleteBlockList("myblocklist", {
team: "team-a",
});# https://github.com/GetStream/stream-py
client.delete_block_list("myblocklist", team="team-a")// https://github.com/GetStream/getstream-go
client.DeleteBlockList(ctx, "myblocklist", &getstream.DeleteBlockListRequest{
Team: getstream.PtrTo("team-a"),
})// https://github.com/GetStream/stream-sdk-java
client.deleteBlockList("myblocklist", DeleteBlockListRequest.builder()
.team("team-a")
.build())
.execute();// https://github.com/GetStream/getstream-php
$client->deleteBlockList('myblocklist', new DeleteBlockListRequest(
team: 'team-a',
));# https://github.com/GetStream/getstream-ruby
client.delete_block_list("myblocklist", GetStream::Generated::Models::DeleteBlockListRequest.new(
team: "team-a",
))// https://github.com/GetStream/getstream-net
await client.DeleteBlockListAsync("myblocklist", new DeleteBlockListRequest
{
Team = "team-a",
});List Blocklists
You can list both global and team-specific blocklists:
// https://github.com/GetStream/stream-node
// List global blocklists
const globalBlocklists = await client.listBlocklists();
// List team specific blocklists
const teamBlocklists = await client.listBlocklists({ team: "team-a" });# https://github.com/GetStream/stream-py
# List global blocklists
client.list_blocklists()
# List team specific blocklists
client.list_blocklists(team="team-a")// https://github.com/GetStream/getstream-go
// List global blocklists
client.ListBlocklists(ctx, &getstream.ListBlocklistsRequest{})
// List team specific blocklists
client.ListBlocklists(ctx, &getstream.ListBlocklistsRequest{
Team: getstream.PtrTo("team-a"),
})// https://github.com/GetStream/stream-sdk-java
// List global blocklists
client.listBlocklists().execute();
// List team specific blocklists
client.listBlocklists(ListBlocklistsRequest.builder()
.team("team-a")
.build())
.execute();// https://github.com/GetStream/getstream-php
// List global blocklists
$client->listBlocklists();
// List team specific blocklists
$client->listBlocklists(new ListBlocklistsRequest(team: 'team-a'));# https://github.com/GetStream/getstream-ruby
# List global blocklists
client.list_blocklists
# List team specific blocklists
client.list_blocklists(GetStream::Generated::Models::ListBlocklistsRequest.new(team: "team-a"))// https://github.com/GetStream/getstream-net
// List global blocklists
await client.ListBlocklistsAsync();
// List team specific blocklists
await client.ListBlocklistsAsync(new ListBlocklistsRequest
{
Team = "team-a",
});Using Blocklists in Team Level Moderation Configuration
You can use both global and team level blocklists in your team's moderation configuration:
// https://github.com/GetStream/stream-node
await client.moderation.upsertConfig({
key: "chat:messaging",
team: "team-a",
blocklist_config: {
rules: [
// team level blocklist
{
name: "my_team_blocklist",
team: "team-a",
action: "remove",
},
// global blocklist
{
name: "my_global_blocklist",
action: "flag",
},
],
},
});# https://github.com/GetStream/stream-py
client.moderation().upsert_config(
key="chat:messaging",
team="team-a",
blocklist_config={
"rules": [
# team level blocklist
{"name": "my_team_blocklist", "team": "team-a", "action": "remove"},
# global blocklist
{"name": "my_global_blocklist", "action": "flag"},
],
},
)// https://github.com/GetStream/getstream-go
client.Moderation().UpsertConfig(ctx, &getstream.UpsertConfigRequest{
Key: "chat:messaging",
Team: getstream.PtrTo("team-a"),
BlocklistConfig: &getstream.BlocklistConfig{
Rules: []getstream.BlocklistRule{
// team level blocklist
{Name: "my_team_blocklist", Team: getstream.PtrTo("team-a"), Action: "remove"},
// global blocklist
{Name: "my_global_blocklist", Action: "flag"},
},
},
})// https://github.com/GetStream/stream-sdk-java
client.moderation().upsertConfig(UpsertConfigRequest.builder()
.key("chat:messaging")
.team("team-a")
.blocklistConfig(BlocklistConfig.builder()
.rules(List.of(
// team level blocklist
BlocklistRule.builder().name("my_team_blocklist").team("team-a").action("remove").build(),
// global blocklist
BlocklistRule.builder().name("my_global_blocklist").action("flag").build()))
.build())
.build())
.execute();// https://github.com/GetStream/getstream-php
$client->moderation()->upsertConfig(new UpsertConfigRequest(
key: 'chat:messaging',
team: 'team-a',
blocklistConfig: new BlocklistConfig(
rules: [
// team level blocklist
new BlocklistRule(name: 'my_team_blocklist', team: 'team-a', action: 'remove'),
// global blocklist
new BlocklistRule(name: 'my_global_blocklist', action: 'flag'),
],
),
));# https://github.com/GetStream/getstream-ruby
client.moderation.upsert_config(GetStream::Generated::Models::UpsertConfigRequest.new(
key: "chat:messaging",
team: "team-a",
blocklist_config: GetStream::Generated::Models::BlocklistConfig.new(
rules: [
# team level blocklist
GetStream::Generated::Models::BlocklistRule.new(name: "my_team_blocklist", team: "team-a", action: "remove"),
# global blocklist
GetStream::Generated::Models::BlocklistRule.new(name: "my_global_blocklist", action: "flag"),
],
),
))// https://github.com/GetStream/getstream-net
await client.Moderation.UpsertConfigAsync(new UpsertConfigRequest
{
Key = "chat:messaging",
Team = "team-a",
BlocklistConfig = new BlocklistConfig
{
Rules = new List<BlocklistRule>
{
// team level blocklist
new BlocklistRule { Name = "my_team_blocklist", Team = "team-a", Action = "remove" },
// global blocklist
new BlocklistRule { Name = "my_global_blocklist", Action = "flag" },
},
},
});Dashboard Support for Multitenancy Moderation
You can manage team level moderation policies and blocklists from the dashboard as following.
Create Team Level Moderation Policy
You can create a team level moderation policy from the dashboard as following:
- Navigate to "Policies" page in left sidebar
- Click on "+ Add New" button, which will open a modal to create a new moderation policy
- Select "Chat" as product
- On this modal, you will see an input field to assign a team to the policy

Once you press "Save" button, the policy will be created for the team you selected.
In the policies list, you will see a team column which will show the team to which the policy belongs.

Team Level Blocklists
You can create a team blocklist from the dashboard as following:
- Navigate to "Policies" page in left sidebar
- Select a team policy (or team level moderation configuration) where you want to add the blocklist
- Scroll down to "Blocklists & Regex Filters" section
- Click on "+ Add New" button, which will open a modal to create a new blocklist
- On this modal, you will see a checkbox to mark this blocklist as team level blocklist

The team blocklists will be shown in the moderation policy as following:
