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

# Update Report

> Update the title, author, audience or elements of a report and return the report under the `report` key. Only the fields present in the body are changed; for `elements`, each entry enables or disables an existing element of the report and can change its position or, for the events element, its sort order. Any update discards the generated document, so the next download generates it again, and the summary and event elements are processed again asynchronously. A report can only be updated during the 30 days following its creation; afterwards the request fails with 400. Requires write access to the tenant's reports.

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


## OpenAPI

````yaml firework-v2-openapi patch /firework/v2/reporting/reports/{report_id}
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}:
    patch:
      tags:
        - Reports
      summary: Update a report
      description: >-
        Update the title, author, audience or elements of a report and return
        the report under the `report` key. Only the fields present in the body
        are changed; for `elements`, each entry enables or disables an existing
        element of the report and can change its position or, for the events
        element, its sort order. Any update discards the generated document, so
        the next download generates it again, and the summary and event elements
        are processed again asynchronously. A report can only be updated during
        the 30 days following its creation; afterwards the request fails with
        400. Requires write access to the tenant's reports.
      operationId: patch_report_endpoint
      parameters:
        - description: Numeric ID of the report.
          in: path
          name: report_id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatedReport'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/post_reports_endpoint_200_response'
          description: Updates a report.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
          description: >-
            The request body is invalid, or the report was created more than 30
            days ago and can no longer be edited.
        '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 report does not exist or belongs to another tenant.
components:
  schemas:
    UpdatedReport:
      properties:
        title:
          description: New title of the report.
          type: string
        author:
          description: New author name of the report.
          type: string
        elements:
          description: >-
            Changes to apply to existing elements of the report; elements that
            are not listed are left unchanged.
          items:
            $ref: '#/components/schemas/ReportElementUpdate'
          type: array
        audience:
          description: New audience the report content is written for.
          enum:
            - technical
            - general
          example: technical
          type: string
      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.