Skip to main content

Moderate a Specific Contribution

This endpoint provides actions for flagged contributions moderation

info

This operation requires moderation role.

HTTP Request

PATCH /api/v2/moderation/contribution/{id}/

Parameters

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying this contribution
contribution_typebodystringtrueValid values are: post, discussion, comment
actionbodystringtrueValid values are: scold_author, scold_flagger, ignore, hide, delete
userbodyintegertrueThe user id of the contribution flagger to scold (use only with action=scold_flagger)
moderation_typebodyintegertrueAn integer value to describe the moderation activity if action is one between scold_author, hide or delete. This param is not needed if the contribute is already hidden or deleted (you are restoring)

Enumerated Values

ParameterValueDescription
moderation_type0spam
moderation_type1aggressive
moderation_type2vulgar
moderation_type3poor
moderation_type4offtopic

Actions

The following actions can be performed using this endpoint:

  • scold_author: scold the author of the post, a kindly notification will be sent to the author of the contribution with moderation_type as the cause
  • scold_flagger: scold a flagger of the post, a kindly notification will be sent to the author of the flag
  • ignore: ignore the contribute into the moderation flow (for moderators)
  • hide: hide the contribution for all community users except for the author with moderation_type as the cause
  • delete: delete the contribution for all community users with moderation_type as the cause

The following types of actions are "toggle actions" (calling the endpoint twice with the same action will cancel it): ignore, hide and delete.

Example Request

const inputBody = '{
"contribution_type": "string",
"action": "string",
"moderation_type": "string"
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Authorization': 'Bearer {access_token}'
};

fetch('/api/v2/moderation/contribution/{id}/',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
204No ContentResponse status codeNone