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

# 创建文件夹

> POST /folder/

文件夹用于对二维码进行归类整理——与仪表盘 **QR Codes > Folders** 侧边栏中展示的文件夹相同。使用此端点可以列出账户的文件夹，或从您自己的系统中创建新文件夹。

<Note>
  两个操作都需要一个拥有 `MANAGEMENT_API`（或 `MANAGEMENT_API_SANDBOX`）配额的 Management API 密钥，以原始 `Authorization` 请求头的值发送。身份验证细节请参见 [Management API 概览](/zh/api-reference/management-api/overview)。
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://management.scanova.io/folder/' \
    --header 'Authorization: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "name": "Holiday Campaign",
      "color": "#22C55E"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": 42,
    "name": "Holiday Campaign",
    "color": "#22C55E",
    "created_by": 1029,
    "folder_type": "qr",
    "qr_codes_count": 0,
    "created": "2026-08-16T20:40:02.115000+05:30",
    "updated": "2026-08-16T20:40:02.115000+05:30"
  }
  ```
</ResponseExample>

<ParamField body="name" type="string" required>
  文件夹名称，最多 150 个字符。在给定的 `folder_type` 内，该名称在此账户中必须唯一——重复的名称会返回一个 400 错误，内容为 `{"name": ["Folder name already exists."]}`。
</ParamField>

<ParamField body="color" type="string">
  十六进制颜色值，例如 `#4F6BF4`。
</ParamField>

<ParamField body="folder_type" type="string" default="qr">
  `qr` 或 `page`。
</ParamField>

<Note>
  创建文件夹需要账户的 `FOLDER_MANAGEMENT` 配额（文件夹管理在部分套餐中属于付费能力）——返回 403 并附带 `"Your plan does not have folder management quota."` 消息，说明该套餐不包含此功能。列出文件夹则没有此项限制。
</Note>

## 相关内容

* [列出文件夹](/zh/api-reference/management-api/folders/list) — 同一端点的另一个操作。
* [标签管理](/zh/api-reference/management-api/tags/manage) —— 另一种二维码归类整理机制，可与文件夹配合（或替代文件夹）使用。
* [列出 / 创建二维码](/zh/api-reference/management-api/qr/list) —— 通过此处返回的文件夹 ID，以 `?folder=` 筛选二维码。
* [Management API 概览](/zh/api-reference/management-api/overview) —— 本端点所属的身份验证方案与配额架构。


## OpenAPI

````yaml api-reference/openapi/management-api.json POST /folder/
openapi: 3.1.0
info:
  title: Scanova Management API (v2)
  description: >-
    The complete Scanova Management API — every endpoint available at
    management.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://management.scanova.io
    description: Management API — QR/folder/tag/lead/form/analytics/plans endpoints
security:
  - apiKeyAuth: []
paths:
  /folder/:
    post:
      summary: Create a folder
      operationId: createManagedFolder
      responses:
        '201':
          description: Folder created
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. management.scanova.io) — the same key sent to
        the regular API host will not authenticate.

````