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

# Update a letter template



## OpenAPI

````yaml openapi-core.json POST /v1/letter_templates/{id}
openapi: 3.1.0
info:
  title: Yorlet Core API
  description: Core platform APIs including buildings, customers, units, and tasks.
  version: 1.0.0
servers:
  - url: https://api.yorlet.com
    description: Production
  - url: https://api.yorlet.io
    description: Sandbox
security: []
paths:
  /v1/letter_templates/{id}:
    post:
      tags:
        - Letter templates
      summary: Update a letter template
      operationId: letter_templates_update
      parameters:
        - schema:
            type: string
            description: The id identifier.
          required: true
          description: The id identifier.
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                address_position:
                  type: string
                  enum:
                    - left
                    - right
                  default: left
                  description: >-
                    Which side of page 1 the recipient address window is printed
                    on.
                blocks:
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - heading
                          content:
                            type: string
                            minLength: 1
                            description: >-
                              Heading text. Supports the same merge fields as
                              text blocks.
                        required:
                          - type
                          - content
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - signature
                          file:
                            type:
                              - string
                              - 'null'
                            description: >-
                              File ID of a signature image. When omitted, `name`
                              is printed in a signature style.
                          name:
                            type:
                              - string
                              - 'null'
                            description: >-
                              Name printed under the signature. Defaults to the
                              account name.
                        required:
                          - type
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - text
                          content:
                            type: string
                            minLength: 1
                            description: >-
                              Body text. Supports merge fields such as
                              `{{customer.name}}` and `{{owner.address}}`.
                        required:
                          - type
                          - content
                  minItems: 1
                  description: Ordered content blocks that make up the letter body.
                description:
                  type:
                    - string
                    - 'null'
                  description: An optional description of when to use this template.
                name:
                  type: string
                  minLength: 1
                  description: The name of the letter template.
                recipient_type:
                  type: string
                  enum:
                    - any
                    - customer
                    - owner
                  default: customer
                  description: >-
                    Who this template is intended for. `any` can be used with
                    either customers or owners.
                variables:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        pattern: ^[a-z][a-z0-9_]*$
                        description: >-
                          The merge-field key. Interpolated as
                          `{{variables.<key>}}` in heading and text blocks.
                      label:
                        type: string
                        minLength: 1
                        description: >-
                          A human-readable name shown when filling in this
                          variable.
                    required:
                      - key
                      - label
                  default: []
                  description: >-
                    Custom variables that can be passed when creating a letter
                    from this template.
      responses:
        '200':
          description: Returns the letter template object if the update succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the object.
                  created:
                    type: number
                    description: >-
                      Time at which the object was created. Measured in seconds
                      since the Unix epoch.
                  account:
                    type: string
                    description: >-
                      The account that the object belongs to. Only returned if
                      the request is made with a valid Yorlet-Context header.
                  deleted:
                    type: boolean
                    default: false
                    description: Only returned if the object has been deleted.
                  object:
                    type: string
                    enum:
                      - letter_template
                  address_position:
                    type: string
                    enum:
                      - left
                      - right
                    description: >-
                      Which side of page 1 the recipient address window is
                      printed on.
                  blocks:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - heading
                            content:
                              type: string
                              minLength: 1
                              description: >-
                                Heading text. Supports the same merge fields as
                                text blocks.
                          required:
                            - type
                            - content
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - signature
                            file:
                              type:
                                - string
                                - 'null'
                              description: >-
                                File ID of a signature image. When omitted,
                                `name` is printed in a signature style.
                            name:
                              type:
                                - string
                                - 'null'
                              description: >-
                                Name printed under the signature. Defaults to
                                the account name.
                          required:
                            - type
                        - type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - text
                            content:
                              type: string
                              minLength: 1
                              description: >-
                                Body text. Supports merge fields such as
                                `{{customer.name}}` and `{{owner.address}}`.
                          required:
                            - type
                            - content
                    description: Ordered content blocks that make up the letter body.
                  description:
                    type:
                      - string
                      - 'null'
                    description: An optional description of when to use this template.
                  merge_fields:
                    type: array
                    items:
                      type: string
                    description: >-
                      Merge fields that can be interpolated in heading and text
                      blocks.
                  name:
                    type: string
                    description: The name of the letter template.
                  recipient_type:
                    type: string
                    enum:
                      - any
                      - customer
                      - owner
                    description: >-
                      Who this template is intended for. `any` can be used with
                      either customers or owners.
                  variables:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                          pattern: ^[a-z][a-z0-9_]*$
                          description: >-
                            The merge-field key. Interpolated as
                            `{{variables.<key>}}` in heading and text blocks.
                        label:
                          type: string
                          minLength: 1
                          description: >-
                            A human-readable name shown when filling in this
                            variable.
                      required:
                        - key
                        - label
                    description: >-
                      Custom variables that can be passed when creating a letter
                      from this template.
                required:
                  - id
                  - created
                  - object
                  - address_position
                  - blocks
                  - description
                  - merge_fields
                  - name
                  - recipient_type
                  - variables
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API Key authentication. Use "Bearer YOUR_API_KEY".

````