Documentation
Server_APIs_v2 Server APIs v2
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • Server APIs v2
  • Streaming moderation
  • Start moderating audio streams

Start moderating audio streams

Last updated:2025-07-10 10:38

1 Description

Audio stream moderation is an interactive extension service of ZEGOCLOUD's real-time audio and video products. Through the audio stream moderation interface, developers can call real-time audio moderation, including audio semantic recognition and audio feature (pitch, timbre, voiceprint, melody, etc.) recognition. ZEGOCLOUD will send the recognition results to developers through Callback on moderated audio streams or configured custom callback addresses. The Start moderating audio streams feature should be used in conjunction with Stop moderating audio streams.

Before using this method for the first time, you need to contact ZEGOCLOUD technical support to activate it.

2 Request method and endpoint

  • Request method: POST

    When using POST request method to pass parameters:

    • Parameters in the Body can be passed directly in JsonObject format without serializing to String format.
    • In Headers, set "Content-type" to "application/json".
  • Request endpoint: https://rtc-api.zego.im/?Action=StartCensorAudioV2

  • Protocol: HTTPS

  • Rate limit (all rooms with the same AppID): 100 requests/second

  • 3 Request parameters

    Listed below are the parameters specific to this request and part of the public request parameters. For the complete list of public request parameters, see Server APIs public request parameters.

    Parameter Type Required Description
    RoomId
    String
    Yes
    The room ID that needs audio moderation.
    By default, all streams in the room will be submitted for moderation. If there are streams in the room that do not need moderation (such as streams from trusted users), please set ZegoPulisherConfig.streamCensorshipFlag to disallow moderation when calling the client SDK startPublishingStream.
    EventId
    String
    Yes
    Scene identifier.
    This parameter identifies the scene corresponding to the audio stream. The moderation strategy can be adjusted according to the scene to achieve control of different scene moderation standards.

    • Live Broadcasting: live_streaming
    • Audio Chat Room: audio_room
    • 1v1: private_chat
    If the above optional values cannot fully meet your usage requirements, please contact ZEGOCLOUD technical support.
    ResultCallbackUrl
    String
    No
    Custom callback address for moderation results.
    If you need to send the moderation results of this moderation task through another callback address, you can achieve this through this parameter. If not needed, please contact ZEGOCLOUD technical support for processing.
    StatusCallbackUrl
    String
    No
    Custom callback address for moderation status.
    If you need to send the moderation status of this moderation task through another callback address, you can achieve this through this parameter. If not needed, please contact ZEGOCLOUD technical support for processing.
    IsMixingEnabled
    Int32
    No
    Whether to submit for moderation through stream mixing.

    • 0: Default value, no stream mixing moderation, i.e., single stream moderation. Each audio stream in the room is moderated independently.
    • 1: Stream mixing moderation, all audio streams in the room are mixed into one stream.
    Stream mixing moderation can save audio moderation costs, but correspondingly makes it more difficult to accurately identify violating streams and users. Please choose the appropriate moderation method based on your business needs.
    AudioLanguage
    String
    Yes
    Audio stream language.
    When semantic recognition of audio streams is needed, please input this value accurately. If the following languages cannot meet your needs, please contact technical support for configuration.
    zh: Chinese, ja: Japanese, ko: Korean, th: Thai
    vi: Vietnamese, ms: Malay, tl: Filipino, id: Indonesian
    hi: Hindi, ar: Arabic, tr: Turkish, en: English
    es: Spanish, pt: Portuguese, it: Italian, fr: French
    de: German, ru: Russian
    RiskTypeList
    Array of String
    No
    Risk type list.
    At least one of RiskTypeList and BusinessTypeList must not be empty. The following values can be added to the array:

    • Audio Semantics:
      • EROTIC: Pornography
      • DIRTY: Abuse
      • POLITY: Political
      • BAN: Prohibited
      • VIOLENT: Violence and terrorism
      • ADVERT: Advertisement
    • Audio Features:
      • MOAN: Moan
      • AUDIOPOLITICAL: Leader voiceprint recognition
      • ANTHEN: National anthem recognition
      • BANDAUDIO: Prohibited songs
    BusinessTypeList
    Array of String
    No
    Business recognition categories.
    At least one of RiskTypeList and BusinessTypeList must not be empty. The following values can be added to the array:

    • Audio Semantics:
      • MOINIR: Minor
    • Audio Features:
      • SING: Singing
      • LANGUAGE: Language recognition
      • VOICE: Voice attribute recognition

    Audio stream recognition is not limited to violation content, it can also assist developers in business operations. If the above optional values cannot meet your business needs, please contact ZEGOCLOUD technical support.

    LabelLanguage
    String
    Yes
    Language type of labels in callback information (Label related).

    • zh: Chinese
    • en: English
    ReturnAllText
    Int32
    No
    Whether to return all text for the current 10s segment.
    The risk levels of moderation results will be classified into three categories:
    PASS: Normal content, recommended to pass directly.
    REVIEW: Suspicious content, recommended for manual review.
    REJECT: Violating content, recommended to block directly.

    • 0: Return audio segment text with non-pass risk level (default value).
    • 1: Return audio text segments of all risk levels.
    ReturnPreAudio
    Int32
    No
    Whether to return the audio segment link before the violating segment.

    • 0: Do not return the audio segment link before the violating segment, only return the violating segment audio link. (Default value)
    • 1: Return the audio segment link before the violating segment.
    ReturnFinishInfo
    Int32
    No
    Whether to perform "moderation task status" callback when the moderation task ends.

    • 0: Do not send end notification when moderation ends.
    • 1: Initiate end notification when moderation ends.

    4 Sample request

    • Request URL
      https://rtc-api.zego.im/?Action=StartCensorAudioV2
      &<Common request parameters>
    • Request body
      {
          "RoomId": "room_1",
          "IsMixingEnabled": 0,
          "EventId": "live_streaming",
          "RiskTypeList": [
              "ADLAW",
              "ADVERT",
              "AUDIOPOLITICAL",
              "BAN",
              "DIRTY",
              "EROTIC",
              "MOAN",
              "POLITY",
              "VIOLENT"
          ],
          "AudioLanguage": "zh",
          "LabelLanguage": "zh",
          "ReturnAllText": 1,
          "ReturnPreText": 1,
          "ReturnPreAudio": 1,
          "ReturnFinishInfo": 1,
          "ResultCallbackUrl": "",
          "StatusCallbackUrl": ""
      }

    5 Response parameters

    Parameter Type Description
    Code
    Int32
    Return code.

    • 50006, 50007: HTTP request failed, please try again later (recommended 300s). If it still fails, please contact ZEGOCLOUD technical support.
    • 50009: Moderation failed, please try again later (recommended 300s), or contact ZEGOCLOUD technical support.
    • 50117: Configuration error, Shumei audio stream moderation permission not enabled, please contact ZEGOCLOUD technical support.
    Message
    String
    Operation result description.
    RequestId
    String
    Request ID.
    Data
    Object
    Response data.
    TaskId
    String
    Moderation task ID, used to end the moderation task.

    6 Sample response

    {
        "Code":0,
        "Message":"success",
        "RequestId":"TestRequestId1635941437248027000",
        "Data":{
                  "TaskId":"15515d8fef61801b05c22e0ebbe8681f"
               }
    }

    7 Return codes

    Listed below are the return codes related to this API. For the complete list of return codes, see Return codes.

    Return Code Description Handling Suggestion
    50006, 50007 HTTP request failed. Please try again later (recommended 300s), or contact ZEGOCLOUD technical support.
    50009 Moderation failed. Please try again later (recommended 300s), or contact ZEGOCLOUD technical support.
    50117 Configuration error, Shumei permission not enabled. Please contact ZEGOCLOUD technical support.
    Page Directory
    • Free trial
    • 提交工单
      咨询集成、功能及报价等问题
      电话咨询
      400 1006 604
      Get Consulting
      Scan Wechat QR code