Cancel audio moderation tasks

Updated at:

To cancel an asynchronous audio moderation task after you submit it, call the /green/voice/cancelscan API operation.

Usage notes

The /green/voice/cancelscan API operation cancels an audio moderation task.

You can call this operation to cancel audio moderation tasks that are in the queue or in progress. You cannot cancel completed tasks. For more information about how to construct an HTTP request, see Request structure. You can also directly use a pre-built HTTP request. For more information, see SDK overview.

Billing: This API operation is free. If you cancel an audio moderation task, you are still charged for the duration of the audio that has already been processed.

QPS limits

You can call this operation up to 50 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

Request parameters

For information about the common request parameters that must be included in a request, see Common parameters.

The request body is a JSON array. The following table describes the fields.
NameTypeRequiredExampleDescription
bodyJSONArrayYes["taskId1","taskId2"]A list of taskIds to cancel. You can cancel up to 100 tasks.

Returned data

For more information about the response, see Response parameters.

The Data field in the response body is a JSON array. Each element contains the following fields:
NameTypeExampleDescription
codeInteger200

The returned HTTP status code.

For more information, see Common error codes.

msgStringOKThe message returned in the response.
dataIdStringdataId1The dataId from the request.
taskIdStringtaskId1The ID of the moderation task.

Examples

Sample request
http://[Endpoint]/green/voice/cancelscan
&<Common request parameters>
[
    "taskId1",
    "taskId2"
]
Sample response
{
    "code":200,
    "msg":"OK",
    "requestId":"AD87F1D1-A675-4F82-8D67-ED43B6FFA876",
    "data":[
        {
            "code":200,
            "msg":"ok",
            "dataId":"dataId1",
            "taskId":"taskId1"
        },
        {
            "code":200,
            "msg":"ok",
            "dataId":"dataId2",
            "taskId":"taskId2"
        }
    ]
}