All Products
Search
Document Center

ApsaraVideo Media Processing:SubmitMediaCensorJob

Last Updated:Apr 07, 2026

Submits a media censor job.

Operation description

  • This is an asynchronous API. After you submit a job, the system returns a job ID and queues it for asynchronous processing. The final results are delivered through a callback notification. You can also call the Query a media censor job operation to check the job status.

  • Media censorship is available in the China (Beijing), China (Shanghai), and Asia Pacific SE 1 (Singapore) regions. This feature is not supported in other regions.

QPS limit

The queries per second (QPS) limit for this API is 100 per user. API calls that exceed this limit are rate-limited, which can affect your business. For more information, see QPS limit.

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

mts:SubmitMediaCensorJob

none

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Input

string

No

The OSS URL of the media file to censor. Video and audio files are supported. You can obtain the URL from the MPS console under Media Management > Media List. To censor an image file, use the CoverImage parameter. Specify this parameter as a JSON object. For details, see the Input details.

  • Bucket: The name of the input file's OSS bucket.

  • Location: The OSS region. This must match the region of your MPS service.

  • Object: The OSS object to scan.

    Note

    The object name cannot start with a forward slash (/). Otherwise, the API call fails.

{"Bucket":"example-bucket-****","Location":"oss-cn-shanghai","Object":"example-****.flv"}

CoverImages

string

No

The OSS URLs of the cover images. You can obtain the URLs from the MPS console under Media Management > Media List. You can specify up to five cover images. Specify the URLs as a JSON array.

  • Bucket: The name of the input file's OSS bucket.

  • Location: The OSS region. This must match the region of your MPS service.

  • Object: The OSS object to scan.

    Note

    The object name cannot start with a forward slash (/). Otherwise, the API call fails.

[{"Bucket":"example-bucket-****","Location":"oss-cn-shanghai","Object":"example-****.jpeg"}]

Title

string

No

The title of the video. The maximum length is 64 bytes.

Hello World

Description

string

No

The description of the video. The maximum length is 128 bytes.

example description

Barrages

string

No

The barrage comments, provided as a string.

hello world

PipelineId

string

No

The ID of the pipeline that is used for message notifications. You can obtain the ID from the MPS console under Global Settings > Pipelines. If you do not specify this parameter, the default pipeline is used. The default pipeline has a concurrency of 10. To increase the concurrency, submit a ticket.

Note

Currently, pipelines can only be created on the backend. To query and update pipelines, see Update a pipeline.

b22c173cced04565b1f38f1ecc39****

VideoCensorConfig

string

Yes

The video censorship configuration and the OSS URL for output snapshots. You can obtain the URL from the MPS console under Media Management > Media List.

This parameter is a JSON object.

  • OutputFile:

    • Bucket: The name of the output OSS bucket.

    • Location: The OSS region. This must be the same as the region where the MPS service resides.

    • Object: The OSS object for the output. The {Count} placeholder is replaced with the sequence number of the snapshot.

    The detailed censorship results are saved in a file named {jobId}.output in the same directory as the OutputFile. For information about the fields in the output file, see Fields in the media censorship result file.

  • StoreVideoTimeline: Specifies whether to generate a {jobId}.video_timeline file and store it in OSS. Set the value to true to generate the file. If you set the value to false or omit the parameter, the system does not generate the file. For details about the file format, see Query a media job (videoTimeline example).

  • SaveType: The output mode. abnormal saves only snapshots of problematic content. all saves all snapshots.

  • Biztype: The censorship template. The default value is common. To use a custom censorship template, you must submit a ticket. After your custom template is configured, set this parameter to your user ID (UID).

  • Scene: The detection scenes. You can select one or more scenes. If you do not specify this parameter, the system defaults to the porn and terrorism scenes. Valid scenes:

    • porn: pornographic content

    • terrorism: terrorist content

    • ad: text-image policy violations

    • live: undesirable scenes

    • logo: logos

    • audio: audio anti-spam

Note

For input files that have an audio track, the audio scene performs audio censorship. Do not specify the audio scene for input files that do not have an audio track.

{"Scenes" : ["porn"], "OutputFile":{"Bucket": "example-001","Location": "oss-cn-hangzhou","Object": "test/example-{Count}.jpg"},"SaveType" : "abnormal","BizType":"common"}

UserData

string

No

Custom user data. The maximum length is 128 bytes.

UserDatatestid-001-****

ExternalUrl

string

No

The URL of the video.

http://www.example.com/video-****/test-****.mp4

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The ID of the request.

25818875-5F78-4A13-BEF6-D7393642CA58

JobId

string

The ID of the media censor job. Save this ID for subsequent API calls.

88c6ca184c0e47098a5b665e2****

Asynchronous notification message parameters

ParameterTypeDescription
TypeStringThe type of the message. Value: MediaCensor.
MediaCensorJobNotifyAliyunMediaCensorJobNotifyThe notification object for the media censor job.
UserDataStringThe custom user data.

Examples

Success response

JSON format

{
  "RequestId": "25818875-5F78-4A13-BEF6-D7393642CA58",
  "JobId": "88c6ca184c0e47098a5b665e2****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.