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

# Update many templates

> Renames up to 500 templates in one request. Each item has the `id` of a template and the fields of an update. The API returns a result for each item, in the sequence of the items. Needs the `templates:write` scope.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/templates/update-many
openapi: 3.1.0
info:
  title: VMS API
  version: 1.0.0
  description: >-
    The public API of a VMS workspace. Each request needs an API key of the
    workspace in the Authorization header.
servers:
  - url: https://vms.dev/api
    description: The VMS API
security:
  - apiKey: []
paths:
  /v1/templates/update-many:
    post:
      tags:
        - Templates
      summary: Update many templates
      description: >-
        Renames up to 500 templates in one request. Each item has the `id` of a
        template and the fields of an update. The API returns a result for each
        item, in the sequence of the items. Needs the `templates:write` scope.
      operationId: updateManyTemplates
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateManyTemplatesBody'
      responses:
        '200':
          description: A result for each item.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateBulkResult'
        '400':
          description: The request is not valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: The API key is missing, not correct, revoked, or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The API key does not have the scope of the endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: The API key sent more than 1,200 requests in one minute.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UpdateManyTemplatesBody:
      type: object
      properties:
        items:
          minItems: 1
          maxItems: 500
          type: array
          items:
            $ref: '#/components/schemas/UpdateTemplateItem'
      required:
        - items
    TemplateBulkResult:
      type: object
      properties:
        succeeded:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        failed:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        message:
          type:
            - string
            - 'null'
        data:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
                minimum: -9007199254740991
                maximum: 9007199254740991
              id:
                type:
                  - string
                  - 'null'
              error:
                type:
                  - string
                  - 'null'
            required:
              - index
              - id
              - error
            additionalProperties: false
      required:
        - succeeded
        - failed
        - message
        - data
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: no_capacity
            message:
              type: string
            requestId:
              type:
                - string
                - 'null'
            retryAfterSeconds:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            sandboxId:
              description: The sandbox that the error is about.
              type: string
          required:
            - code
            - message
            - requestId
          additionalProperties: false
      required:
        - error
      additionalProperties: false
    UpdateTemplateItem:
      type: object
      properties:
        name:
          description: The new name.
          type: string
          pattern: ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$
          example: node-22-base
        id:
          type: string
          minLength: 1
          example: tpl_06d8k3m7q2v9x4b1n5c0e8f2ja
      required:
        - id
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: An API key that starts with vms_. Make one in Settings > API keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.