Plugins

Create a new Plugin

Create a new Plugin

post/v2/control-planes/{controlPlaneId}/core-entities/plugins

Request body

conditionstring nullable

An expression used for conditional control over plugin execution. If the expression evaluates to true during the request flow, the plugin is executed; otherwise, it is skipped.

configobject nullable

The configuration properties for the Plugin which can be found on the plugins documentation page in the Kong Hub.

created_atinteger nullable

Unix epoch when the resource was created.

enabledboolean nullable

Whether the plugin is applied.

idstring nullable

A string representing a UUID (universally unique identifier).

instance_namestring nullable

A unique string representing a UTF-8 encoded name.

namestring required

The name of the Plugin that's going to be added. Currently, the Plugin must be installed in every Kong instance separately.

protocolsstring[] nullable

A 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".

tagsstring[] nullable

An optional set of strings associated with the Plugin for grouping and filtering.

updated_atinteger nullable

Unix epoch when the resource was last updated.

Example request

{
  "config": {
    "anonymous": null,
    "hide_credentials": false,
    "key_in_body": false,
    "key_in_header": true,
    "key_in_query": true,
    "key_names": [
      "apikey"
    ],
    "run_on_preflight": true
  },
  "enabled": true,
  "id": "3fd1eea1-885a-4011-b986-289943ff8177",
  "name": "key-auth",
  "partials": [
    {
      "id": "cff1230a-00f7-4ae8-b376-c370f0eb4dae",
      "name": "foo-partial",
      "path": "config.redis"
    },
    {
      "id": "129ee345-cba8-4e55-9d6d-93c223ff91ae",
      "name": "bar-partial",
      "path": "config.redis"
    }
  ],
  "protocols": [
    "grpc",
    "grpcs",
    "http",
    "https"
  ]
}

Response

Successfully created Plugin

conditionstring nullable

An expression used for conditional control over plugin execution. If the expression evaluates to true during the request flow, the plugin is executed; otherwise, it is skipped.

configobject nullable

The configuration properties for the Plugin which can be found on the plugins documentation page in the Kong Hub.

created_atinteger nullable

Unix epoch when the resource was created.

enabledboolean nullable

Whether the plugin is applied.

idstring nullable

A string representing a UUID (universally unique identifier).

instance_namestring nullable

A unique string representing a UTF-8 encoded name.

namestring required

The name of the Plugin that's going to be added. Currently, the Plugin must be installed in every Kong instance separately.

protocolsstring[] nullable

A 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".

tagsstring[] nullable

An optional set of strings associated with the Plugin for grouping and filtering.

updated_atinteger nullable

Unix epoch when the resource was last updated.

Example response

{
  "config": {
    "anonymous": null,
    "hide_credentials": false,
    "key_in_body": false,
    "key_in_header": true,
    "key_in_query": true,
    "key_names": [
      "apikey"
    ],
    "run_on_preflight": true
  },
  "enabled": true,
  "id": "3fd1eea1-885a-4011-b986-289943ff8177",
  "name": "key-auth",
  "partials": [
    {
      "id": "cff1230a-00f7-4ae8-b376-c370f0eb4dae",
      "name": "foo-partial",
      "path": "config.redis"
    },
    {
      "id": "129ee345-cba8-4e55-9d6d-93c223ff91ae",
      "name": "bar-partial",
      "path": "config.redis"
    }
  ],
  "protocols": [
    "grpc",
    "grpcs",
    "http",
    "https"
  ]
}

Changes

Changed in 6 of the 75 revisions of this API.1615

    • added the new optional request property condition

      new-optional-request-property

    • added the optional property condition to the response with the 201 status

      response-optional-property-added

    • the request property ordering/after became not nullable

      request-property-became-not-nullable

    • the request property ordering/after/access became not nullable

      request-property-became-not-nullable

    • the request property ordering/before became not nullable

      request-property-became-not-nullable

    • the request property ordering/before/access became not nullable

      request-property-became-not-nullable

    • the request property partials/items/name became not nullable

      request-property-became-not-nullable

    • the request property partials/items/path became not nullable

      request-property-became-not-nullable

    • the id request property's minLength was increased from 0 to 1

      request-property-min-length-increased

    • the name request property's minLength was increased from 0 to 1

      request-property-min-length-increased

    • the partials/items/id request property's minLength was increased from 0 to 1

      request-property-min-length-increased

  • 3c0154b2053a68See the full diff
    • the response property ordering/after became nullable for the status 201

      response-property-became-nullable

    • the response property ordering/after/access became nullable for the status 201

      response-property-became-nullable

    • the response property ordering/before became nullable for the status 201

      response-property-became-nullable

    • the response property ordering/before/access became nullable for the status 201

      response-property-became-nullable

    • the response property partials/items/name became nullable for the status 201

      response-property-became-nullable

    • the response property partials/items/path became nullable for the status 201

      response-property-became-nullable

    • the request property ordering/after became nullable

      request-property-became-nullable

    • the request property ordering/after/access became nullable

      request-property-became-nullable

    • the request property ordering/before became nullable

      request-property-became-nullable

    • the request property ordering/before/access became nullable

      request-property-became-nullable

    • the request property partials/items/name became nullable

      request-property-became-nullable

    • the request property partials/items/path became nullable

      request-property-became-nullable

    • the enabled request property default value true was added

      request-property-default-value-added

    • the enabled response's property default value true was added for the status 201

      response-property-default-value-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the enabled request property default value true was removed

      request-property-default-value-removed

    • the enabled response's property default value true was removed for the status 201

      response-property-default-value-removed

    This revision also has 15 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 76b0fefddb0d13See the full diff
    • the response property tags became nullable for the status 201

      response-property-became-nullable

    • the request property tags became nullable

      request-property-became-nullable

    • the enabled request property default value true was added

      request-property-default-value-added

    • the enabled response's property default value true was added for the status 201

      response-property-default-value-added