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

# Get report template

> Returns the row and column structure for a financial report's table.

Templates define the row labels for `obsah.tabulky` in a financial report. The report only contains numeric values. Use `idSablony` from the financial report to fetch the matching template and map each value to its label.

<Info>
  Templates are never deleted. Once you've fetched a template, you can cache it safely.
</Info>

***

## Common patterns

<AccordionGroup>
  <Accordion title="Map table data to row labels">
    A financial report's `tabulky` contains raw numeric values. Combine it with the matching template to attach a Slovak label to each row.

    ```js Map table data to row labels theme={null}
        // 1. Fetch the financial report and its template
        const report = await fetchReport(686260);
        const template = await fetchTemplate(report.idSablony);

        // 2. Map each row value to its Slovak label
        report.obsah.tabulky.forEach((table, i) => {
          const templateTable = template.tabulky[i];
          table.data.forEach((value, rowIndex) => {
            const label = templateTable.riadky[rowIndex]?.text?.sk;
            console.log(`${label}: ${value}`);
          });
        });
    ```
  </Accordion>

  <Accordion title="Check if a template is still in use">
    `platneDo` is absent when the template is still active. Useful for identifying legacy templates when auditing historical financial reports.

    ```js Check template validity theme={null}
        // 1. Fetch the template
        const template = await fetchTemplate(98);

        // 2. Check whether it is still in use
        const isActive = template.platneDo == null;
        console.log(isActive ? 'Template is active' : `Replaced on ${template.platneDo}`);
    ```
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml ruz/openapi.json GET /api/sablona
openapi: 3.1.0
info:
  title: RÚZ API
  description: >-
    Public REST API for Slovakia's Register of Financial Statements (Register
    účtovných závierok). Exposes accounting units, financial statements,
    financial reports, and annual reports in JSON. Data is updated throughout
    the day as records are published.
  version: 2.5.0
  license:
    name: Creative Commons Zero (CC0)
    url: https://creativecommons.org/publicdomain/zero/1.0/
servers:
  - url: https://www.registeruz.sk/cruz-public
    description: Production
security: []
paths:
  /api/sablona:
    get:
      summary: Get report template
      description: >-
        Returns the full definition of a single financial report template,
        including table structure, column headers, and row labels.


        Templates define the row structure of `tabulky` in a financial report.
        Use `idSablony` from a financial report to look up the matching
        template.
      operationId: getReportTemplate
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Template returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportTemplate'
        '404':
          description: No template found with the given `id`.
components:
  parameters:
    id:
      name: id
      in: query
      required: true
      description: Entity identifier — obtained from an identifier list endpoint.
      schema:
        type: integer
  schemas:
    ReportTemplate:
      type: object
      description: >-
        Defines the row structure of a financial report's `tabulky`. Use
        `idSablony` from a financial report to find the matching template.
        Templates are never deleted.
      properties:
        id:
          type: integer
          description: Unique identifier.
        nazov:
          type: string
          description: Template name.
        nariadenieMF:
          type: string
          description: Ministry of Finance regulation reference.
        platneOd:
          type: string
          description: Valid from (`YYYY-MM-DD`).
        platneDo:
          type: string
          description: Valid to (`YYYY-MM-DD`). Absent if still in use.
        tabulky:
          type: array
          description: Table definitions.
          items:
            type: object
            properties:
              nazov:
                $ref: '#/components/schemas/LocalizedText'
              hlavicka:
                type: array
                description: Column headers with position and dimensions.
              riadky:
                type: array
                description: Row definitions with labels and row numbers.
    LocalizedText:
      type: object
      description: A text value with localized variants.
      properties:
        sk:
          type: string
          description: Slovak label.
        en:
          type: string
          description: English label.

````