Update a global rule on a gateway group
PUT /apisix/admin/global_rules/{global_rule_id}
PUT /apisix/admin/global_rules/{global_rule_id}Interactive request editor loads with JavaScript.
In: header
Path Parameters
The unique identifier of the global rule.
^[a-zA-Z0-9-_.]+$1 <= length <= 256Query Parameters
Gateway group ID. Optional when using the gateway group admin key to authenticate.
1 <= lengthRequest Body
application/json
The global rule description.
Response Body
application/json
application/json
curl -X PUT "$API_BASE_URL/apisix/admin/global_rules/bd58fce2-b6cc-4d2d-a53c-6ce11b19c101?gateway_group_id=86fb9981-d9d2-4555-9df8-91ae92129335" \ -H "Content-Type: application/json" \ -d '{ "plugins": { "key-auth": {} } }'Global rule updated successfully.
{
"value": {
"plugins": {
"key-auth": {}
},
"id": "key-auth",
"gateway_group_id": "bc1b95c9-b348-4832-acc3-e257d2342df1",
"created_at": 1742288232,
"updated_at": 1742288235
}
}Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
{
"value": {},
"error_msg": "error message"
}Complete operation details and schema variants
PUT /apisix/admin/global_rules/{global_rule_id}
Update a global rule on a gateway group
Replace an existing global rule configuration in full for the gateway group. Changes immediately affect all matching traffic because global rules are applied gateway-wide.
Required IAM Permission: Action gateway:UpdateGlobalPluginRule, Resource arn:api7:gateway:gatewaygroup/%s
Parameters
gateway_group_id(query, string, required): Gateway group ID. Optional when using the gateway group admin key to authenticate.global_rule_id(path, string, required): The unique identifier of the global rule.
Request body
Content type: application/json
plugins(object, required): Key-value pairs of plugins and their configurations on the object.
Responses
200: Global rule updated successfully.- allOf variant 1
value(object, optional): The specific resource.- allOf variant 2
value(object, optional): The global rule with management fields.- allOf variant 1
value.plugins(object, required): Key-value pairs of plugins and their configurations on the object.- allOf variant 2
value.id(string, optional): Name of the plugin.value.gateway_group_id(string, optional): The gateway group ID.value.created_at(integer, optional): The object created timestamp.value.updated_at(integer, optional): The object updated timestamp.400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.value(object, optional): The specific resource.error_msg(string, optional): The error message.
cURL
curl -X PUT '$API_BASE_URL/apisix/admin/global_rules/{global_rule_id}'