All Products
Search
Document Center

Intelligent Media Management:CreateImageModerationTask

Last Updated:Jan 28, 2026

Detects non-compliant content in images, such as pornography, terrorism, undesirable scenes, logos, and text-in-image violations.

Operation description

  • Before you use this operation, make sure that you understand the billing methods and pricing of Intelligent Media Management.
    Important The execution time of asynchronous tasks is not guaranteed.
  • Image requirements:
    • Image URLs support the HTTP and HTTPS protocols.

    • The following image formats are supported: PNG, JPG, JPEG, BMP, GIF, and WEBP.

    • The image size cannot exceed 20 MB for both synchronous and asynchronous invocations. The height or width cannot exceed 30,000 pixels, and the total number of pixels cannot exceed 250 million. For GIF images, the total number of pixels cannot exceed 4,194,304, and the height or width cannot exceed 30,000 pixels.

    • The image download timeout period is 3 seconds. If the download takes longer than 3 seconds, a timeout error is returned.

    • For best results, the image resolution should be at least 256 × 256 pixels. Low resolution may affect detection accuracy.

    • The response time for image detection depends on the image download time. Ensure the storage service where the image is stored is stable and reliable. Use Alibaba Cloud Object Storage Service (OSS) or CDN.

  • This is an asynchronous operation. After a task starts, its information is saved for only 7 days. You cannot query the information after this period. To view task information, you can call the GetTask or ListTasks operation and use the returned TaskId. Alternatively, you can set the Notification parameter to receive task information through asynchronous notification messages.

Note

The detection results are returned in an asynchronous notification message. The Suggestion field in the message has one of the following values:

  • pass: The image passed the review. No non-compliant content was detected.

  • block: The image failed the review. Non-compliant content was detected. The Categories field indicates the non-compliant category. For more information about the categories, see Content Moderation detection results.

  • review: The image requires manual review. After the manual review is complete, another asynchronous notification message is sent to inform you of the result.

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:CreateImageModerationTask

create

*Project

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

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectName

string

Yes

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

test-project

UserData

string

No

The custom information. This information is returned in the asynchronous notification message to help you associate the message with your system. The value can be up to 2,048 bytes long.

test-data

SourceURI

string

Yes

The OSS URI of the image.

The URI must follow the oss://<Bucket>/<Object> format. <Bucket> is the name of the OSS bucket that is 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

The custom tags. You can use tags to search for and filter asynchronous tasks.

{ "User": "Jane" }

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 image detection scenarios.

string

No

The image detection scenario. Valid values:

  • porn: pornography detection.

  • terrorism: terrorism and political 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 :

    Ad violations

  • terrorism :

    Terrorism and political content

  • logo :

    Logo detection

  • live :

    Inappropriate scenes

  • porn :

    Pornography detection

porn

Interval

integer

No

The frame capture frequency. This parameter is used for GIF and long image detection. The default value is 1.

2

MaxFrames

integer

No

The maximum number of frames to capture. This parameter is used for GIF and long image detection. The default value is 1.

10

Notification Notification

No

The notification configuration. For more information about the format of asynchronous notification messages, see 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 task ID.

ImageModeration-179ef4f8-d583-4f0c-a293-7c0889c*****

EventId

string

The event ID.

2E6-1I0FGn0zFnl5AflRfhzClma*****

Examples

Success response

JSON format

{
  "RequestId": "1B3D5E0A-D8B8-4DA0-8127-ED32C851****",
  "TaskId": "ImageModeration-179ef4f8-d583-4f0c-a293-7c0889c*****",
  "EventId": "2E6-1I0FGn0zFnl5AflRfhzClma*****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.