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

# Patch template

> update a template



## OpenAPI

````yaml /swagger.json patch /template/{templateId}
openapi: 3.0.0
info:
  version: 1.0.0
  title: Teable App
  description: Manage Data as easy as drink a cup of tea
  x-logo:
    backgroundColor: '#F0F0F0'
    altText: Teable logo
servers:
  - url: https://app.teable.ai/api
security: []
paths:
  /template/{templateId}:
    patch:
      tags:
        - template
      description: update a template
      parameters:
        - schema:
            type: string
          required: true
          name: templateId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                categoryId:
                  type: array
                  items:
                    type: string
                cover:
                  type: object
                  nullable: true
                  properties:
                    token:
                      type: string
                      example: xxxxxxxxxxx
                      description: Token for the uploaded file
                    size:
                      type: number
                      example: 1024
                      description: File size in bytes
                    url:
                      type: string
                      example: /bucket/xxxxx
                      description: URL of the uploaded file
                    path:
                      type: string
                      example: /table/xxxxxx
                      description: file path
                    mimetype:
                      type: string
                      example: video/mp4
                      description: MIME type of the uploaded file
                    width:
                      type: number
                      example: 100
                      description: Image width of the uploaded file
                    height:
                      type: number
                      example: 100
                      description: Image height of the uploaded file
                    name:
                      type: string
                    id:
                      type: string
                    thumbnailPath:
                      type: object
                      properties:
                        lg:
                          type: string
                        sm:
                          type: string
                      required:
                        - lg
                        - sm
                  required:
                    - token
                    - size
                    - url
                    - path
                    - mimetype
                    - name
                    - id
                isPublished:
                  type: boolean
                featured:
                  type: boolean
                isSystem:
                  type: boolean
                baseId:
                  type: string
                markdownDescription:
                  type: string
      responses:
        '201':
          description: Successfully update template.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request PATCH \
              --url https://app.teable.ai/api/template/%7BtemplateId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"name":"string","description":"string","categoryId":["string"],"cover":{"token":"xxxxxxxxxxx","size":1024,"url":"/bucket/xxxxx","path":"/table/xxxxxx","mimetype":"video/mp4","width":100,"height":100,"name":"string","id":"string","thumbnailPath":{"lg":"string","sm":"string"}},"isPublished":true,"featured":true,"isSystem":true,"baseId":"string","markdownDescription":"string"}'
        - lang: JavaScript
          source: |-
            const url = 'https://app.teable.ai/api/template/%7BtemplateId%7D';
            const options = {
              method: 'PATCH',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              },
              body: '{"name":"string","description":"string","categoryId":["string"],"cover":{"token":"xxxxxxxxxxx","size":1024,"url":"/bucket/xxxxx","path":"/table/xxxxxx","mimetype":"video/mp4","width":100,"height":100,"name":"string","id":"string","thumbnailPath":{"lg":"string","sm":"string"}},"isPublished":true,"featured":true,"isSystem":true,"baseId":"string","markdownDescription":"string"}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: Node.js
          source: |-
            const http = require('https');

            const options = {
              method: 'PATCH',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/template/%7BtemplateId%7D',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on('data', function (chunk) {
                chunks.push(chunk);
              });

              res.on('end', function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              name: 'string',
              description: 'string',
              categoryId: ['string'],
              cover: {
                token: 'xxxxxxxxxxx',
                size: 1024,
                url: '/bucket/xxxxx',
                path: '/table/xxxxxx',
                mimetype: 'video/mp4',
                width: 100,
                height: 100,
                name: 'string',
                id: 'string',
                thumbnailPath: {lg: 'string', sm: 'string'}
              },
              isPublished: true,
              featured: true,
              isSystem: true,
              baseId: 'string',
              markdownDescription: 'string'
            }));
            req.end();
        - lang: Python
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("app.teable.ai")


            payload =
            "{\"name\":\"string\",\"description\":\"string\",\"categoryId\":[\"string\"],\"cover\":{\"token\":\"xxxxxxxxxxx\",\"size\":1024,\"url\":\"/bucket/xxxxx\",\"path\":\"/table/xxxxxx\",\"mimetype\":\"video/mp4\",\"width\":100,\"height\":100,\"name\":\"string\",\"id\":\"string\",\"thumbnailPath\":{\"lg\":\"string\",\"sm\":\"string\"}},\"isPublished\":true,\"featured\":true,\"isSystem\":true,\"baseId\":\"string\",\"markdownDescription\":\"string\"}"


            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
            }


            conn.request("PATCH", "/api/template/%7BtemplateId%7D", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````