List request audit logs

You can access request and database audit logs through the Admin API.
The default order of audit log is by request timestamp - latest to oldest.
For usage examples, see Audit Logging in Kong Gateway.

get
{protocol}://{hostname}:{port}{path}/audit/requests

Query Parameters

before_audit_log_filterOne Of

Before filter could be used to request audit log data that was recorded before certain time (exclusive).
It can either be a timestamp as Unix Epoch or a string following RFC3339 Schema (without fractions of a second) - ex: ‘2024-04-25T15:03:24Z’

Variant 1string

Match pattern:^(\d+|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z)$

after_audit_log_filterOne Of

After filter could be used to request audit log data that was recorded after certain time (inclusive).
It can either be a timestamp as Unix Epoch or a string following RFC3339 Schema (without fractions of a second) - ex: ‘2024-04-25T15:03:24Z’

Variant 1string

Match pattern:^(\d+|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z)$

Response

application/json

Example response generated for checking the /status endpoint without RBAC enabled.

dataarray[object]

The client IP address

Show Child Parameters
totalinteger
get/audit/requests
 
application/json

List database audit logs

List database audit logs (ordered by request timestamp - latest to oldest)

get
{protocol}://{hostname}:{port}{path}/audit/objects

Query Parameters

before_audit_log_filterOne Of

Before filter could be used to request audit log data that was recorded before certain time (exclusive).
It can either be a timestamp as Unix Epoch or a string following RFC3339 Schema (without fractions of a second) - ex: ‘2024-04-25T15:03:24Z’

Variant 1string

Match pattern:^(\d+|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z)$

after_audit_log_filterOne Of

After filter could be used to request audit log data that was recorded after certain time (inclusive).
It can either be a timestamp as Unix Epoch or a string following RFC3339 Schema (without fractions of a second) - ex: ‘2024-04-25T15:03:24Z’

Variant 1string

Match pattern:^(\d+|\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z)$

Response

application/json

Example response for a consumer creation log entry

idstring
get/audit/objects
 
application/json

List all event hooks

List all event hooks and return information about the event hooks.

get
{protocol}://{hostname}:{port}{path}/event-hooks

Response

application/json

Example event hooks response

dataarray[object]
Show Child Parameters
nextstring
get/event-hooks
 
application/json

Add a webhook

Add a webhook

post
{protocol}://{hostname}:{port}{path}/event-hooks

Body

application/json

Request body for adding a webhook

eventstring

A string describing the Kong entity the event hook listens to for events.

Example:consumers

handlerstringrequired

A string describing one of four handler options: webhook, webhook-custom, log, or lambda.

Example:webhook

sourcestringrequired

A string describing the action that triggers the event hook.

Example:crud

snoozeinteger

An optional integer describing the time in seconds to delay an event trigger to avoid spamming an integration.

Default:0

Example:0

on_changeboolean

An optional boolean indicating whether to trigger an event when key parts of a payload have changed.

config.urlstringrequired

The URL the JSON POST request is made to with the event data as the payload.

Example:https://webhook.site/a1b2c3-d4e5-g6h7-i8j9-k1l2m3n4o5p6

config.headersobject

An object defining additional HTTP headers to send in the webhook request. For example {"X-Custom-Header": "My Value"}.

Show Child Parameters
config.secretstring

An optional string used to sign the remote webhook for remote verification. When set, Kong signs the body of the event hook with HMAC-SHA1 and includes it in a header, x-kong-signature, sent to the remote endpoint.

config.ssl_verifystring

A boolean indicating whether to verify the SSL certificate of the remote HTTPS server where the event hook will be sent. The default is false.

Response

application/json

Example event hooks response

dataarray[object]
Show Child Parameters
nextstring
post/event-hooks

Body

{
"event": "consumers",
"handler": "webhook",
"source": "crud",
"snooze": 0,
"on_change": true,
"config.url": "https://webhook.site/a1b2c3-d4e5-g6h7-i8j9-k1l2m3n4o5p6",
"config.headers": {
"headers": "string"
},
"config.secret": "string",
"config.ssl_verify": "string"
}
 
application/json

List all sources

Sources are the actions that trigger the event hook. The /sources JSON output follows the following pattern:

  • 1st level = The source, which is the action that triggers the event hook.
  • 2nd level = The event, which is the Kong entity the event hook listens to for events.
  • 3rd level = The available template parameters for use in webhook-custom payloads.

For instance, in the example below balancer is the source, health is the event, and upstream_id, ip, port, hostname, and health are the available template parameters.

get
{protocol}://{hostname}:{port}{path}/event-hooks/sources

Response

application/json

OK

dataobject
Show Child Parameters
get/event-hooks/sources
 
application/json