Update Plugin Associated to a Specific Route

PATCH {{gateway}}/routes/:routeNameOrId/plugins/:pluginId

Update Plugin Associated to a Specific Route konghq

AttributesMandatoryDescription
route name or idrequiredThe unique identifier or the name of the Route to update.
plugin idrequiredThe unique identifier of the Plugin to update.

Request Body

AttributesMandatoryDescription
namerequiredThe name of the Plugin that’s going to be added. Currently the Plugin must be installed in every Kong instance separately.
routeoptionalIf set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the Route being used. Defaults to null.With form-encoded, the notation is route.id= or route.name=. With JSON, use “"route":{"id":""} or "route":{"name":""}.
serviceoptionalIf set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched. Defaults to null.With form-encoded, the notation is service.id= or service.name=. With JSON, use “"service":{"id":""} or "service":{"name":""}.
consumeroptionalIf set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated consumer. Defaults to null.With form-encoded, the notation is consumer.id= or consumer.username=. With JSON, use “"consumer":{"id":""} or "consumer":{"username":""}.
configoptionalThe configuration properties for the Plugin which can be found on the plugins documentation page in the Kong Hub.
protocolsrequiredA list of the request protocols that will trigger this plugin. The default value, as well as the possible values allowed on this field, may change depending on the plugin type. For example, plugins that only work in stream mode will only support "tcp" and "tls". Defaults to ["grpc", "grpcs", "http", "https"].
enabledoptionalWhether the plugin is applied. Defaults to true.
tagsoptionalAn optional set of strings associated with the Plugin, for grouping and filtering.

Request Body

{"config"=>{"minute"=>20, "policy"=>"cluster", "month"=>nil, "redis_timeout"=>2000, "limit_by"=>"consumer", "hide_client_headers"=>false, "second"=>nil, "day"=>nil, "redis_password"=>nil, "year"=>nil, "redis_database"=>0, "hour"=>500, "redis_port"=>6379, "redis_host"=>nil, "fault_tolerant"=>true}, "service"=>nil, "enabled"=>true, "protocols"=>["https", "http"], "name"=>"rate-limiting", "consumer"=>nil, "route"=>{"id"=>"875973fd-ba3f-4c7b-8301-e9263013e6d2"}, "tags"=>["admin", "high-priority", "critical"]}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{"config":{"minute":20,"policy":"cluster","month":null,"redis_timeout":2000,"limit_by":"consumer","hide_client_headers":false,"second":null,"day":null,"redis_password":null,"year":null,"redis_database":0,"hour":500,"redis_port":6379,"redis_host":null,"fault_tolerant":true},"service":null,"enabled":true,"protocols":["https","http"],"name":"rate-limiting","consumer":null,"route":{"id":"875973fd-ba3f-4c7b-8301-e9263013e6d2"},"tags":["admin","high-priority","critical"]}