Added in 25.03.
Flood limits (also known as Activity limits in UI) are limitations set in your community on the actions members can perform, such as content posting, private messages, image uploading, etc.
With flood limits, you can control rapid actions in the community to control spam. For example, admins can enable members to post only 2 posts in 10 minutes.
Note: Only Admins and Moderators can set the flood limit at the community level.
Use the setDefaultFloodLimitSettings
mutation to set the flood limit for your community.
The fields and their descriptions for the mutation are given below:
Field | Description | Required |
---|---|---|
postLimitSmallWindow | Time in milliseconds between posts for a small time window | No |
postCountSmallWindow | Number of posts allowed in postLimitSmallWindow | No |
postLimitMediumWindow | Time in milliseconds between posts for a medium time window | No |
postCountMediumWindow | Number of posts allowed in postLimitMediumWindow | No |
postLimitLargeWindow | Time in milliseconds between posts for a large time window | No |
postCountLargeWindow | Number of posts allowed in postLimitLargeWindow | No |
duplicatePostTimeWindow | Time in milliseconds between duplicate posts | No |
duplicatePostCountAllowed | Number of duplicate posts allowed in duplicatePostTimeWindow | No |
pmLimitSmallWindow | Time in milliseconds between private messages for a small time window | No |
pmCountSmallWindow | Number of private messages allowed in pmLimitSmallWindow | No |
pmLimitMediumWindow | Time in milliseconds between private messages for a medium time window | No |
pmCountMediumWindow | Number of private messages allowed in pmLimitMediumWindow | No |
pmLimitLargeWindow | Time in milliseconds between private messages for a large time window | No |
pmCountLargeWindow | Number of private messages allowed in pmLimitLargeWindow | No |
maxUploadsImagesPerDay | The maximum uploaded images allowed per day. | No |
Example
Here is the sample request to set flood limits for your community.
mutation{
setDefaultFloodLimitSettings(
settingsInput:{
duplicatePostTimeWindow: 10000,
duplicatePostCountAllowed: 10,
postLimitSmallWindow: 10000,
postLimitLargeWindow: 30000,
postLimitMediumWindow: 20000,
postCountSmallWindow: 2,
postCountLargeWindow: 5,
postCountMediumWindow: 4,
pmLimitSmallWindow: 10000,
pmLimitLargeWindow: 30000,
pmLimitMediumWindow: 20000,
pmCountSmallWindow: 2,
pmCountLargeWindow: 5,
pmCountMediumWindow: 4,
maxUploadedImagesPerDay: 30
}
) {
result
errors{
__typename
...on ValidationError {
message
}
}
}
}
The GraphQL response:
{
"data": {
"setDefaultFloodLimitSettings": {
"result": true,
"errors": null
}
}
}
Creating a Role-based Override
Note: Only Admins and Moderators can set the flood limit for certain roles.
A flood limit setting is not allowed for group hub roles.
Use the setRoleBasedFloodLimitSettings
mutation to set the flood limit for certain roles.
You can specify roles from your community and set different activity limits. This helps you manage user engagement by applying stricter limits to new members until they earn a certain role or rank. The limits defined using the mutation override the default limits for members with these roles.
Field | Description | Required |
---|---|---|
roles | The role for which you want to set the flood limit. | Yes |
postLimitSmallWindow | Time in milliseconds between posts for a small time window | No |
postCountSmallWindow | Number of posts allowed in postLimitSmallWindow | No |
postLimitMediumWindow | Time in milliseconds between posts for a medium time window | No |
postCountMediumWindow | Number of posts allowed in postLimitMediumWindow | No |
postLimitLargeWindow | Time in milliseconds between posts for a large time window | No |
postCountLargeWindow | Number of posts allowed in postLimitLargeWindow | No |
duplicatePostTimeWindow | Time in milliseconds between duplicate posts | No |
duplicatePostCountAllowed | Number of duplicate posts allowed in duplicatePostTimeWindow | No |
pmLimitSmallWindow | Time in milliseconds between private messages for a small time window | No |
pmCountSmallWindow | Number of private messages allowed in pmLimitSmallWindow | No |
pmLimitMediumWindow | Time in milliseconds between private messages for a medium time window | No |
pmCountMediumWindow | Number of private messages allowed in pmLimitMediumWindow | No |
pmLimitLargeWindow | Time in milliseconds between private messages for a large time window | No |
pmCountLargeWindow | Number of private messages allowed in pmLimitLargeWindow | No |
maxUploadsImagesPerDay | The maximum uploaded images allowed per day. | No |
Example
Here is an example of setting the flood limits for the BlogAuthor role.
mutation{
setRoleBasedFloodLimitSettings(
settingsInput:{
roles:["NewUsers"],
duplicatePostTimeWindow: 5000,
duplicatePostCountAllowed: 10,
postLimitSmallWindow: 5000,
postLimitLargeWindow: 15000,
postLimitMediumWindow: 10000,
postCountSmallWindow: 2,
postCountLargeWindow: 5,
postCountMediumWindow: 4,
pmLimitSmallWindow: 5000,
pmLimitLargeWindow: 15000,
pmLimitMediumWindow: 10000,
pmCountSmallWindow: 2,
pmCountLargeWindow: 5,
pmCountMediumWindow: 4,
maxUploadedImagesPerDay: 20
}
) {
result
errors{
__typename
...on ValidationError {
message
}
}
}
}
The GraphQL response:
{
"data": {
"setRoleBasedFloodLimitSettings": {
"result": true,
"errors": null
}
}
}
Retrieve the Default Flood Limit Settings
Use the query below to retrieve your community's default flood limit settings.
{
community(id:"Community:DocsCommunity") {
defaultFloodLimitSettings {
postLimitSmallWindow {
key
value
}
postLimitMediumWindow {
key
value
}
postLimitLargeWindow {
key
value
}
pmLimitSmallWindow {
key
value
}
pmLimitMediumWindow {
key
value
}
pmLimitLargeWindow {
key
value
}
pmCountSmallWindow {
key
value
}
pmCountMediumWindow {
key
value
}
pmCountLargeWindow {
key
value
}
postCountSmallWindow {
key
value
}
postCountMediumWindow {
key
value
}
postCountLargeWindow {
key
value
}
duplicatePostTimeWindow{
key
value
}
duplicatePostCountAllowed{
key
value
}
}
}
}
The GraphQL response:
{
"data": {
"community": {
"defaultFloodLimitSettings": {
"postLimitSmallWindow": {
"key": "config.flood_user_small_window",
"value": 10000
},
"postLimitMediumWindow": {
"key": "config.flood_user_medium_window",
"value": 20000
},
"postLimitLargeWindow": {
"key": "config.flood_user_large_window",
"value": 30000
},
"pmLimitSmallWindow": {
"key": "rate.limit.send_private_message.1.time",
"value": 10000
},
"pmLimitMediumWindow": {
"key": "rate.limit.send_private_message.2.time",
"value": 20000
},
"pmLimitLargeWindow": {
"key": "rate.limit.send_private_message.3.time",
"value": 30000
},
"pmCountSmallWindow": {
"key": "rate.limit.send_private_message.1.count",
"value": 2
},
"pmCountMediumWindow": {
"key": "rate.limit.send_private_message.2.count",
"value": 4
},
"pmCountLargeWindow": {
"key": "rate.limit.send_private_message.3.count",
"value": 5
},
"postCountSmallWindow": {
"key": "config.flood_user_small_count",
"value": 2
},
"postCountMediumWindow": {
"key": "config.flood_user_medium_count",
"value": 4
},
"postCountLargeWindow": {
"key": "config.flood_user_large_count",
"value":
ATLAS
Comments