> ## 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.

# Create Report

> Create a report on the tenant the caller is acting in and return it with its elements. The report covers the 30 days before its creation and is created with a default set of elements (summary, charts, actions, events, remediated events, logo, introduction) plus one element per priority action whose status changed in that period. Elements are processed asynchronously: poll `GET /reporting/reports/{report_id}` until `is_ready_for_generation` is true before downloading. As a side effect, the tenant's reports created more than 90 days ago are archived. Requires write access to the tenant's reports, and returns 404 when the tenant's subscription does not include identifiers.

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


## OpenAPI

````yaml firework-v2-openapi post /firework/v2/reporting/reports
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:
    post:
      tags:
        - Reports
      summary: Create a report
      description: >-
        Create a report on the tenant the caller is acting in and return it with
        its elements. The report covers the 30 days before its creation and is
        created with a default set of elements (summary, charts, actions,
        events, remediated events, logo, introduction) plus one element per
        priority action whose status changed in that period. Elements are
        processed asynchronously: poll `GET /reporting/reports/{report_id}`
        until `is_ready_for_generation` is true before downloading. As a side
        effect, the tenant's reports created more than 90 days ago are archived.
        Requires write access to the tenant's reports, and returns 404 when the
        tenant's subscription does not include identifiers.
      operationId: post_reports_endpoint
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewReport'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/post_reports_endpoint_200_response'
          description: Creates a new report on the current tenant.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: The request body is invalid.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: The caller cannot modify this tenant's reports (code FORBIDDEN).
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: The tenant's subscription does not include identifiers.
components:
  schemas:
    NewReport:
      properties:
        title:
          description: Title of the report.
          type: string
        author:
          description: Author name of the report.
          type: string
        elements:
          description: Accepted but not used when creating a report.
          items:
            $ref: '#/components/schemas/ReportElementUpdate'
          type: array
        audience:
          description: Audience the report content is written for.
          enum:
            - technical
            - general
          example: technical
          type: string
      required:
        - author
        - title
      type: object
    post_reports_endpoint_200_response:
      properties:
        report:
          $ref: '#/components/schemas/Report'
      type: object
    HttpError:
      properties:
        message:
          description: Human-readable description of the error.
          type: string
        code:
          description: Machine-readable error code.
          type: string
      type: object
    ReportElementUpdate:
      properties:
        id:
          description: >-
            ID of an existing element of the report; entries with an unknown ID
            are skipped.
          type: integer
        position:
          description: >-
            New position of the element among the elements of the same category;
            unchanged when omitted.
          type: integer
        enabled:
          description: >-
            Whether the element is enabled in the report; must be provided for
            every entry.
          type: boolean
        sort_by:
          description: >-
            Sort order of the events in the report; only applied to the element
            whose data type is `events`.
          enum:
            - custom
            - alphabetical
            - date
          example: custom
          type: string
        time_interval:
          description: Accepted but not used by the update.
          type: string
      type: object
    Report:
      properties:
        id:
          description: Numeric ID of the report.
          type: integer
        report_group_id:
          description: ID of the report group the report belongs to.
          type: integer
        title:
          description: Title of the report.
          type: string
        author:
          description: Author name of the report.
          type: string
        created_at:
          description: Date and time (ISO 8601) the report was created.
          type: string
        is_ready_for_generation:
          description: >-
            Whether all the elements are processed, meaning the report can be
            downloaded.
          type: boolean
        is_archived:
          description: Whether the report is archived.
          type: boolean
        tenant_id:
          description: ID of the tenant that owns the report.
          type: integer
        tenant_name:
          description: Name of the tenant that owns the report.
          type: string
        activity_count:
          description: Number of events added to the report.
          type: integer
        elements:
          description: Elements of the report; not returned when listing reports.
          items:
            $ref: '#/components/schemas/ReportElement'
          type: array
        audience:
          description: Audience the report content is written for.
          enum:
            - technical
            - general
          example: technical
          type: string
        timeframe_start_at:
          description: Start (ISO 8601) of the period covered by the report.
          type: string
        timeframe_end_at:
          description: End (ISO 8601) of the period covered by the report.
          type: string
        is_mutable:
          description: >-
            Whether the report can still be updated, which is true during the 30
            days following its creation.
          type: boolean
      type: object
    ReportElement:
      properties:
        id:
          description: Numeric ID of the element.
          type: integer
        report_id:
          description: ID of the report the element belongs to.
          type: integer
        category:
          description: >-
            Group the element is positioned in: `root` for the report sections,
            `event` for an event added to the report, `remediated_item` for a
            remediated event, `action` for a priority action or recommendation.
          type: string
        position:
          description: >-
            Position of the element among the elements of the same category,
            starting at 1.
          type: integer
        enabled:
          description: Whether the element is enabled in the report.
          type: boolean
        data:
          description: >-
            Content of the element; its `type` (`logo`, `introduction`,
            `summary`, `image`, `events`, `activity`, `actions`, `action`,
            `recommendation`, `remediated_events` or `remediated_events_item`)
            determines the other keys.
          properties: {}
          type: object
        processed_at:
          description: >-
            Date and time (ISO 8601) the element content was last processed, or
            null while processing is pending.
          format: date-time
          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.