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

# Get a document template

> Returns a single document template (quotation, invoice, proforma, etc.) including template-scoped custom field definitions.



## OpenAPI

````yaml /openapi.v2.json get /document-templates/{id}
openapi: 3.1.1
info:
  title: Heffl API v2 (Beta)
  version: 2.0.0
  description: >-
    Heffl REST API v2 (beta) — resource-oriented endpoints with consistent
    response envelopes. Endpoints, schemas, and behavior may change until GA.
    See Agent workflows and ID prefixes guides for automation.
  contact:
    name: Heffl Support
    url: https://heffl.com/support
    email: support@heffl.com
servers:
  - url: https://api.heffl.com/api/v2
    description: Production API Server
security:
  - ApiKeyAuth: []
paths:
  /document-templates/{id}:
    get:
      tags:
        - Reference Data
      summary: Get a document template
      description: >-
        Returns a single document template (quotation, invoice, proforma, etc.)
        including template-scoped custom field definitions.
      operationId: reference.documentTemplates.get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Template ID (tpl_ prefix)
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentTemplate'
        '400':
          description: Validation error or bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '403':
          description: Insufficient permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ApiError'
components:
  schemas:
    DocumentTemplate:
      allOf:
        - $ref: '#/components/schemas/DocumentTemplateListItem'
        - type: object
          required:
            - customFields
          properties:
            documentName:
              anyOf:
                - type: string
                - type: 'null'
              description: Default document title pattern
            subject:
              anyOf:
                - type: string
                - type: 'null'
              description: Default email subject
            customFields:
              type: array
              items:
                $ref: '#/components/schemas/DocumentTemplateCustomField'
    V2ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
    DocumentTemplateListItem:
      type: object
      required:
        - id
        - name
        - type
        - isActive
        - isSignatureRequired
        - valueType
      properties:
        id:
          type: string
          description: Template ID (tpl_ prefix)
        name:
          type: string
          description: Template name
        type:
          type: string
          description: Document type (for example quotations, invoices)
        isActive:
          type: boolean
        isSignatureRequired:
          type: boolean
          description: Whether e-signature is required on send
        valueType:
          type: string
          enum:
            - STATIC
            - DYNAMIC
          description: Content mode
    DocumentTemplateCustomField:
      type: object
      required:
        - key
        - label
        - dataType
        - required
        - values
      properties:
        key:
          type: string
          description: Custom field key — use as cf_* on quotations
        label:
          type: string
          description: Field label in Heffl
        dataType:
          type: string
          description: Field data type
        required:
          type: boolean
        values:
          type: array
          items:
            type: string
          description: Allowed option values
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Get yours at
        app.heffl.com/settings/developers

````