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

# Get Template Details

> Returns essential template details for a specific template.

<Accordion title="Required scopes (OAuth 2.0)" icon="key">
  This endpoint requires the following scope:

  `templates`
</Accordion>


## OpenAPI

````yaml GET /templates/{template_id}
openapi: 3.1.0
info:
  version: 1.0.0
  title: Lumin API Reference
  description: >
    The Lumin API Reference provides a comprehensive set of tools to integrate
    document workflows — including editing, eSignatures, and automation — into
    your applications.


    Useful links:

    - [Document Repository](https://github.com/luminpdf/luminsign-docs)

    - [API
    Definition](https://github.com/luminpdf/luminsign-docs/blob/main/openapi.yaml)

    - [Authentication Guide](/tabs/guides/authentication/overview)
  termsOfService: https://www.luminpdf.com/terms-of-use/
  contact:
    name: API Support
    email: integration@luminpdf.com
    url: https://help.luminpdf.com
servers:
  - url: https://api.luminpdf.com/v1
    description: Production server
security: []
tags:
  - name: Signature Requests
    description: Everything about Signature Requests
  - name: Users
    description: Everything about Users
  - name: Templates
    description: Everything about Templates
  - name: Documents
    description: Everything about Documents
  - name: Workspaces
    description: Everything about Workspaces
  - name: Agreements
    description: Everything about Agreements
paths:
  /templates/{template_id}:
    get:
      tags:
        - Templates
      summary: Get Template Details
      description: |
        Returns essential template details for a specific template.
      parameters:
        - in: path
          name: template_id
          schema:
            type: string
          required: true
          description: ID of the template.
      responses:
        '200':
          description: Returns the template details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDetail'
              examples:
                sign-template:
                  summary: Sign template
                  value:
                    template_id: sign_123456
                    type: pdf
                    name: Mutual NDA
                    signing_type: ORDER
                    signer_roles:
                      - name: Tenant
                        group: 1
                      - name: Client
                        group: 2
                    tags:
                      - name: owner.name
                        type: merge_tag
                        is_required: true
                    fields:
                      - name: hasCompleted
                        type: checkbox
                        is_required: true
                        assigned_role: Tenant
                    variables: []
                    collections: []
                    created_at: 1748456885430
                    updated_at: 1748456885430
                ag-template:
                  summary: AgreementGen template with collections
                  value:
                    template_id: ag_456789
                    type: lumin
                    name: Sales Proposal
                    signing_type: SAME_TIME
                    signer_roles:
                      - name: Client
                        group: 1
                    tags: []
                    fields:
                      - name: clientName
                        type: text
                        is_required: false
                        assigned_role: Client
                    variables:
                      - name: Client.Name
                      - name: Company.Address
                    collections:
                      - name: Opportunity.LineItems
                        type: table_row_repeat
                        variables:
                          - Product.Name
                          - Product.Quantity
                          - Product.UnitPrice
                          - Product.Total
                    created_at: 1748456885430
                    updated_at: 1748456885430
        4XX:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKey: []
        - BearerAuth:
            - templates
components:
  schemas:
    TemplateDetail:
      type: object
      properties:
        template_id:
          type: string
          description: Unique identifier for the template
        type:
          type: string
          description: 'Template file type. One of: pdf, lumin'
          enum:
            - pdf
            - lumin
        name:
          type: string
          description: Name of the template
        signing_type:
          type: string
          description: >
            Defines how recipients are expected to sign:

            - ORDER: Signers sign in a specific sequence.

            - SAME_TIME: All signers can sign in parallel.

            AgreementGen and PDF templates currently only supports signing_type
            as SAME_TIME.
          enum:
            - ORDER
            - SAME_TIME
        signer_roles:
          type: array
          description: Describes the signer roles defined in the template.
          items:
            type: object
            properties:
              name:
                type: string
                description: A label for the role (e.g., "Tenant", "Manager").
              group:
                type: integer
                description: >-
                  Indicates signing order group (e.g., 1 = sign first, 2 = sign
                  second).
        tags:
          type: array
          description: |
            Merge tags embedded in the Sign template.
          items:
            type: object
            properties:
              name:
                type: string
                description: The label or identifier of the tag.
              type:
                type: string
                description: 'Type of tag, one of: merge_tag'
                enum:
                  - merge_tag
              is_required:
                type: boolean
                description: >-
                  Indicates whether the merge tag needs to be prefilled before
                  the signature request can be completed.
        fields:
          type: array
          description: The form fields that appear in the template.
          items:
            type: object
            properties:
              name:
                type: string
                description: The label or identifier of the form field.
              type:
                type: string
                description: 'Type of field, one of: text, checkbox'
                enum:
                  - text
                  - checkbox
              is_required:
                type: boolean
                description: >-
                  Indicates whether the assigned signer must complete the field
                  before the signature request can be completed.
              assigned_role:
                type: string
                description: >-
                  The role (as defined in the template) to which this field is
                  assigned. If not set, the field may not be linked to a
                  specific role and will be dismissed during signature request
                  creation.
        variables:
          type: object
          description: |
            The variables defined in the AgreementGen template.
          properties:
            name:
              type: string
              description: The label or identifier of the variable.
        collections:
          type: array
          description: >
            Table-scoped collections referenced by row-loop markers in the
            template.


            Empty array (`[]`) when the template has no markers. Applies to
            AgreementGen templates only — returned as `[]` for Sign and PDF
            templates.
          items:
            $ref: '#/components/schemas/TemplateCollection'
        created_at:
          type: integer
          format: unix-epoch
          description: The Unix timestamp when the template was first created.
        updated_at:
          type: integer
          format: unix-epoch
          description: The Unix timestamp of the last update to the template.
    Error:
      type: object
      required:
        - error_code
        - error_message
      properties:
        error_code:
          type: string
          description: The system error code.
        error_message:
          type: string
          description: The human-readable error message.
    TemplateCollection:
      type: object
      properties:
        name:
          type: string
          description: >
            Collection identifier as declared in the template marker (e.g.,
            `Opportunity.LineItems`). Use this value as the key in the
            `collections` object of the [Create
            Agreement](/tabs/api-reference/api/agreements/create-agreement),
            [Generate Document from
            Template](/tabs/api-reference/api/templates/generate-document-from-template),
            or [Send Signature Request from
            Template](/tabs/api-reference/api/signature-requests/send-signature-request-from-template)
            payloads.
        type:
          type: string
          description: >
            Marker scope the collection drives.


            - `table_row_repeat` — duplicates one or more body rows per item
            (`<<TableStart:>>` / `<<TableEnd:>>`).
          enum:
            - table_row_repeat
        variables:
          type: array
          description: >
            Variable names referenced inside the loop body (e.g.,
            `Product.Name`, `Product.Quantity`). Callers should include these
            keys in each item object of the `collections.<name>` array at
            generation time. Missing collection variables render as empty
            strings.
          items:
            type: string
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >
        Provide your API key in the `X-API-Key` header, e.g., `X-API-Key:
        YOUR_API_KEY`.
    BearerAuth:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://auth.luminpdf.com/oauth2/auth
          tokenUrl: https://auth.luminpdf.com/oauth2/token
          scopes:
            openid: >-
              Retrieve basic identity details (username, email, profile
              picture).
            offline_access: Request a refresh token for long-lived access. Private apps only.
            profile.read: View basic user profile information.
            workspaces: View and manage Workspaces and Spaces.
            workspaces.read: View information about the authenticated user's Workspace.
            templates: View and manage templates in a Workspace.
            pdf:files: Create, edit, and delete PDF files in a Workspace.
            pdf:files.read: Retrieve PDF documents stored in a Workspace.
            sign:requests: Create, update, or view signature requests.
            sign:requests.read: Retrieve signature requests.
            agreements: Create, update, or delete AgreementGen documents.
      description: >
        OAuth 2.0 authorization code flow. Provide your access token in the
        `Authorization` header, e.g., `Authorization: Bearer <token>`. See the
        [OAuth 2.0 guide](/tabs/guides/authentication/oauth2) for details.

````