> ## Documentation Index
> Fetch the complete documentation index at: https://tyk.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a governed metadata schema



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml patch /metadata/schemas/{id}
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /metadata/schemas/{id}:
    patch:
      tags:
        - governed-metadata
      summary: Update a governed metadata schema
      parameters:
        - name: id
          in: path
          description: Schema ID
          required: true
          schema:
            type: integer
      requestBody:
        description: Schema
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/api.MetadataSchemaInput'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: object
                additionalProperties: true
components:
  schemas:
    api.MetadataSchemaInput:
      type: object
      properties:
        data:
          type: object
          properties:
            attributes:
              type: object
              properties:
                active:
                  type: boolean
                applies_to:
                  type: array
                  items:
                    type: string
                description:
                  type: string
                enforcement:
                  type: string
                fields:
                  type: array
                  items:
                    $ref: '#/components/schemas/models.MetadataFieldDef'
                name:
                  type: string
                order:
                  type: integer
                slug:
                  type: string
            type:
              type: string
    models.MetadataFieldDef:
      type: object
      properties:
        description:
          type: string
        gateway_visible:
          type: boolean
        key:
          type: string
        label:
          type: string
        max:
          type: number
        max_length:
          type: integer
        min:
          type: number
        order:
          type: integer
        pattern:
          type: string
        portal_visible:
          type: boolean
        required:
          type: boolean
        required_on_publish:
          type: boolean
          description: >-
            RequiredOnPublish makes the field mandatory only when the object
            goes

            live (activate / enable): a submitter can save a draft without it,
            but

            the publish is refused until it is filled. Independent of Required.
        severity:
          type: string
          description: error (default) | warning
        type:
          type: string
        vocabulary_slug:
          type: string
        warn_if_past:
          type: boolean
          description: 'date fields: warn when the value is in the past'

````