Files
doc-exports/docs/wafd/api-ref/CreateCustomRules.html
qinweiwei 14cbe51752 wafd API 20260210 version
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com>
Co-authored-by: qinweiwei <qinweiwei@huawei.com>
Co-committed-by: qinweiwei <qinweiwei@huawei.com>
2026-04-21 11:31:19 +00:00

606 lines
49 KiB
HTML

<a name="CreateCustomRules"></a><a name="CreateCustomRules"></a>
<h1 class="topictitle1">Creating a Precise Protection Rule</h1>
<div id="body1708331107508"><div class="section" id="CreateCustomRules__topic1291000000"><h4 class="sectiontitle">Function</h4><p id="CreateCustomRules__topic1291000002">This API is used to create a precise protection rule.</p>
</div>
<div class="section" id="CreateCustomRules__section2028705220269"><h4 class="sectiontitle">URI</h4><p id="CreateCustomRules__topic1291000004">POST /v1/{project_id}/waf/policy/{policy_id}/custom</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__topic1291000005" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="CreateCustomRules__topic1291000013"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="CreateCustomRules__topic1291000015">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="CreateCustomRules__topic1291000017">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="CreateCustomRules__topic1291000019">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="CreateCustomRules__topic1291000021">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000023"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreateCustomRules__topic1291000025">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreateCustomRules__topic1291000027">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreateCustomRules__topic1291000029">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreateCustomRules__topic1291000031">Project ID</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000032"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreateCustomRules__topic1291000034">policy_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreateCustomRules__topic1291000036">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreateCustomRules__topic1291000038">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreateCustomRules__topic1291000040">Policy ID. It can be obtained by calling the <strong id="CreateCustomRules__topic1291000041">ListPolicy</strong> API.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateCustomRules__topic1291000042"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="CreateCustomRules__topic1291000051"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="CreateCustomRules__topic1291000053">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="CreateCustomRules__topic1291000055">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="CreateCustomRules__topic1291000057">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="CreateCustomRules__topic1291000059">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000061"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateCustomRules__topic1291000063">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateCustomRules__topic1291000065">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateCustomRules__topic1291000067">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateCustomRules__topic1291000069">auth token</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000070"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreateCustomRules__topic1291000072">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreateCustomRules__topic1291000074">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreateCustomRules__topic1291000076">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreateCustomRules__topic1291000078">Content type.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__request_CreateCustomRuleRequestBody" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="CreateCustomRules__topic1291000086"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="CreateCustomRules__topic1291000088">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="CreateCustomRules__topic1291000090">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="CreateCustomRules__topic1291000092">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="CreateCustomRules__topic1291000094">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000096"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateCustomRules__topic1291000098">time</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateCustomRules__topic1291000100">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateCustomRules__topic1291000102">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateCustomRules__topic1291000104">Time the precise protection rule takes effect.</p>
<ul id="CreateCustomRules__topic1291000105"><li id="CreateCustomRules__topic1291000106"><p id="CreateCustomRules__topic1291000107"><a name="CreateCustomRules__topic1291000106"></a><a name="topic1291000106"></a>false: The rule takes effect immediately.</p>
</li><li id="CreateCustomRules__topic1291000108"><p id="CreateCustomRules__topic1291000109"><a name="CreateCustomRules__topic1291000108"></a><a name="topic1291000108"></a>true: The effective time is customized.</p>
</li></ul>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000110"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateCustomRules__topic1291000112">start</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateCustomRules__topic1291000114">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateCustomRules__topic1291000116">Long</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateCustomRules__topic1291000118">Timestamp (ms) when the precise protection rule takes effect. This parameter is returned only when time is true.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000119"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateCustomRules__topic1291000121">terminal</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateCustomRules__topic1291000123">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateCustomRules__topic1291000125">Long</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateCustomRules__topic1291000127">Timestamp (ms) when the precise protection rule expires. This parameter is returned only when time is true.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000128"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateCustomRules__topic1291000130">description</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateCustomRules__topic1291000132">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateCustomRules__topic1291000134">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateCustomRules__topic1291000136">Rule description</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000137"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateCustomRules__topic1291000139">conditions</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateCustomRules__topic1291000141">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateCustomRules__topic1291000143">Array of <a href="#CreateCustomRules__request_CustomConditions">CustomConditions</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateCustomRules__topic1291000146">Match condition List</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000147"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateCustomRules__topic1291000149">action</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateCustomRules__topic1291000151">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateCustomRules__topic1291000153"><a href="#CreateCustomRules__request_CustomAction">CustomAction</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateCustomRules__topic1291000156">Protective action of the precise protection rule.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000157"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreateCustomRules__topic1291000159">priority</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreateCustomRules__topic1291000161">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreateCustomRules__topic1291000163">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreateCustomRules__topic1291000165">Priority of a rule. A small value indicates a high priority. If two rules are assigned with the same priority, the rule added earlier has higher priority. Value range: 0 to 1000.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreateCustomRules__request_CustomConditions"></a><a name="request_CustomConditions"></a><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__request_CustomConditions" frame="border" border="1" rules="all"><caption><b>Table 4 </b>CustomConditions</caption><thead align="left"><tr id="CreateCustomRules__topic1291000173"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.1"><p id="CreateCustomRules__topic1291000175">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.2"><p id="CreateCustomRules__topic1291000177">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.3"><p id="CreateCustomRules__topic1291000179">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.4.2.5.1.4"><p id="CreateCustomRules__topic1291000181">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000183"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateCustomRules__topic1291000185">category</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateCustomRules__topic1291000187">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateCustomRules__topic1291000189">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateCustomRules__topic1291000191">Field type. The options are <strong id="CreateCustomRules__topic1291000192">url</strong>, <strong id="CreateCustomRules__topic1291000193">user-agent</strong>, <strong id="CreateCustomRules__topic1291000194">ip</strong>, <strong id="CreateCustomRules__topic1291000195">params</strong>, <strong id="CreateCustomRules__topic1291000196">cookie</strong>, <strong id="CreateCustomRules__topic1291000197">referer</strong>, <strong id="CreateCustomRules__topic1291000198">header</strong>, <strong id="CreateCustomRules__topic1291000199">request_line</strong>, <strong id="CreateCustomRules__topic1291000200">method</strong>, and <strong id="CreateCustomRules__topic1291000201">request</strong>.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000202"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateCustomRules__topic1291000204">index</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateCustomRules__topic1291000206">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateCustomRules__topic1291000208">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateCustomRules__topic1291000210">Subfield</p>
<ul id="CreateCustomRules__topic1291000211"><li id="CreateCustomRules__topic1291000212"><p id="CreateCustomRules__topic1291000213"><a name="CreateCustomRules__topic1291000212"></a><a name="topic1291000212"></a>When the field type is <strong id="CreateCustomRules__topic1291000214">url</strong>, <strong id="CreateCustomRules__topic1291000215">user-agent</strong>, <strong id="CreateCustomRules__topic1291000216">ip</strong>, <strong id="CreateCustomRules__topic1291000217">refer</strong>, <strong id="CreateCustomRules__topic1291000218">request_line</strong>, <strong id="CreateCustomRules__topic1291000219">method</strong>, or <strong id="CreateCustomRules__topic1291000220">request</strong>, <strong id="CreateCustomRules__topic1291000221">index</strong> is not required.</p>
</li><li id="CreateCustomRules__topic1291000222"><p id="CreateCustomRules__topic1291000223"><a name="CreateCustomRules__topic1291000222"></a><a name="topic1291000222"></a>When the field type is <strong id="CreateCustomRules__topic1291000224">params</strong>, <strong id="CreateCustomRules__topic1291000225">header</strong>, or <strong id="CreateCustomRules__topic1291000226">cookie</strong>, and the subfield is customized, the value of <strong id="CreateCustomRules__topic1291000227">index</strong> is the customized subfield.</p>
</li></ul>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000228"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateCustomRules__topic1291000230">logic_operation</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateCustomRules__topic1291000232">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateCustomRules__topic1291000234">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateCustomRules__topic1291000236">Logic for matching the condition.</p>
<ul id="CreateCustomRules__topic1291000237"><li id="CreateCustomRules__topic1291000238"><p id="CreateCustomRules__topic1291000239"><a name="CreateCustomRules__topic1291000238"></a><a name="topic1291000238"></a>If the category is <strong id="CreateCustomRules__topic1291000240">url</strong>, <strong id="CreateCustomRules__topic1291000241">user-agent</strong> or <strong id="CreateCustomRules__topic1291000242">referer</strong> , the optional operations are contain, not_contain, equal, not_equal, prefix, not_prefix, suffix, not_suffix, contain_any, not_contain_all, equal_any, not_equal_all, equal_any, not_equal_all, prefix_any, not_prefix_all, suffix_any, not_suffix_all, len_greater, len_less, len_equal and len_not_equal</p>
</li><li id="CreateCustomRules__topic1291000243"><p id="CreateCustomRules__topic1291000244"><a name="CreateCustomRules__topic1291000243"></a><a name="topic1291000243"></a>If the category is <strong id="CreateCustomRules__topic1291000245">ip</strong>, the optional operations are: equal, not_equal, equal_any and not_equal_all</p>
</li><li id="CreateCustomRules__topic1291000246"><p id="CreateCustomRules__topic1291000247"><a name="CreateCustomRules__topic1291000246"></a><a name="topic1291000246"></a>If the category is <strong id="CreateCustomRules__topic1291000248">method</strong>, the optional operations are: equal and not_equal</p>
</li><li id="CreateCustomRules__topic1291000249"><p id="CreateCustomRules__topic1291000250"><a name="CreateCustomRules__topic1291000249"></a><a name="topic1291000249"></a>If the category is <strong id="CreateCustomRules__topic1291000251">request_line</strong> and <strong id="CreateCustomRules__topic1291000252">request</strong>, the optional operations are: len_greater, len_less, len_equal and len_not_equal</p>
</li><li id="CreateCustomRules__topic1291000253"><p id="CreateCustomRules__topic1291000254"><a name="CreateCustomRules__topic1291000253"></a><a name="topic1291000253"></a>If the category is <strong id="CreateCustomRules__topic1291000255">params</strong>, <strong id="CreateCustomRules__topic1291000256">header</strong>, and <strong id="CreateCustomRules__topic1291000257">cookie</strong>, the optional operations are: contain, not_contain, equal, not_equal, prefix, not_prefix, suffix, not_suffix, contain_any, not_contain_all, equal_any, not_equal_all, equal_any, not_equal_all, prefix_any, not_prefix_all, suffix_any, not_suffix_all, len_greater, len_less, len_equal, len_not_equal, num_greater, num_less, num_equal, num_not_equal, exist and not_exist</p>
</li></ul>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000258"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateCustomRules__topic1291000260">contents</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateCustomRules__topic1291000262">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateCustomRules__topic1291000264">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateCustomRules__topic1291000266">Content of the conditions. This parameter is mandatory when the suffix of <strong id="CreateCustomRules__topic1291000267">logic_operation</strong> is not any or all.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000268"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreateCustomRules__topic1291000270">value_list_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreateCustomRules__topic1291000272">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreateCustomRules__topic1291000274">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreateCustomRules__topic1291000276">Reference table ID. It can be obtained by calling the API Querying the Reference Table List. This parameter is mandatory when the suffix of <strong id="CreateCustomRules__topic1291000277">logic_operation</strong> is any or all. The reference table type must be the same as the category type.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreateCustomRules__request_CustomAction"></a><a name="request_CustomAction"></a><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__request_CustomAction" frame="border" border="1" rules="all"><caption><b>Table 5 </b>CustomAction</caption><thead align="left"><tr id="CreateCustomRules__topic1291000285"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.5.2.5.1.1"><p id="CreateCustomRules__topic1291000287">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.5.2.5.1.2"><p id="CreateCustomRules__topic1291000289">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.5.2.5.1.3"><p id="CreateCustomRules__topic1291000291">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.5.2.5.1.4"><p id="CreateCustomRules__topic1291000293">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000295"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreateCustomRules__topic1291000297">category</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreateCustomRules__topic1291000299">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreateCustomRules__topic1291000301">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreateCustomRules__topic1291000303">Operation type</p>
<ul id="CreateCustomRules__topic1291000304"><li id="CreateCustomRules__topic1291000305"><p id="CreateCustomRules__topic1291000306"><a name="CreateCustomRules__topic1291000305"></a><a name="topic1291000305"></a><strong id="CreateCustomRules__topic1291000307">block</strong>: WAF blocks attacks.</p>
</li><li id="CreateCustomRules__topic1291000308"><p id="CreateCustomRules__topic1291000309"><a name="CreateCustomRules__topic1291000308"></a><a name="topic1291000308"></a><strong id="CreateCustomRules__topic1291000310">pass</strong>: WAF allows requests.</p>
</li><li id="CreateCustomRules__topic1291000311"><p id="CreateCustomRules__topic1291000312"><a name="CreateCustomRules__topic1291000311"></a><a name="topic1291000311"></a><strong id="CreateCustomRules__topic1291000313">log</strong>: WAF only logs detected attacks.</p>
</li></ul>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000314"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreateCustomRules__topic1291000316">followed_action_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreateCustomRules__topic1291000318">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreateCustomRules__topic1291000320">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreateCustomRules__topic1291000322">ID of a known attack source rule. This parameter can be configured only when <strong id="CreateCustomRules__topic1291000323">category</strong> is set to <strong id="CreateCustomRules__topic1291000324">block</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateCustomRules__topic1291000325"><h4 class="sectiontitle">Response Parameters</h4><p id="CreateCustomRules__topic1291000327"><strong id="CreateCustomRules__topic1291000328">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__response_CreateCustomRuleResponseBody" frame="border" border="1" rules="all"><caption><b>Table 6 </b>Response body parameters</caption><thead align="left"><tr id="CreateCustomRules__topic1291000335"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="CreateCustomRules__topic1291000337">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="CreateCustomRules__topic1291000339">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="CreateCustomRules__topic1291000341">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000343"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000345">id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000347">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000349">Rule ID.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000350"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000352">policyid</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000354">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000356">Policy ID.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000357"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000359">description</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000361">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000363">Rule description</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000364"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000366">status</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000368">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000370">Rule status. The value can be <strong id="CreateCustomRules__topic1291000371">0</strong> or <strong id="CreateCustomRules__topic1291000372">1</strong>.</p>
<ul id="CreateCustomRules__topic1291000373"><li id="CreateCustomRules__topic1291000374"><p id="CreateCustomRules__topic1291000375"><a name="CreateCustomRules__topic1291000374"></a><a name="topic1291000374"></a><strong id="CreateCustomRules__topic1291000376">0</strong>: The rule is disabled.</p>
</li><li id="CreateCustomRules__topic1291000377"><p id="CreateCustomRules__topic1291000378"><a name="CreateCustomRules__topic1291000377"></a><a name="topic1291000377"></a><strong id="CreateCustomRules__topic1291000379">1</strong>: The rule is enabled.</p>
</li></ul>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000380"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000382">conditions</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000384">Array of <a href="#CreateCustomRules__response_conditions">conditions</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000387">List of matching conditions. All conditions must be met.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000388"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000390">action</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000392"><a href="#CreateCustomRules__response_CustomAction">CustomAction</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000395">Protective action of the precise protection rule.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000396"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000398">priority</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000400">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000402">Priority of a rule. A small value indicates a high priority. If two rules are assigned with the same priority, the rule added earlier has higher priority. Value range: 0 to 1000.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000403"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000405">timestamp</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000407">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000409">Timestamp when the precise protection rule is created.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000410"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000412">start</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000414">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000416">Timestamp (ms) when the precise protection rule takes effect. This parameter is returned only when time is true.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000417"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000419">terminal</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000421">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000423">Timestamp (ms) when the precise protection rule expires. This parameter is returned only when time is true.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000424"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000426">action_mode</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000428">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000430">This parameter is reserved and can be ignored currently.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000431"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000433">aging_time</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000435">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000437">Rule aging time. This parameter is reserved and can be ignored currently.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000438"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreateCustomRules__topic1291000440">producer</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreateCustomRules__topic1291000442">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreateCustomRules__topic1291000444">Rule creation object. This parameter is reserved and can be ignored currently.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreateCustomRules__response_conditions"></a><a name="response_conditions"></a><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__response_conditions" frame="border" border="1" rules="all"><caption><b>Table 7 </b>conditions</caption><thead align="left"><tr id="CreateCustomRules__topic1291000451"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.1"><p id="CreateCustomRules__topic1291000453">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.2"><p id="CreateCustomRules__topic1291000455">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.4.2.4.1.3"><p id="CreateCustomRules__topic1291000457">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000459"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreateCustomRules__topic1291000461">category</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreateCustomRules__topic1291000463">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreateCustomRules__topic1291000465">Field type. The options are <strong id="CreateCustomRules__topic1291000466">url</strong>, <strong id="CreateCustomRules__topic1291000467">user-agent</strong>, <strong id="CreateCustomRules__topic1291000468">ip</strong>, <strong id="CreateCustomRules__topic1291000469">params</strong>, <strong id="CreateCustomRules__topic1291000470">cookie</strong>, <strong id="CreateCustomRules__topic1291000471">referer</strong>, <strong id="CreateCustomRules__topic1291000472">header</strong>, <strong id="CreateCustomRules__topic1291000473">request_line</strong>, <strong id="CreateCustomRules__topic1291000474">method</strong>, and <strong id="CreateCustomRules__topic1291000475">request</strong>.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000476"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreateCustomRules__topic1291000478">index</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreateCustomRules__topic1291000480">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreateCustomRules__topic1291000482">Subfield</p>
<ul id="CreateCustomRules__topic1291000483"><li id="CreateCustomRules__topic1291000484"><p id="CreateCustomRules__topic1291000485"><a name="CreateCustomRules__topic1291000484"></a><a name="topic1291000484"></a>When the field type is <strong id="CreateCustomRules__topic1291000486">url</strong>, <strong id="CreateCustomRules__topic1291000487">user-agent</strong>, <strong id="CreateCustomRules__topic1291000488">ip</strong>, <strong id="CreateCustomRules__topic1291000489">refer</strong>, <strong id="CreateCustomRules__topic1291000490">request_line</strong>, <strong id="CreateCustomRules__topic1291000491">method</strong>, or <strong id="CreateCustomRules__topic1291000492">request</strong>, <strong id="CreateCustomRules__topic1291000493">index</strong> is not required.</p>
</li><li id="CreateCustomRules__topic1291000494"><p id="CreateCustomRules__topic1291000495"><a name="CreateCustomRules__topic1291000494"></a><a name="topic1291000494"></a>When the field type is <strong id="CreateCustomRules__topic1291000496">params</strong>, <strong id="CreateCustomRules__topic1291000497">header</strong>, or <strong id="CreateCustomRules__topic1291000498">cookie</strong>, and the subfield is customized, the value of <strong id="CreateCustomRules__topic1291000499">index</strong> is the customized subfield.</p>
</li></ul>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000500"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreateCustomRules__topic1291000502">logic_operation</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreateCustomRules__topic1291000504">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreateCustomRules__topic1291000506">Logic for matching the condition.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000507"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreateCustomRules__topic1291000509">contents</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreateCustomRules__topic1291000511">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreateCustomRules__topic1291000513">Content of the conditions.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000514"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreateCustomRules__topic1291000516">value_list_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreateCustomRules__topic1291000518">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreateCustomRules__topic1291000520">Reference table ID. It can be obtained by calling the API Querying the Reference Table List. This parameter is available only when a reference table is used when a protection rule is created.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreateCustomRules__response_CustomAction"></a><a name="response_CustomAction"></a><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__response_CustomAction" frame="border" border="1" rules="all"><caption><b>Table 8 </b>CustomAction</caption><thead align="left"><tr id="CreateCustomRules__topic1291000527"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.1"><p id="CreateCustomRules__topic1291000529">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.2"><p id="CreateCustomRules__topic1291000531">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.5.2.4.1.3"><p id="CreateCustomRules__topic1291000533">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000535"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateCustomRules__topic1291000537">category</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateCustomRules__topic1291000539">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateCustomRules__topic1291000541">Operation type</p>
<ul id="CreateCustomRules__topic1291000542"><li id="CreateCustomRules__topic1291000543"><p id="CreateCustomRules__topic1291000544"><a name="CreateCustomRules__topic1291000543"></a><a name="topic1291000543"></a><strong id="CreateCustomRules__topic1291000545">block</strong>: WAF blocks attacks.</p>
</li><li id="CreateCustomRules__topic1291000546"><p id="CreateCustomRules__topic1291000547"><a name="CreateCustomRules__topic1291000546"></a><a name="topic1291000546"></a><strong id="CreateCustomRules__topic1291000548">pass</strong>: WAF allows requests.</p>
</li><li id="CreateCustomRules__topic1291000549"><p id="CreateCustomRules__topic1291000550"><a name="CreateCustomRules__topic1291000549"></a><a name="topic1291000549"></a><strong id="CreateCustomRules__topic1291000551">log</strong>: WAF only logs detected attacks.</p>
</li></ul>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000552"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreateCustomRules__topic1291000554">followed_action_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreateCustomRules__topic1291000556">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreateCustomRules__topic1291000558">ID of a known attack source rule. This parameter can be configured only when <strong id="CreateCustomRules__topic1291000559">category</strong> is set to <strong id="CreateCustomRules__topic1291000560">block</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateCustomRules__topic1291000561"><strong id="CreateCustomRules__topic1291000562">Status code: 400</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__response_RestErrorResponse" frame="border" border="1" rules="all"><caption><b>Table 9 </b>Response body parameters</caption><thead align="left"><tr id="CreateCustomRules__topic1291000569"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.1"><p id="CreateCustomRules__topic1291000571">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.2"><p id="CreateCustomRules__topic1291000573">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.7.2.4.1.3"><p id="CreateCustomRules__topic1291000575">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000577"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateCustomRules__topic1291000579">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateCustomRules__topic1291000581">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateCustomRules__topic1291000583">Error code</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000584"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreateCustomRules__topic1291000586">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreateCustomRules__topic1291000588">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreateCustomRules__topic1291000590">Error message</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateCustomRules__topic1291000591"><strong id="CreateCustomRules__topic1291000592">Status code: 401</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__table12310135215267" frame="border" border="1" rules="all"><caption><b>Table 10 </b>Response body parameters</caption><thead align="left"><tr id="CreateCustomRules__topic1291000599"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.9.2.4.1.1"><p id="CreateCustomRules__topic1291000601">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.9.2.4.1.2"><p id="CreateCustomRules__topic1291000603">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.9.2.4.1.3"><p id="CreateCustomRules__topic1291000605">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000607"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateCustomRules__topic1291000609">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateCustomRules__topic1291000611">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateCustomRules__topic1291000613">Error code</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000614"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.1 "><p id="CreateCustomRules__topic1291000616">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.9.2.4.1.2 "><p id="CreateCustomRules__topic1291000618">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.9.2.4.1.3 "><p id="CreateCustomRules__topic1291000620">Error message</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="CreateCustomRules__topic1291000621"><strong id="CreateCustomRules__topic1291000622">Status code: 500</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__table11311252192614" frame="border" border="1" rules="all"><caption><b>Table 11 </b>Response body parameters</caption><thead align="left"><tr id="CreateCustomRules__topic1291000629"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.11.2.4.1.1"><p id="CreateCustomRules__topic1291000631">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.11.2.4.1.2"><p id="CreateCustomRules__topic1291000633">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.11.2.4.1.3"><p id="CreateCustomRules__topic1291000635">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000637"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.1 "><p id="CreateCustomRules__topic1291000639">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.2 "><p id="CreateCustomRules__topic1291000641">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.11.2.4.1.3 "><p id="CreateCustomRules__topic1291000643">Error code</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000644"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.1 "><p id="CreateCustomRules__topic1291000646">error_msg</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.11.2.4.1.2 "><p id="CreateCustomRules__topic1291000648">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.11.2.4.1.3 "><p id="CreateCustomRules__topic1291000650">Error message</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateCustomRules__topic1291000651"><h4 class="sectiontitle">Example Requests</h4><pre class="screen" id="CreateCustomRules__topic1291000653">POST https://{Endpoint}/v1/{project_id}/waf/policy/{policy_id}/custom?enterprise_project_id=0
{
"action" : {
"category" : "block"
},
"time" : false,
"priority" : 50,
"description" : "",
"conditions" : [ {
"category" : "url",
"logic_operation" : "contain",
"index" : null,
"contents" : [ "test" ]
} ]
}</pre>
</div>
<div class="section" id="CreateCustomRules__topic1291000654"><h4 class="sectiontitle">Example Responses</h4><p id="CreateCustomRules__topic1291000656"><strong id="CreateCustomRules__topic1291000657">Status code: 200</strong></p>
<p id="CreateCustomRules__topic1291000658">Request succeeded.</p>
<pre class="screen" id="CreateCustomRules__topic1291000659">{
"id" : "88e8bf4158324b2d9a233e7ffb95516d",
"policyid" : "dde63c25e8394b21b16a2a49a99e659b",
"timestamp" : 1678799936830,
"description" : "",
"status" : 1,
"time" : false,
"priority" : 50,
"action_mode" : false,
"conditions" : [ {
"category" : "url",
"contents" : [ "test" ],
"logic_operation" : "contain"
} ],
"action" : {
"category" : "block"
},
"producer" : 1,
"aging_time" : 0
}</pre>
</div>
<div class="section" id="CreateCustomRules__topic1291000660"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreateCustomRules__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="CreateCustomRules__topic1291000666"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="CreateCustomRules__topic1291000668">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="CreateCustomRules__topic1291000670">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreateCustomRules__topic1291000672"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateCustomRules__topic1291000674">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateCustomRules__topic1291000676">Request succeeded.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000677"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateCustomRules__topic1291000679">400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateCustomRules__topic1291000681">Request failed.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000682"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateCustomRules__topic1291000684">401</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateCustomRules__topic1291000686">The token does not have required permissions.</p>
</td>
</tr>
<tr id="CreateCustomRules__topic1291000687"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreateCustomRules__topic1291000689">500</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreateCustomRules__topic1291000691">Internal server error.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreateCustomRules__topic1291000692"><h4 class="sectiontitle">Error Codes</h4><p id="CreateCustomRules__topic1291000694">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="topic_300000003.html">Rule Management</a></div>
</div>
</div>