---
title: "Create or update a custom plugin schema"
url: "https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-dev-3/versions/76e259e8-9e78-4c0e-ab4a-3df25bddc4f1/operations/update-plugin-schemas"
---

> Full API specification: https://nov18-dev.movespot.fyi/apis/konnect-control-planes-configuration-dev-3/versions/76e259e8-9e78-4c0e-ab4a-3df25bddc4f1.md

# Create or update a custom plugin schema

`PUT` `/control-planes/{controlPlaneId}/core-entities/plugin-schemas/{name}`

Operation ID: `update-plugin-schemas`

Create or update an individual custom plugin schema.

## Path parameters

- `controlPlaneId` (string, uuid, required) - The UUID of your control plane. This variable is available in the Konnect manager.
- `name` (string, required) - The custom plugin name

## Request body

Content types: `application/json`

## Responses

- `200` - A response for a single custom plugin schema.
- `400` - Forbidden
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Forbidden

## OpenAPI definition

```yaml
openapi: 3.1.0
info:
  title: Konnect Control Planes Configuration
  version: 3.14.0
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:
  /control-planes/{controlPlaneId}/core-entities/plugin-schemas/{name}:
    parameters:
      - $ref: "#/components/parameters/controlPlaneId"
      - name: name
        in: path
        description: The custom plugin name
        required: true
        schema:
          type: string
          example: myplugin
    put:
      operationId: update-plugin-schemas
      summary: Create or update a custom plugin schema
      description: Create or update an individual custom plugin schema.
      requestBody:
        $ref: "#/components/requestBodies/create-plugin-schemas"
      responses:
        "200":
          $ref: "#/components/responses/plugin-schemas"
        "400":
          $ref: "#/components/responses/KonnectCPLegacyBadRequest"
        "401":
          $ref: "#/components/responses/KonnectCPLegacyUnauthorized"
        "403":
          $ref: "#/components/responses/KonnectCPLegacyForbidden"
        "404":
          $ref: "#/components/responses/KonnectCPLegacyNotFound"
      tags:
        - Custom Plugin Schemas
security:
  - konnectAccessToken: []
  - personalAccessToken: []
components:
  parameters:
    controlPlaneId:
      name: controlPlaneId
      in: path
      required: true
      schema:
        type: string
        format: uuid
        example: 9524ec7d-36d9-465d-a8c5-83a3c9390458
      description: The UUID of your control plane. This variable is available in the
        Konnect manager.
  requestBodies:
    create-plugin-schemas:
      content:
        application/json:
          schema:
            type: object
            properties:
              lua_schema:
                description: |
                  The custom plugin schema; `jq -Rs '.' schema.lua`.
                type: string
                example: return { name = "myplugin", fields = { { config = { type = "record",
                  fields = { } } } } }
              managed_by:
                description: Arbitrary JSON data for client responsible for managing the entity.
                  Konnect only field, not synced to the Gateway.
                type: object
                additionalProperties: true
                nullable: true
            required:
              - lua_schema
            x-examples:
              Example 1:
                lua_schema: return { name = \"myplugin\", fields = { { config = { type =
                  \"record\", fields = { } } } } }
  responses:
    plugin-schemas:
      description: A response for a single custom plugin schema.
      content:
        application/json:
          schema:
            type: object
            properties:
              item:
                type: object
                properties:
                  lua_schema:
                    description: The custom plugin schema; `jq -Rs '.' schema.lua`.
                    type: string
                    example: return { name = \"myplugin\", fields = { { config = { type =
                      \"record\", fields = { } } } } }
                  name:
                    description: The custom plugin name determined by the custom plugin schema.
                    type: string
                    example: myplugin
                  created_at:
                    description: An ISO-8604 timestamp representation of custom plugin schema
                      creation date.
                    type: integer
                    example: 1422386534
                  updated_at:
                    description: An ISO-8604 timestamp representation of custom plugin schema update
                      date.
                    type: integer
                    example: 1422412345
    KonnectCPLegacyBadRequest:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/KonnectCPLegacyBadRequestError"
          examples:
            UnauthorizedExample:
              $ref: "#/components/examples/KonnectCPLegacyBadRequestExample"
    KonnectCPLegacyUnauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/KonnectCPLegacyUnauthorizedError"
          examples:
            UnauthorizedExample:
              $ref: "#/components/examples/KonnectCPLegacyUnauthorizedExample"
    KonnectCPLegacyForbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/KonnectCPLegacyForbiddenError"
          examples:
            UnauthorizedExample:
              $ref: "#/components/examples/KonnectCPLegacyForbiddenExample"
    KonnectCPLegacyNotFound:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/KonnectCPLegacyNotFoundError"
          examples:
            UnauthorizedExample:
              $ref: "#/components/examples/KonnectCPLegacyNotFoundExample"
  schemas:
    KonnectCPLegacyBadRequestError:
      allOf:
        - $ref: "#/components/schemas/KonnectCPLegacyBaseError"
        - type: object
          properties:
            message:
              example: Bad Request
    KonnectCPLegacyUnauthorizedError:
      allOf:
        - $ref: "#/components/schemas/KonnectCPLegacyBaseError"
        - type: object
          properties:
            message:
              example: Unauthorized
    KonnectCPLegacyForbiddenError:
      allOf:
        - $ref: "#/components/schemas/KonnectCPLegacyBaseError"
        - type: object
          properties:
            message:
              example: Forbidden
    KonnectCPLegacyNotFoundError:
      allOf:
        - $ref: "#/components/schemas/KonnectCPLegacyBaseError"
        - type: object
          properties:
            message:
              example: Not Found
    KonnectCPLegacyBaseError:
      description: standard error
      type: object
      properties:
        message:
          description: |
            A short summary of the problem.
          type: string
          readOnly: true
      title: Error
  examples:
    KonnectCPLegacyBadRequestExample:
      value:
        message: Bad Request
    KonnectCPLegacyUnauthorizedExample:
      value:
        message: Unauthorized
    KonnectCPLegacyForbiddenExample:
      value:
        message: Forbidden
    KonnectCPLegacyNotFoundExample:
      value:
        message: Not Found
  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.
```
