All Products
Search
Document Center

AI Guardrails:UpdateKeywordLib

Last Updated:Mar 31, 2026

Updates the basic information of a custom text library used for text anti-spam.

Operation description

Operation: UpdateKeywordLib

Managing custom text libraries via the API has the same effect as managing them in the Alibaba Cloud AI Guardrails console.

For details on constructing an HTTP request, see Request structure. To use an SDK instead, see SDK overview.

Billing: Free of charge.

QPS limits

Up to 10 calls per second per account. Exceeding this limit triggers throttling. 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 common request parameters required in all AI Guardrails API requests, see Common parameters.

The following parameters are specific to this operation.

ParameterTypeRequiredExampleDescription
IdIntegerYes2147The primary key ID of the text library.
NameStringYestest2sdkdkThe name of the text library.
BizTypesListNo["bizTypeA", "bizTypeB", "bizTypeC"]The business scenarios associated with the text library. For details, see CreateBizType.
EnableBooleanNotrueSpecifies whether to enable the text library. Valid values: true (enable) and false (disable).

Response parameters

This operation returns only common response parameters.

Examples

Sample request

http(s)://green.cn-shanghai.aliyuncs.com/?
Action=UpdateKeywordLib&ServiceModule=open_api
&<Common request parameters>
{
  "Id": 2147,
  "Name": "test2sdkdk",
  "BizTypes": [
    "bizTypeA",
    "bizTypeB",
    "bizTypeC"
  ]
}

Sample success response

{
  "requestId": "795D8871-4889-4C0F-A8B1-C7D2B990FF61",
  "code": 200
}