---
title: "Create a new Plugin associated with a route"
url: "https://nov18-dev.movespot.fyi/apis/konnect-runtime-groups-configuration-0/versions/af18902c-58f1-49d7-8ec2-9987b4e0d1bd/operations/create-plugin-for-route"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-runtime-groups-configuration-0/versions/af18902c-58f1-49d7-8ec2-9987b4e0d1bd.md

# Create a new Plugin associated with a route

`POST` `/runtime-groups/{runtimeGroupId}/core-entities/routes/{route_id}/plugins`

Operation ID: `create-plugin-for-route`

Create a new Plugin associated with a route

## Path parameters

- `route_id` (string, required) - The unique identifier or the name of the route to retrieve.
- `runtimeGroupId` (string, required) - The ID of your runtime group. This variable is available in the Konnect manager

## Request body

Content types: `application/json`

## Responses

- `200` - Example response
- `400` - Invalid Plugin

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Konnect Runtime Groups Configuration
  version: 0.0.1
servers:
  - url: https://us.api.konghq.com/v2
    description: United-States Production region
  - url: https://eu.api.konghq.com/v2
    description: Europe Production region
  - url: https://au.api.konghq.com/v2
    description: Australia Production region
  - url: https://me.api.konghq.com/v2
    description: Middle-East Production region
  - url: https://in.api.konghq.com/v2
    description: India Production region
  - url: https://sg.api.konghq.com/v2
    description: Singapore Production region
paths:
  /runtime-groups/{runtimeGroupId}/core-entities/routes/{route_id}/plugins:
    parameters:
      - $ref: "#/components/parameters/route_id"
      - $ref: "#/components/parameters/runtimeGroupId"
    post:
      operationId: create-plugin-for-route
      summary: Create a new Plugin associated with a route
      description: Create a new Plugin associated with a route
      requestBody:
        $ref: "#/components/requestBodies/plugin-request"
      responses:
        "200":
          $ref: "#/components/responses/plugin-response"
        "400":
          description: Invalid Plugin
          content:
            application/json:
              schema:
                type: object
      tags:
        - Plugins
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  parameters:
    route_id:
      name: route_id
      in: path
      required: true
      schema:
        type: string
        example: e94215b0-9198-42ce-bf0b-98afff31b2a7
      description: The unique identifier or the name of the route to retrieve.
    runtimeGroupId:
      name: runtimeGroupId
      in: path
      required: true
      schema:
        type: string
        example: 9524ec7d-36d9-465d-a8c5-83a3c9390458
      description: The ID of your runtime group. This variable is available in the
        Konnect manager
  requestBodies:
    plugin-request:
      content:
        application/json:
          schema:
            type: object
            properties:
              name:
                description: The name of the Plugin that’s going to be added. Currently, the
                  Plugin must be installed in every Kong instance separately.
                type: string
                example: rate-limiting
                nullable: true
              route:
                description: "If set, the plugin will only activate when receiving requests via
                  the specified route. Leave unset for the plugin to activate
                  regardless of the route being used. Default: `null`.With
                  form-encoded, the notation is `route.id=<route id> or
                  route.name=<route name>`. With JSON, use `route:{id:<route
                  id>}` or `route:{name:<route name>}`."
                type: object
                properties:
                  id:
                    description: The Id of the route.
                    type: string
                    example: a2e013e8-7623-4494-a347-6d29108ff68b
              service:
                description: If set, the plugin will only activate when receiving requests via
                  one of the routes belonging to the specified service.
                type: object
                nullable: true
                properties:
                  id:
                    description: The Id of the route.
                    type: string
                    example: a2e013e8-7623-4494-a347-6d29108ff68b
              instance_name:
                description: |
                  The Plugin instance name.
                type: string
                example: rate-limiting-foo
              config:
                description: The configuration properties for the Plugin
                type: object
                properties:
                  hour:
                    type: integer
                    example: 500
                  minute:
                    type: integer
                    example: 500
              protocols:
                description: A list of the request protocols that will trigger this plugin.
                type: array
                items:
                  type: string
                  enum:
                    - http
                    - grpc
                    - grpcs
                    - tls
                    - tcp
                  default: http
              enabled:
                description: |
                  Whether the plugin is applied. Default: `true`.
                type: boolean
                default: true
              tags:
                description: >
                  An optional set of strings associated with the Plugin for
                  grouping and filtering.
                type: array
                items:
                  type: string
            x-examples:
              Example 1:
                name: rate-limiting
                route: null
                service: null
                consumer: null
                instance_name: rate-limiting-foo
                config:
                  hour: 500
                  minute: 20
                protocols:
                  - http
                  - https
                enabled: true
                tags:
                  - user-level
                  - low-priority
                ordering:
                  before:
                    - plugin-name
          examples:
            request example:
              value:
                name: rate-limiting
                consumer: string
                instance_name: rate-limiting-foo
                config:
                  hour: 500
                  minute: 500
                protocols:
                  - http
                enabled: true
                tags:
                  - string
      description: Plugin request body
  responses:
    plugin-response:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
              name:
                description: The name of the Plugin that’s going to be added. Currently, the
                  Plugin must be installed in every Kong instance separately.
                type: string
                example: rate-limiting
              created_at:
                description: Unix epoch when the resource was created.
                type: integer
              route:
                description: "If set, the plugin will only activate when receiving requests via
                  the specified route. Leave unset for the plugin to activate
                  regardless of the route being used. Default: `null`.With
                  form-encoded, the notation is `route.id=<route id> or
                  route.name=<route name>`. With JSON, use `route:{id:<route
                  id>}` or `route:{name:<route name>}`."
                type: string
                nullable: true
              service:
                description: If set, the plugin will only activate when receiving requests via
                  one of the routes belonging to the specified service.
                type: string
                nullable: true
              consumer:
                description: If set, the plugin will activate only for requests where the
                  specified has been authenticated. (Note that some plugins can
                  not be restricted to consumers this way.)
                type: string
                nullable: true
              instance_name:
                description: |
                  The Plugin instance name.
                type: string
                example: rate-limiting-foo
              config:
                description: The configuration properties for the Plugin
                type: object
                properties:
                  hour:
                    type: integer
                    example: 500
                  minute:
                    type: integer
                    example: 500
              protocols:
                description: A list of the request protocols that will trigger this plugin.
                type: array
                items:
                  type: string
                  enum:
                    - http
                    - grpc
                    - grpcs
                    - tls
                    - tcp
                  default: http
              enabled:
                description: |
                  Whether the plugin is applied. Default: `true`.
                type: boolean
                default: true
              tags:
                description: >
                  An optional set of strings associated with the Plugin for
                  grouping and filtering.
                type: array
                items:
                  type: string
          x-examples:
            Example 1:
              id: ce44eef5-41ed-47f6-baab-f725cecf98c7
              name: rate-limiting
              created_at: 1422386534
              route: null
              service: null
              consumer: null
              instance_name: rate-limiting-foo
              config:
                hour: 500
                minute: 20
              protocols:
                - http
                - https
              enabled: true
              tags:
                - user-level
                - low-priority
              ordering:
                before:
                  - plugin-name
          examples:
            Plugin response:
              value:
                data:
                  - id: 02621eee-8309-4bf6-b36b-a82017a5393e
                    name: rate-limiting
                    created_at: 1422386534
                    route: null
                    service: null
                    consumer: null
                    config:
                      hour: 500
                      minute: 20
                    protocols:
                      - http
                      - https
                    enabled: true
                    tags:
                      - user-level
                      - low-priority
                    ordering:
                      before:
                        - plugin-name
                  - id: 66c7b5c4-4aaf-4119-af1e-ee3ad75d0af4
                    name: rate-limiting
                    created_at: 1422386534
                    route: null
                    service: null
                    consumer: null
                    config:
                      hour: 500
                      minute: 20
                    protocols:
                      - tcp
                      - tls
                    enabled: true
                    tags:
                      - admin
                      - high-priority
                      - critical
                next: http://localhost:8001/plugins?offset=6378122c-a0a1-438d-a5c6-efabae9fb969
  securitySchemes:
    konnectAccessToken:
      type: http
      scheme: bearer
      description: >-
        The Konnect access token is meant to be used by the Konnect dashboard
        and the decK CLI to

        authenticate with.
    personalAccessToken:
      type: http
      scheme: bearer
      description: The personal access token is meant to be used as an alternative to
        basic-auth when accessing Konnect via APIs. You can generate a Personal
        Access Token (PAT) from the personal access token page in the Konnect
        dashboard.
```
