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

# Download Report

> Return the generated report document as a file attachment named `flare-report.docx` or `flare-report.pdf`, depending on `format`. The document is generated on the first download and again after the report or its elements change; otherwise the stored document is reused. The report must be ready: while `is_ready_for_generation` of `GET /reporting/reports/{report_id}` is false, the request fails with 400 and code `REPORT_NOT_READY`. Requires read access to the tenant's reports.

&#x20;Required API key permission: **Read Tenant**


## OpenAPI

````yaml firework-v2-openapi get /firework/v2/reporting/reports/{report_id}/download
openapi: 3.0.1
info:
  description: >

    Manage and access Firework resources.


    Requests are authenticated with API tokens, which are obtained using an API
    key:


    1. Generate an API key from the [Profile
    page](https://app.flare.io/#/profile).

    2. Send a `POST` request to `https://api.flare.io/tokens/generate` with the
    `Authorization: <api-key>` header to get an API token. API tokens expire
    after 1 hour.

    3. Call the API endpoints with the `Authorization: Bearer <api-token>`
    header.


    See [Authentication](https://api.docs.flare.io/concepts/authentication) for
    details.
  title: Firework API
  version: v2
servers:
  - url: https://api.flare.io/
security:
  - BearerAuth: []
tags:
  - description: >-
      The authenticated user, its API keys, organizations, tenants, onboarding
      and usage.
    name: Account
  - description: >-
      Events collected by Flare: global search, tenant and identifier feeds,
      event details, actions and saved feed views.
    name: Events
  - description: >-
      Identifiers are the assets a tenant monitors, such as domains, keywords
      and email addresses. Includes recommendations and authorization of
      sensitive identifiers.
    name: Identifiers
  - description: Report groups, reports, their sections, schedules and delivery channels.
    name: Reports
paths:
  /firework/v2/reporting/reports/{report_id}/download:
    get:
      tags:
        - Reports
      summary: Download a report
      description: >-
        Return the generated report document as a file attachment named
        `flare-report.docx` or `flare-report.pdf`, depending on `format`. The
        document is generated on the first download and again after the report
        or its elements change; otherwise the stored document is reused. The
        report must be ready: while `is_ready_for_generation` of `GET
        /reporting/reports/{report_id}` is false, the request fails with 400 and
        code `REPORT_NOT_READY`. Requires read access to the tenant's reports.
      operationId: get_report_download_endpoint
      parameters:
        - description: Numeric ID of the report.
          in: path
          name: report_id
          required: true
          schema:
            type: integer
        - description: File format of the downloaded document.
          in: query
          name: format
          schema:
            default: docx
            enum:
              - pdf
              - docx
            type: string
      responses:
        '200':
          content: {}
          description: Download a report.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: >-
            The report elements are still being processed (code
            REPORT_NOT_READY), or `format` is not an allowed value.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: The caller cannot read this tenant's reports (code FORBIDDEN).
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: The report does not exist or belongs to another tenant.
components:
  schemas:
    HttpError:
      properties:
        message:
          description: Human-readable description of the error.
          type: string
        code:
          description: Machine-readable error code.
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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