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

# Update a template

> Partial update of an active template. The `slug` is frozen — renaming changes only the display name, never the address. `columns` is a full replacement of the column set when present; cross-cell rules stored on the template are always preserved. Edits are refused with `409` while a migration that uses the template is running. `grouping` organises the template list in the dashboard and is not returned by template reads.



## OpenAPI

````yaml /api-reference/openapi.json patch /templates/{template_slug}
openapi: 3.1.0
info:
  title: Vern Migration API
  version: 1.0.0
  description: >-
    Run Vern as a headless migration engine. Create a migration, upload a
    customer's files, run the managed agent to generate a preview, then execute
    and export clean data. See the Migration API guides for concepts and
    walkthroughs.
servers:
  - url: https://app.vern.so/api/v1
security:
  - apiKey: []
tags:
  - name: Catalog
    description: Discover the sources and templates you set up in the Vern UI.
  - name: Migrations
    description: Create a migration workspace and upload a customer's files.
  - name: Runs
    description: 'Drive the managed agent: generate, refine, execute, answer, and observe.'
  - name: Export
    description: Download a migration's validated data as CSV.
  - name: Log
    description: The settled record of what a migration did.
  - name: Knowledge
    description: Durable context the agent reads before every run.
  - name: Exports
    description: Download imported data.
  - name: Extractions
    description: >-
      Turn an unstructured file into structured data, without running a
      migration.
paths:
  /templates/{template_slug}:
    patch:
      tags:
        - Catalog
      summary: Update a template
      description: >-
        Partial update of an active template. The `slug` is frozen — renaming
        changes only the display name, never the address. `columns` is a full
        replacement of the column set when present; cross-cell rules stored on
        the template are always preserved. Edits are refused with `409` while a
        migration that uses the template is running. `grouping` organises the
        template list in the dashboard and is not returned by template reads.
      operationId: updateTemplate
      parameters:
        - name: template_slug
          in: path
          required: true
          schema:
            type: string
          example: contacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              minProperties: 1
              properties:
                name:
                  type: string
                  description: New display name. Does not change the slug.
                description:
                  type:
                    - string
                    - 'null'
                  description: The template's knowledge / description. `null` clears it.
                grouping:
                  type:
                    - string
                    - 'null'
                  description: Free-text group label for the dashboard. `null` clears it.
                columns:
                  type: array
                  minItems: 1
                  description: Full replacement of the column set.
                  items:
                    type: object
                    required:
                      - name
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      required:
                        type: boolean
                      unique:
                        type: boolean
                      desiredRule:
                        type: string
                      strictRule:
                        type: string
                        description: Regex pattern for strict validation.
            example:
              description: Suppliers master list. One row per active supplier.
              columns:
                - name: Supplier Name
                  description: Legal entity name
                  required: true
                - name: ABN
                  description: Australian Business Number
                  required: false
                  desiredRule: strict
                  strictRule: ^\d{11}$
      responses:
        '200':
          description: The updated template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/TemplateNotFound'
        '409':
          $ref: '#/components/responses/TemplateLocked'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Template:
      type: object
      properties:
        slug:
          type: string
          description: Stable public identifier.
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        columns:
          type: array
          items:
            $ref: '#/components/schemas/TemplateColumn'
    TemplateColumn:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        required:
          type: boolean
        unique:
          type: boolean
        desiredRule:
          type: string
          enum:
            - none
            - ai
            - strict
            - link
        strictRule:
          type: string
          description: Regex the value must match (when desiredRule is strict).
        linkRule:
          type: array
          items:
            type: object
            properties:
              templateId:
                type: string
              columnName:
                type: string
          description: Cross-template references (when desiredRule is link).
    Error:
      type: object
      properties:
        error:
          type: string
          description: A human-readable error message.
      required:
        - error
  responses:
    BadRequest:
      description: Malformed request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: API key missing, malformed, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TemplateNotFound:
      description: No active template with this slug in your organisation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TemplateLocked:
      description: >-
        A migration that uses this template is currently running; edits are
        refused until it settles.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit hit — back off and retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Too many requests
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Vern API key. Create one at Settings → API keys.

````