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

# 更新已保存的分析报告

> PATCH /analytics/report/{pk}/update/

更新一个已保存的分析报告 —— 常用于重命名它或切换是否保持已保存状态。

<Note>
  需要具有 `MANAGEMENT_API`（或 `MANAGEMENT_API_SANDBOX`）配额的管理 API 密钥 —— 参见[管理 API 概述](/zh/api-reference/management-api/overview)。
</Note>

<ParamField path="pk" type="integer" required>
  报告的 `id`。
</ParamField>

<ParamField body="saved_name" type="string">
  已保存预设的新名称。每个账户内必须唯一 —— 重复会返回 `400`。
</ParamField>

<ParamField body="is_saved" type="boolean">
  设置为 `false` 以取消保存该预设（它仍会列在[列出分析报告](/zh/api-reference/management-api/analytics/report-list)中，只是无法再通过此获取/更新端点访问）。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url 'https://api.scanova.io/analytics/report/58/update/' \
    --header 'Authorization: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{ "saved_name": "Q3 QR Report" }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": 58,
    "filter_type": "qrcode",
    "start_date": "2026-08-01",
    "end_date": "2026-08-31",
    "report_type": "both",
    "analytics_format": "xlsx",
    "scan_format": "csv",
    "status": "completed",
    "report_file": "https://cdn.example.com/media/analytics_reports/58/report.xlsx",
    "completed_on": "2026-09-01T08:12:00Z",
    "is_saved": true,
    "saved_name": "Q3 QR Report",
    "created": "2026-09-01T08:10:00Z",
    "requested_by_name": "Docs"
  }
  ```
</ResponseExample>

此端点不会重新生成报告 —— 它只更新已保存预设的元数据，不更新 `filter_type`/`filter_data`/日期范围。如果 `pk` 不是此账户拥有的已保存报告，则返回 `404`。

## 相关内容

* [获取已保存的分析报告](/zh/api-reference/management-api/analytics/report-retrieve) —— 更新前查看。
* [生成分析报告](/zh/api-reference/management-api/analytics/report-create) —— 使用不同参数开始新报告。
* [管理 API 概述](/zh/api-reference/management-api/overview) —— 此端点所属的身份验证方案和配额体系。


## OpenAPI

````yaml api-reference/openapi/management-api.json PATCH /analytics/report/{pk}/update/
openapi: 3.1.0
info:
  title: Scanova Management API (v2)
  description: >-
    The complete Scanova Management API — every endpoint available at
    api.scanova.io (QR codes, folders, tags, leads, forms, analytics, plans,
    shared users & roles), plus the token-creation and usage-stats endpoints
    used to authenticate against it. Every path and request/response shape below
    was verified live against a real API key and the actual running backend
    (Phase 7, 2026-08-16) — not guessed from reading urls.py alone.
  version: 2.0.0
servers:
  - url: https://api.scanova.io
    description: Management API — QR/folder/tag/lead/form/analytics/plans endpoints
security:
  - apiKeyAuth: []
paths:
  /analytics/report/{pk}/update/:
    patch:
      summary: Update a saved analytics report
      description: >-
        Updates a saved report's preset fields — commonly `saved_name` or
        `is_saved`.
      operationId: updateAnalyticsReport
      parameters:
        - name: pk
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            example:
              saved_name: Q3 QR Report
      responses:
        '200':
          description: Report updated.
          content:
            application/json:
              example:
                id: 58
                filter_type: qrcode
                start_date: '2026-08-01'
                end_date: '2026-08-31'
                report_type: both
                analytics_format: xlsx
                scan_format: csv
                status: completed
                report_file: https://cdn.example.com/media/analytics_reports/58/report.xlsx
                completed_on: '2026-09-01T08:12:00Z'
                is_saved: true
                saved_name: Q3 QR Report
                created: '2026-09-01T08:10:00Z'
                requested_by_name: Docs
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Send your Management API key as the raw value of the Authorization
        header — no "Bearer " or "Token " prefix, and no other characters.
        Example: `Authorization: 401f7ac837da42b97f613d789819ff93537bee6a`. A
        header containing more than one space-separated part is rejected
        outright. Requests also require the request's Host header to be the
        management API host (e.g. api.scanova.io) — the same key sent to the
        regular API host will not authenticate.

````