All Products
Search
Document Center

Intelligent Media Management:CreateVideoModerationTask

Last Updated:Jan 29, 2026

Detects threats or non-compliant content in videos. This operation can be used in scenarios such as pornography detection, terrorism and politically sensitive content detection, text and image violation detection, undesirable scene detection, and logo detection.

Operation description

  • Before you use this operation, make sure that you understand the billing methods and pricing of Intelligent Media Management.
    Important The completion time of asynchronous tasks is not guaranteed.
  • The detection results are returned in an asynchronous notification message. The Suggestion field in the asynchronous notification message can have the following values:
    • pass: The video passed the review. No non-compliant content was detected.

    • block: The video must be blocked. This value is returned when non-compliant content is detected. The Categories field indicates the category of the non-compliant content. For more information about the categories, see Content Moderation detection results.

    • review: The video requires manual review. After the manual review is complete, another asynchronous notification message is sent with the result.

  • Video snapshot requirements:
    • Video frame URLs support the HTTP and HTTPS protocols.

    • Supported video frame formats: PNG, JPG, JPEG, BMP, GIF, and WEBP.

    • The size of a video frame cannot exceed 10 MB.

    • The recommended resolution for video frames is at least 256 × 256 pixels. A lower resolution may affect detection accuracy.

    • The response time for the video detection operation depends on the download time of the video frames. Make sure that the storage service for your video frames is stable and reliable. We recommend that you use Alibaba Cloud Object Storage Service (OSS) or cache frames with Alibaba Cloud CDN.

  • This is an asynchronous operation. After a task is created, the task information is saved for only 7 days. After this period, the information cannot be retrieved. You can call the GetTask or ListTasks operation to query the task information using the returned TaskId. You can also set the Notification parameter to receive task information through asynchronous notification messages.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

imm:CreateVideoModerationTask

create

*Project

acs:imm:{#regionId}:{#accountId}:project/{#ProjectName}

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectName

string

Yes

The name of the project. For more information about how to get the project name, see Create a project.

immtest

UserData

string

No

Custom information that is returned in the asynchronous notification message. Use this information to associate the notification message with your internal system. The maximum length is 2,048 bytes.

{"ID": "user1","Name": "test-user1","Avatar": "http://example.com?id=user1"}

SourceURI

string

Yes

The OSS URI of the video.

The OSS URI must follow the format oss://${Bucket}/${Object}. ${Bucket} is the name of the OSS bucket in the same region as the project. ${Object} is the full path of the file, including the file name extension.

oss://test-bucket/test-object

Tags

object

No

Custom tags used to search for tasks.

{"test": "val1"}

CredentialConfig CredentialConfig

No

The chained authorization configuration. This parameter is optional. For more information, see Use chained authorization to access resources of other entities.

Scenes

array

No

The video detection scenarios.

string

No

The video detection scenario. Valid values:

  • porn: Pornography detection.

  • terrorism: Terrorism and politically sensitive content detection.

  • live: Undesirable scene detection.

  • logo: Logo detection.

  • ad: Text and image violation detection.

Note

If you do not specify a detection scenario, the porn, terrorism, and ad scenarios are used by default.

Valid values:

  • ad :

    Text and image violation detection

  • terrorism :

    Terrorism and politically sensitive content detection

  • logo :

    Logo detection

  • live :

    Undesirable scene detection

  • porn :

    Pornography detection

porn

Interval

integer

No

The interval for video snapshots, in seconds. The value can be an integer from 1 to 600. The default value is 1.

1

MaxFrames

integer

No

The maximum number of frames that can be captured for this detection task. The value can be an integer from 5 to 3,600. The default value is 200.

200

Notification Notification

No

The notification configuration. For the format of asynchronous notification messages, see the metadata index section in Asynchronous notification message format.

Response elements

Element

Type

Description

Example

object

The response struct.

RequestId

string

The ID of the request.

1B3D5E0A-D8B8-4DA0-8127-ED32C851****

TaskId

string

The ID of the task.

VideoModeration-9442a216-4691-4a48-846d-76daccaf*****

EventId

string

The ID of the event.

2E6-1I0FGn0zFnl5AflRfhzClma*****

Examples

Success response

JSON format

{
  "RequestId": "1B3D5E0A-D8B8-4DA0-8127-ED32C851****",
  "TaskId": "VideoModeration-9442a216-4691-4a48-846d-76daccaf*****",
  "EventId": "2E6-1I0FGn0zFnl5AflRfhzClma*****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.