Event metadata

Last updated: 1 minute read.

When Tyk generates an event it will compile the following metadata that is passed to the event handler:

  • Message (string): a human readable message from Tyk Gateway that adds detail about the event
  • Path (string): the path of the API endpoint request that led to the event being fired
  • Origin (string): origin data for the source of the request (if this exists)
  • Key (string): the key that was used in the request
  • OriginatingRequest (string): Based64-encoded raw inbound request

Note

Circuit breaker events provide different metadata, see Circuit Breakers to see what is provided when the BreakerTripped, BreakerReset or BreakerTriggered events are generated.

Using the metadata

The metadata are exposed so that they can be used by the event handler (webhook or custom) using Go templating. For details of how each type of event handler can access these data, please see the appropriate section for webhook or custom event handlers.

Raw Request Data

The OriginatingRequest metadata is a Base64-encoded wire-protocol representation of the original request to the event handler. If you are running a service bus or queue that stores failed, throttled or other types of requests, you can decode this object and parse it in order to re-create the original intent of the request (e.g. for post-processing).