Creates an image library.

Operation description

Operation: CreateImageLib
Note The maximum number of image libraries equals the number of image libraries that are created by using this operation plus the number of image libraries that are created in the Alibaba Cloud Content Moderation console.

You can call this operation to create an image library. For more information about how to construct an HTTP request, see Request structure. You can also select an existing HTTP request. For more information, see SDK overview.

Billing method: This operation is free of charge.

QPS limit

You can send up to 10 requests per second to call this operation by using your Alibaba Cloud account. If you send an excessive number of requests, throttling is implemented, and your business may be affected.

Request parameters

For more information about the common request parameters that must be included in all Content Moderation API requests, see Common parameters.

The following table describes the parameters in the request body.
Parameter Type Required Example Description
Name String Yes test1sdkdk The name of the image library.
Category String Yes BLACK The category of the image library. Valid values:
  • BLACK: a blacklist
  • WHITE: a whitelist
Scene String Yes PORN The moderation scenario to which the custom image library applies. Valid values:
  • PORN: pornography detection
  • AD: ad violation detection
  • ILLEGAL: terrorist content detection
BizTypes List No xxx The business type of the custom image library that you set on the Moderation Policy tab by choosing Settings > Moderation API.
Enable Boolean No true Specifies whether to enable the image library. Valid values:
  • true: enables the image library.
  • false: disables the image library.

Response parameters

For more information about common response parameters that this operation returns, see Common response parameters.


Sample requests
  "Name": "test1sdkdk",
  "BizTypes": [],
  "Category": "BLACK",
  "ServiceModule": "open_api",
  "ResourceType": "TEXT",
  "Scene": "PORN"
Sample success responses
  "requestId": "795D8871-4889-4C0F-A8B1-C7D2B990FF61",
  "code": 200