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

# Download a report of a template

> Downloads the generated file of one report, as GET /v1/reports/{id}/download does, provided the report was generated from the template the path names. Call it once the report is generated. The ownership is checked before any file is read. Nothing changes on the report. A malformed institution, template or report id is refused with 400 RPT-0009 naming the parameter. A report that does not exist, was deleted, or belongs to another institution or template is answered 404 RPT-0011 — the same answer in all three cases, so the route never reveals that a report it does not serve exists. 401 and 403 come from authorization: a credential confined to some institutions or templates is refused here when the path names one outside them. A report that is not generated yet is refused with 422 RPT-0029, a regulatory draft still missing a required value with 422 RPT-0156, and a stored file that was removed with 404 RPT-0043.



## OpenAPI

````yaml /pt/openapi/v3-current/reporter.yaml get /v1/templates/{templateId}/reports/{id}/download
openapi: 3.1.0
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: >-
    Reporter generates regulatory, accounting and operational reports from
    templates over your data sources.
  license:
    name: Lerian Studio General License
  title: Reporter API
  version: 4.0.0
servers:
  - url: https://reporter.sandbox.lerian.net
security:
  - BearerAuth: []
tags:
  - description: Generated report instances and their lifecycle.
    name: Reports
  - description: Reusable report definitions.
    name: Templates
  - description: Interactive construction of report templates.
    name: Template Builder
  - description: Scheduled report due-date tracking.
    name: Deadlines
  - description: Configured inputs that feed report data.
    name: Data Sources
  - description: Aggregated reporting metrics.
    name: Metrics
  - description: Published business event catalog and delivery policies.
    name: Streaming
paths:
  /v1/templates/{templateId}/reports/{id}/download:
    get:
      tags:
        - Reports
      summary: Download a report of a template
      description: >-
        Downloads the generated file of one report, as GET
        /v1/reports/{id}/download does, provided the report was generated from
        the template the path names. Call it once the report is generated. The
        ownership is checked before any file is read. Nothing changes on the
        report. A malformed institution, template or report id is refused with
        400 RPT-0009 naming the parameter. A report that does not exist, was
        deleted, or belongs to another institution or template is answered 404
        RPT-0011 — the same answer in all three cases, so the route never
        reveals that a report it does not serve exists. 401 and 403 come from
        authorization: a credential confined to some institutions or templates
        is refused here when the path names one outside them. A report that is
        not generated yet is refused with 422 RPT-0029, a regulatory draft still
        missing a required value with 422 RPT-0156, and a stored file that was
        removed with 404 RPT-0043.
      operationId: downloadTemplateReport
      parameters:
        - description: Template the report was generated from
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: templateId
          required: true
          schema:
            description: Template the report was generated from
            type: string
        - description: Report ID
          example: 00000000-0000-0000-0000-000000000000
          in: path
          name: id
          required: true
          schema:
            description: Report ID
            type: string
      responses:
        '200':
          content:
            application/pdf:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            application/xml:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            text/csv:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            text/html:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
            text/plain:
              schema:
                contentMediaType: application/octet-stream
                format: binary
                type: string
          description: Generated report file
          headers:
            Content-Disposition:
              schema:
                description: Attachment filename
                type: string
            Content-Type:
              schema:
                description: Generated report media type
                type: string
            X-Report-Status:
              schema:
                description: >-
                  Status of the report this file belongs to: a Draft is under
                  review, a Final is the approved filing.
                examples:
                  - Draft
                type: string
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Not Found
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Unprocessable Entity
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Internal Server Error
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Service Unavailable
components:
  schemas:
    Detail:
      properties:
        code:
          description: >-
            Stable, machine-readable domain error code scoped to the emitting
            service (format: <SERVICE>-NNNN).
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          examples:
            - - location: body.templateId
                message: expected string to match 'uuid' format
                value: not-a-uuid
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: '#/components/schemas/Upstream'
          description: >-
            RFC 9457 extension member: the error a proxied third-party provider
            reported. Absent unless the emitting service explicitly surfaced
            one.
      type: object
    ErrorDetail:
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          examples:
            - body.templateId
          type: string
        message:
          description: Error message text
          examples:
            - expected string to match 'uuid' format
          type: string
        value:
          description: The value at the given location
          examples:
            - not-a-uuid
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: >-
            The upstream provider's own error message, verbatim (bounded, never
            its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.