Activity Feeds V3 is in closed alpha — do not use it in production (just yet).

Moderation

Stream Feeds has support for moderation, allowing you to manage user interactions, content moderation, and platform safety. It’s accessible through the client.moderation property.

Overview

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

User Moderation

Ban Users

Ban a user from the platform with various options including timeout, shadow bans, and IP bans.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Parameters:

  • targetUserId: The ID of the user to ban
  • reason: Optional reason for the ban
  • timeout: Optional timeout in seconds (null for permanent ban)
  • shadow: Whether to perform a shadow ban (user doesn’t know they’re banned)
  • ipBan: Whether to ban the user’s IP address
  • bannedBy: Optional user who performed the ban
  • deleteMessages: Whether to delete user’s messages

Mute Users

Mute one or more users to prevent them from interacting with your content.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Parameters:

  • targetIds: Array of user IDs to mute
  • timeout: Optional timeout in seconds (null for permanent mute)

Block Users

Block a user to prevent them from following you or seeing your content.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Unblock Users

Unblock a previously blocked user.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Get Blocked Users

Retrieve a list of users you have blocked.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Content Moderation

Flag Content

Flag inappropriate content for moderation review.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Parameters:

  • entityId: The ID of the content to flag
  • entityType: The type of content (e.g., “activity”, “comment”)
  • reason: Optional reason for flagging
  • entityCreatorId: Optional ID of the content creator
  • custom: Optional custom data for the flag

Submit Moderation Actions

Submit moderation actions for flagged content.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Review Queue

Query Review Queue

Retrieve items in the moderation review queue.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Configuration Management

Upsert Moderation Configuration

Create or update moderation configuration settings.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Get Moderation Configuration

Retrieve a specific moderation configuration.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Parameters:

  • key: The configuration key to retrieve
  • team: Optional team identifier

Delete Moderation Configuration

Remove a moderation configuration.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Query Moderation Configurations

Search and filter moderation configurations.

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);

Moderation Config Queryable Built-In Fields

nametypedescriptionsupported operationsexample
keystring or list of stringsThe configuration key identifier$eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $autocomplete{ key: { $autocomplete: 'spam' } }
teamstring or list of stringsThe team identifier for multi-tenant applications$eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists{ team: { $eq: 'team_123' } }
created_atstring, must be formatted as an RFC3339 timestampThe time the configuration was created$eq, $gt, $gte, $lt, $lte{ created_at: { $gte: '2023-12-04T09:30:20.45Z' } }
updated_atstring, must be formatted as an RFC3339 timestampThe time the configuration was last updated$eq, $gt, $gte, $lt, $lte{ updated_at: { $gte: '2023-12-04T09:30:20.45Z' } }

Error Handling

All moderation methods can throw errors. Handle them appropriately:

$moderationResponse = $this->feedsV3Client->activityFeedback(
    $activityId,
    new GeneratedModels\ActivityFeedbackRequest(
        report: true,
        reason: 'inappropriate_content',
        userID: $this->testUserId2 // Different user reporting
    )
);
© Getstream.io, Inc. All Rights Reserved.