查询技能开放策略接口

查询技能策略组,查看允许或限制模式、人员范围、资源范围及启用状态。返回组标识和范围数量,用于核对已有授权配置。

所需权限

所需权限资源Scope资源服务
技能读取(读取)skillsadmin.v1.skills.readqwenwork-biz-service

GET /api/openapi/v1/skill-policies

认证与请求头

使用应用 API Key 调用。当前接口校验上方独立 Scope;读取、管理与执行权限互不包含。

名称位置类型必填说明示例
Authorizationheaderstring应用 API Key,使用 Bearer 方式传递。Bearer qwk_\\*
X-Request-Idheaderstring可选的调用追踪标识;未传入时由服务端生成。req-20260831-001

请求参数

名称位置类型必填说明示例
keywordquerystring用于筛选此列表的搜索关键词。"<string>"
pagequeryinteger · int64请求的页码,从 1 开始。 默认值:1。 最小值:1。1
page_sizequeryinteger · int64每页返回的记录数量。 默认值:20。 最小值:1。 最大值:100。20

请求示例

将 <BASE_URL> 替换为企业部署的千问办公 API 服务地址,并填写实际参数。示例中的占位值不能直接用于请求。

curl --request GET --url '<BASE_URL>/api/openapi/v1/skill-policies?keyword=<keyword>&page=1&page_size=20' --header 'Authorization: Bearer <API_KEY>'

响应

200 请求成功,返回当前或更新后的数据。

名称类型必填说明示例
itemsarray | null符合查询条件的当前页记录列表。[{"created_at":"2026-08-27T10:00:00Z","default":false,"description":"<string>","id":"<string>","mode":"<string>","name":"<string>","policy_type":"<string>","resource_count":0,"resource_scope":"<string>","status":"<string>","subject_count":0,"subject_counts":{},"subject_scope":"<string>","surfaces":["<string>"],"updated_at":"2026-08-27T10:00:00Z"}]
items[].created_atstring · date-time此记录的创建时间。"2026-08-27T10:00:00Z"
items[].defaultboolean是否为默认策略组。false
items[].descriptionstring资源策略组的用途说明。"<string>"
items[].idstring此记录的唯一标识,查询、更新或删除对应记录时使用。"<string>"
items[].modestring策略模式:allowlist 为允许所选资源,denylist 为限制所选资源。"<string>"
items[].namestring资源策略组的名称。"<string>"
items[].policy_typestring策略组管理的资源类型。"<string>"
items[].resource_countinteger · int64策略所选资源的数量。0
items[].resource_scopestring资源范围:all 为全部资源,selected 为指定资源。"<string>"
items[].statusstring此记录当前所处的状态。"<string>"
items[].subject_countinteger · int64策略所选范围对象的数量。0
items[].subject_countsobject按对象类型统计的策略范围对象数量。{}
items[].subject_scopestring用户范围:all_users 为所有用户,selected 为指定对象。"<string>"
items[].surfacesarray | null策略适用的入口,当前仅支持 qwenwork_pc;未填写时使用该入口。["<string>"]
items[].updated_atstring · date-time此记录最后一次更新的时间。"2026-08-27T10:00:00Z"
pageinteger · int64当前结果页的页码,从 1 开始。0
page_sizeinteger · int64每页返回的记录数。0
total_itemsinteger · int64符合查询条件的记录总数。0
total_pagesinteger · int64按当前每页数量计算的总页数。0
{
  "items": [
    {
      "created_at": "2026-08-27T10:00:00Z",
      "default": false,
      "description": "<string>",
      "id": "<string>",
      "mode": "<string>",
      "name": "<string>",
      "policy_type": "<string>",
      "resource_count": 0,
      "resource_scope": "<string>",
      "status": "<string>",
      "subject_count": 0,
      "subject_counts": {},
      "subject_scope": "<string>",
      "surfaces": [
        "<string>"
      ],
      "updated_at": "2026-08-27T10:00:00Z"
    }
  ],
  "page": 0,
  "page_size": 0,
  "total_items": 0,
  "total_pages": 0
}

default 请求失败,返回错误码和错误详情。

名称类型必填说明示例
codestring用于程序判断错误原因的稳定业务错误码。"<string>"
detailstring便于阅读的错误说明。"<string>"
detailsOpenapiErrorDetails字段校验失败时的详细信息。{"field":"<string>","reason":"<string>","suggestion":"<string>"}
details.fieldstring未通过校验的请求字段。"<string>"
details.reasonstring稳定的校验失败原因,用于判断字段为何不合法。"<string>"
details.suggestionstring建议采用的规范化字段值。"<string>"
errorstring稳定的 HTTP 错误类型。"<string>"
{
  "code": "<string>",
  "detail": "<string>",
  "details": {
    "field": "<string>",
    "reason": "<string>",
    "suggestion": "<string>"
  },
  "error": "<string>"
}