Actions

Submit Action

This is the most important endpoint in the moderation API. It allows moderators to take action on review queue items. Actions include deleting content, banning users, marking items as reviewed, restoring deleted content, and more.

POST /api/v2/moderation/submit_action

client.moderation.submit_action(GetStream::Generated::Models::SubmitActionRequest.new(
  action_type: "mark_reviewed",
  item_id: "review_queue_item_id",
  user_id: moderator_id
))

Request Parameters

KeyRequiredTypeDescription
action_typetruestringThe action to take. See supported action types below.
item_idfalsestringReview queue item ID. Required for most actions.
user_idfalsestringUser ID of the moderator performing the action.
banfalseobjectBan-specific parameters (used with ban action type).
unbanfalseobjectUnban-specific parameters (used with unban action type).
delete_messagefalseobjectDelete message parameters.
delete_activityfalseobjectDelete activity parameters.
restorefalseobjectRestore parameters (used with restore action type).
unblockfalseobjectUnblock parameters (used with unblock action type).
customfalseobjectCustom action parameters (used with custom action type).
reject_appealfalseobjectReject appeal parameters.
appeal_idfalsestringAppeal ID (for appeal-related actions).
decision_reasonfalsestringReason for the decision (shown to users for appeal decisions).

Response

KeyTypeDescription
itemobjectThe updated review queue item.

Supported Action Types

Action TypeDescription
mark_reviewedMark the item as reviewed without taking further action (content is safe).
delete_messageDelete a flagged chat message.
delete_activityDelete a flagged activity (feeds).
banBan the content creator. Supports channel-scoped, shadow, IP, and temporary bans.
unbanUnban a previously banned user. Also accepts appeals automatically.
restoreRestore previously deleted content. Also accepts appeals automatically.
unblockUnblock previously blocked content. Also accepts appeals automatically.
escalateEscalate the item for higher-level review.
de_escalateDe-escalate a previously escalated item.
shadow_blockShadow-block content (hidden from others but visible to the creator).
end_callEnd an active video call.
reject_appealReject a user's appeal against a moderation decision.
customTrigger a custom action (sends a webhook to your server).

Delete Message

Delete a flagged chat message from the review queue.

client.moderation.submit_action(GetStream::Generated::Models::SubmitActionRequest.new(
  action_type: "delete_message",
  item_id: "review_queue_item_id",
  user_id: moderator_id
))

Ban User

Ban the creator of flagged content. Supports channel-scoped bans, shadow bans, IP bans, and temporary bans with a timeout.

client.moderation.submit_action(GetStream::Generated::Models::SubmitActionRequest.new(
  action_type: "ban",
  item_id: "review_queue_item_id",
  ban: GetStream::Generated::Models::BanActionRequest.new(
    reason: "Repeated harassment",
    timeout: 1440,
    channel_cids: ["messaging:general"]
  ),
  user_id: moderator_id
))

Restore Content

Restore previously deleted content. This is typically used when content was incorrectly flagged or removed. If the item has an associated appeal, the appeal is automatically accepted.

client.moderation.submit_action(GetStream::Generated::Models::SubmitActionRequest.new(
  action_type: "restore",
  item_id: "review_queue_item_id",
  restore: GetStream::Generated::Models::RestoreActionRequest.new,
  decision_reason: "Content was incorrectly flagged",
  user_id: moderator_id
))

Custom Action

Trigger a custom action that sends a webhook to your server. Use this to integrate your own moderation workflows.

client.moderation.submit_action(GetStream::Generated::Models::SubmitActionRequest.new(
  action_type: "custom",
  item_id: "review_queue_item_id",
  custom: GetStream::Generated::Models::CustomActionRequest.new(
    custom_action_name: "notify_user",
    custom_data: { "notification" => "Your content has been reviewed" }
  ),
  user_id: moderator_id
))

Bulk Submit Action

Submit multiple moderation actions in a single request. This is useful for batch operations such as approving or deleting multiple flagged items at once.

POST /api/v2/moderation/bulk_submit_action

client.moderation.bulk_submit_action(
  GetStream::Generated::Models::BulkSubmitActionRequest.new(
    actions: [
      GetStream::Generated::Models::SubmitActionRequest.new(action_type: "mark_reviewed", item_id: "item_id_1", user_id: moderator_id),
      GetStream::Generated::Models::SubmitActionRequest.new(action_type: "delete_message", item_id: "item_id_2", user_id: moderator_id),
      GetStream::Generated::Models::SubmitActionRequest.new(action_type: "mark_reviewed", item_id: "item_id_3", user_id: moderator_id),
    ]
  )
)

Request Parameters

KeyRequiredTypeDescription
actionstruearrayList of action objects. Each object follows the same schema as the Submit Action request.

Response

KeyTypeDescription
resultsarrayList of results for each submitted action.

Queue Statistics

Retrieve overall queue statistics including counts of items by content type, review status, and moderation category. Useful for building dashboard views.

GET /api/v2/moderation/queue_stats

response = client.moderation.get_queue_stats

Request Parameters

This endpoint takes no parameters.

Response

KeyTypeDescription
statsobjectQueue statistics including item counts grouped by entity type, review status, and moderation category.

Moderator Statistics

Retrieve per-moderator performance statistics including the number of items reviewed, average review time, and action breakdown. Useful for tracking moderator productivity and workload distribution.

GET /api/v2/moderation/moderator_stats

response = client.moderation.get_moderator_stats

Request Parameters

This endpoint takes no parameters.

Response

KeyTypeDescription
moderatorsarrayList of moderator statistics objects, each containing the moderator's user ID, review count, average review time, and action breakdown.