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

# Update template

> Update the name or content of a template. Slug cannot be changed.



## OpenAPI

````yaml https://api.pdfshift.io/openapi.json put /templates/{slug}
openapi: 3.0.3
info:
  title: PDFShift API Documentation
  version: '3.0'
  description: >-
    This is the documentation for the PDFShift API.


    Our aim here is to provide you with a clear, concise and complete set of
    tool to generate the PDF you want.


    Don't forget to add the `sandbox` parameter to `True` while testing the API,
    this won't use your credits and generate free PDF (with a watermark).

    But if you forgot to set it, don't worry ; Send us a message and we'll reset
    your credits usage.
  termsOfService: https://pdfshift.io/terms
  contact:
    name: PDFShift
    url: https://pdfshift.io
    email: support@pdfshift.io
  x-logo:
    url: https://pdfshift.io/images/favicons/android-chrome-512x512.png
servers:
  - url: https://api.pdfshift.io/v3
    description: ''
    x-last-modified: 1764750693905
security:
  - apiKeyHeader: []
externalDocs:
  description: You can access our documentation online by visiting https://docs.pdfshift.io
  url: https://docs.pdfshift.io
paths:
  /templates/{slug}:
    put:
      tags:
        - templates
      summary: Update template
      description: Update the name or content of a template. Slug cannot be changed.
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateUpdateForm'
      responses:
        '200':
          description: Template updated
          headers:
            X-RateLimit-Remaining:
              description: >-
                The number of requests remaining in the current rate limit
                window.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: >-
                The maximum number of requests allowed in the current rate limit
                window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                The time at which the current rate limit window resets (Unix
                timestamp).
              schema:
                type: integer
                format: int64
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
              example:
                success: true
                template:
                  slug: test-1
                  created: 1734076868000
                  name: First test for templates
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '401':
          description: Unauthorized. Invalid auth key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Template not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too Many Requests. You have been rate limited.
          headers:
            X-RateLimit-Remaining:
              description: >-
                The number of requests remaining in the current rate limit
                window.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: >-
                The maximum number of requests allowed in the current rate limit
                window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: >-
                The time at which the current rate limit window resets (Unix
                timestamp).
              schema:
                type: integer
                format: int64
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TemplateUpdateForm:
      type: object
      properties:
        name:
          type: string
          description: Name of the template.
        content:
          type: string
          description: HTML content of the template.
      required:
        - content
    Template:
      type: object
      properties:
        success:
          type: boolean
        template:
          type: object
          properties:
            slug:
              type: string
            created:
              type: integer
              format: int64
            name:
              type: string
    Errors:
      type: object
      properties:
        success:
          type: boolean
        errors:
          type: object
        code:
          type: integer
          format: int32
    Error:
      type: object
      properties:
        success:
          type: boolean
        error:
          type: string
        code:
          type: integer
          format: int32
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      description: >-
        Authenticate your account by including your secret key in API requests.

        You can manage your API keys in the
        [Dashboard](https://app.pdfshift.io/dashboard/).


        Authentication to the API is performed by using the HTTP Header
        X-API-Key.
      name: X-API-Key
      in: header
      x-last-modified: 1764750344730

````