Adds terms to a specified custom text library. You can use text libraries for text anti-spam. The effect of managing custom text libraries by calling API operations is the same as that of managing custom text libraries in the Alibaba Cloud Content Moderation console.

Operation description

Operation: CreateKeyword

You can call this operation to add terms to a specified text 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
KeywordLibId String Yes 2147 The primary key ID of the text library.
Keywords StringArray Yes ["test"] The list of terms.

Response parameters

For more information about common response parameters that this operation returns, see Common response parameters.
Parameter Type Example Description
SuccessCount Integer 0 The number of terms that are added.
InvalidKeywordList StringArray ["test"] The list of invalid terms, which are the terms that failed to be added.


Sample requests
  "KeywordLibId": "2147",
  "Keywords": [
Sample success responses
  "code": 200,
  "data": {
    "InvalidKeywordList": [
    "SuccessCount": 0