v11

latestOpenAPI 3.1.0Apache 2.0raw.githubusercontent.com2026-07-065662751.8 MB
CustomPlugins

Create a new CustomPlugin

Create a new CustomPlugin

post/custom-plugins

Request body

created_atinteger nullable

Unix epoch when the resource was created.

handlerstring required

The handler for the given custom plugin.

idstring nullable

A string representing a UUID (universally unique identifier).

namestring required

The name to associate with the given custom plugin. Consider using a distinct prefix for custom plugins to avoid naming conflicts with new bundled plugins in future Kong releases.

schemastring required

The schema for the given custom plugin.

tagsstring[] nullable

A set of strings representing tags.

updated_atinteger nullable

Unix epoch when the resource was last updated.

Example request

{
  "handler": "return { VERSION = '1.0,0', PRIORITY = 500, access = function(self, config) kong.service.request.set_header(config.name, config.value) end }",
  "id": "868346aa-1105-4b77-8346-aa1105fb77c4",
  "name": "set-header",
  "schema": "return { name = 'set-header', fields = { { protocols = require('kong.db.schema.typedefs').protocols_http }, { config = { type = 'record', fields = { { name = { description = 'The name of the header to set.', type = 'string', required = true } }, { value = { description = 'The value for the header.', type = 'string', required = true } } } } } } }"
}

Response

Successfully created CustomPlugin

created_atinteger nullable

Unix epoch when the resource was created.

handlerstring required

The handler for the given custom plugin.

idstring nullable

A string representing a UUID (universally unique identifier).

namestring required

The name to associate with the given custom plugin. Consider using a distinct prefix for custom plugins to avoid naming conflicts with new bundled plugins in future Kong releases.

schemastring required

The schema for the given custom plugin.

tagsstring[] nullable

A set of strings representing tags.

updated_atinteger nullable

Unix epoch when the resource was last updated.

Example response

{
  "handler": "return { VERSION = '1.0,0', PRIORITY = 500, access = function(self, config) kong.service.request.set_header(config.name, config.value) end }",
  "id": "868346aa-1105-4b77-8346-aa1105fb77c4",
  "name": "set-header",
  "schema": "return { name = 'set-header', fields = { { protocols = require('kong.db.schema.typedefs').protocols_http }, { config = { type = 'record', fields = { { name = { description = 'The name of the header to set.', type = 'string', required = true } }, { value = { description = 'The value for the header.', type = 'string', required = true } } } } } } }"
}