Skip to main content
Version: 2.5




request-id plugin adds a unique ID (UUID) to each request proxied through APISIX. This plugin can be used to track an API request. The plugin will not add a request id if the header_name is already present in the request.


header_namestringoptional"X-Request-Id"Request ID header name
include_in_responsebooleanoptionalfalseOption to include the unique request ID in the response header

How To Enable#

Create a route and enable the request-id plugin on the route:

curl -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '{    "uri": "/hello",    "plugins": {        "request-id": {            "include_in_response": true        }    },    "upstream": {        "type": "roundrobin",        "nodes": {            "": 1        }    }}'

Test Plugin#

$ curl -i 200 OKX-Request-Id: fe32076a-d0a5-49a6-a361-6c244c1df956......

Disable Plugin#

Remove the corresponding json configuration in the plugin configuration to disable the request-id. APISIX plugins are hot-reloaded, therefore no need to restart APISIX.

curl -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '{    "uri": "/get",    "plugins": {    },    "upstream": {        "type": "roundrobin",        "nodes": {            "": 1        }    }}'