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

# Download Report

> Downloads the generated report in the required format. Supported formats: `pdf`, `docx`, and `json`.

- For `json` format, the response body contains the structured report data.
- For `pdf` and `docx`, the response contains the binary file content.


## Overview

Downloads the generated report in the required format such as docx, pdf, and json. The format is passed in the request body.

## Endpoint Details

* **Method:** POST
* **Endpoint:** `/api/assets/download_report/`

## Authentication requirements

* Include a valid JWT token in your request header
* If you don't have a token yet, you can get one from the `/auth/token/` endpoint first.

## Request

### Request Parameter

#### Header Parameters

<ParamField header="Authorization" type="string" required>
  JWT token obtained from the Authentication request
</ParamField>

#### Body Parameters

<ParamField body="file_type" type="string" required>
  Export format. Permitted values: "pdf", "docx", "json"
</ParamField>

<ParamField body="report_id" type="integer" required>
  Id of the report to be exported
</ParamField>

## Response

Successful response will include download the file in the specified format

<ResponseExample>
  ```json 200 theme={"system"}
  {
      "Executive Summary": {
          "Executive Summary": {
              "summary": {
                  "source": [
                      {
                          "id": 1,
                          "title": "openPR.com L4 Self-driving Vehicle Market Current Status and Future Prospects till 2033",
                          "url": "https://www.openpr.com/news/4132700/l4-self-driving-vehicle-market-current-status-and-future",
                          "publisher": "",
                          "date": ""
                      }
                  ]
              }
          }
      }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /api/assets/download_report/
openapi: 3.0.3
info:
  title: Wokelo API
  description: >
    Wokelo provides four categories of APIs for company and market intelligence:


    1. **Enrichment** – Company and Industry data using Wokelo database and
    alternative data. Supports multi-company requests.

    2. **Discovery** – Workflows for specific use-cases such as market map,
    target screening, and buyer screening.

    3. **Monitoring** – Real-time news monitoring for companies.

    4. **Workflow Automation** – Wokelo and custom research workflows executed
    within notebooks.


    Enrichment and Discovery APIs are managed through async requests; use the
    Supporting APIs to track status and export results in JSON.

    Workflow APIs are executed within notebooks and support export to PDF, PPT,
    DOC, or JSON.


    **Authentication:** All endpoints (except `/auth/token/`) require a Bearer
    JWT token in the `Authorization` header.
  version: 1.0.0
  contact:
    url: https://docs.wokelo.ai/contact
servers:
  - url: https://api.wokelo.ai
    description: Production server
security: []
tags:
  - name: Authentication
    description: Obtain JWT tokens for API access
  - name: Enrichment
    description: Retrieve structured data for companies and industries
  - name: Discovery
    description: Identify companies via market maps, buyer and target screening
  - name: Monitoring
    description: Real-time company news monitoring
  - name: Workflow Automation
    description: Research notebooks for companies, industries, and custom workflows
  - name: Supporting APIs
    description: >-
      Utility endpoints for search, file upload, request management, and report
      retrieval
externalDocs:
  description: Official Wokelo API Documentation
  url: https://docs.wokelo.ai/overview
paths:
  /api/assets/download_report/:
    post:
      tags:
        - Supporting APIs
      summary: Download Report
      description: >
        Downloads the generated report in the required format. Supported
        formats: `pdf`, `docx`, and `json`.


        - For `json` format, the response body contains the structured report
        data.

        - For `pdf` and `docx`, the response contains the binary file content.
      operationId: downloadReport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - report_id
                - file_type
              properties:
                report_id:
                  type: integer
                  description: ID of the report to be exported.
                  example: 84102
                file_type:
                  type: string
                  description: Export format.
                  enum:
                    - pdf
                    - docx
                    - json
                  example: json
            example:
              report_id: 84102
              file_type: json
      responses:
        '200':
          description: >-
            Report downloaded successfully. Returns binary file for
            `pdf`/`docx`, or structured JSON data for `json` format.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Structured report data (returned only when `file_type` is
                  `json`).
                additionalProperties: true
              example:
                Executive Summary:
                  Executive Summary:
                    summary:
                      source:
                        - id: 1
                          title: >-
                            L4 Self-driving Vehicle Market Current Status and
                            Future Prospects till 2033
                          url: >-
                            https://www.openpr.com/news/4132700/l4-self-driving-vehicle-market-current-status-and-future
                          publisher: ''
                          date: ''
            application/pdf:
              schema:
                type: string
                format: binary
                description: Binary PDF file content.
            application/vnd.openxmlformats-officedocument.wordprocessingml.document:
              schema:
                type: string
                format: binary
                description: Binary DOCX file content.
        '400':
          description: Bad request – invalid `file_type` or missing `report_id`
        '401':
          description: Unauthorized – invalid or missing JWT token
        '404':
          description: Report not found
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token obtained from the `/auth/token/` endpoint.

````