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

# 列出角色

> GET /multi-users/access-levels/

每个共享用户都会被分配一个角色——Scanova 仪表盘在内部将其称为"访问级别"（access levels），这个术语在本端点中始终沿用。在通过 [`POST /multi-users/`](/zh/api-reference/management-api/shared-users/invite) 邀请团队成员之前，使用此端点查询可用的角色，或从您自己的系统中创建自定义角色。

<Note>
  此端点此前未被记录过文档。它需要一个拥有 `MANAGEMENT_API`（或 `MANAGEMENT_API_SANDBOX`）配额的 Management API 密钥——参见 [Management API 概览](/zh/api-reference/management-api/overview)。关于每个角色实际授予团队成员的权限，请参见面向人类读者的[角色与权限](/zh/team/roles-and-permissions)指南——本页仅记录数据格式。
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://management.scanova.io/multi-users/access-levels/' \
    --header 'Authorization: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "count": 6,
    "next": null,
    "previous": null,
    "results": [
      {
        "id": 3,
        "name": "Viewer",
        "slug": "viewer",
        "permissions": [
          {
            "id": 23,
            "code": "QR_CODE_CAN_VIEW",
            "name": "Can view QR Code",
            "description": "Allows viewing QR code details.",
            "is_boolean": true
          }
        ],
        "is_custom": false
      },
      {
        "id": 4,
        "name": "Analyst",
        "slug": "analyst",
        "permissions": ["..."],
        "is_custom": false
      },
      {
        "id": 5,
        "name": "Billing Manager",
        "slug": "billing-manager",
        "permissions": ["..."],
        "is_custom": false
      },
      {
        "id": 6,
        "name": "Manager",
        "slug": "manager",
        "permissions": ["..."],
        "is_custom": false
      },
      {
        "id": 7,
        "name": "Admin",
        "slug": "admin",
        "permissions": ["..."],
        "is_custom": false
      },
      {
        "id": 8,
        "name": "Full Access",
        "slug": "full-access",
        "permissions": ["..."],
        "is_custom": false
      }
    ]
  }
  ```
</ResponseExample>

<Note>
  已通过线上核实：一个全新账户会恰好返回这 6 个系统角色（Viewer、Analyst、Billing Manager、Manager、Admin、Full Access）——与仪表盘 Invite Users 抽屉中的[角色与权限](/zh/team/roles-and-permissions#default-system-roles)选择器相匹配。上方展示的 ID 仅作示例；为求简洁，权限数组在此示例中已被截断——真实响应会包含该角色授予的每一项权限的完整信息。
</Note>

结果按分页返回（默认每页 10 条），除了 6 个系统默认角色外，还可以包含该账户创建的自定义角色。

<ParamField query="type" type="string">
  筛选为 `system`（内置角色，这些角色的 `user` 为 null）或 `custom`（该账户创建的角色）。
</ParamField>

<ParamField query="search" type="string">
  对角色名称进行子字符串匹配。
</ParamField>

<ParamField query="ordering" type="string">
  `name` 或 `-name`。
</ParamField>

### 响应字段（每个角色）

<ResponseField name="id" type="integer">
  角色 ID——在邀请或更新共享用户时作为 `access_level` 传入。
</ResponseField>

<ResponseField name="name" type="string">
  角色显示名称，例如 `Manager`。
</ResponseField>

<ResponseField name="slug" type="string | null">
  系统角色的稳定 slug（例如 `manager`）；自定义角色为 `null`。
</ResponseField>

<ResponseField name="is_custom" type="boolean">
  对于 6 个内置系统角色为 `false`，对于该账户自行创建的角色为 `true`。
</ResponseField>

<ResponseField name="permissions" type="array">
  此角色授予的每一项权限。

  <Expandable title="permission 属性">
    <ResponseField name="id" type="integer">权限 ID——在下方创建自定义角色时于 `permissions` 中传入。</ResponseField>
    <ResponseField name="code" type="string">稳定的权限代码，例如 `QR_CODE_CAN_VIEW`。</ResponseField>
    <ResponseField name="name" type="string">人类可读的权限名称。</ResponseField>
    <ResponseField name="description" type="string">对该权限所允许操作的更详细描述。</ResponseField>
    <ResponseField name="is_boolean" type="boolean">此权限是简单的开/关标志（`true`）还是数字型配额。</ResponseField>
  </Expandable>
</ResponseField>

## 相关内容

* [创建自定义角色](/zh/api-reference/management-api/shared-users/roles-create) — 同一端点的另一个操作。
* [邀请共享用户](/zh/api-reference/management-api/shared-users/invite) —— 在邀请或更新团队成员时，从此列表中分配一个角色 ID。
* [更新共享用户](/zh/api-reference/management-api/shared-users/update) —— 在邀请或更新团队成员时，从此列表中分配一个角色 ID。
* [角色与权限](/zh/team/roles-and-permissions) —— 面向人类读者的说明，介绍每个角色授予的权限，包括自定义角色的套餐门槛。
* [共享用户](/zh/team/shared-users) —— 仪表盘的 Users 表格，这些角色在其中通过界面进行分配。


## OpenAPI

````yaml api-reference/openapi/management-api.json GET /multi-users/access-levels/
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:
  /multi-users/access-levels/:
    get:
      summary: List roles (access levels)
      description: >-
        Returns every role assignable to a shared user, including the account's
        default system roles and any custom roles it has created.
      operationId: listManagedAccessLevels
      parameters:
        - name: type
          in: query
          schema:
            type: string
            enum:
              - system
              - custom
        - name: search
          in: query
          schema:
            type: string
        - name: ordering
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Paginated list of roles, each with its permission set.
          content:
            application/json:
              example:
                count: 6
                next: null
                previous: null
                results:
                  - id: 3
                    name: Viewer
                    slug: viewer
                    permissions:
                      - id: 23
                        code: QR_CODE_CAN_VIEW
                        name: Can view QR Code
                        description: Allows viewing QR code details.
                        is_boolean: true
                    is_custom: false
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.

````