# 标签接口

# 获取知识库标签列表

按知识库范围查询标签列表,同时支持按标签的path路径模糊(默认)匹配,按标签名精确匹配

请求URL

GET https://lxapi.lexiangla.com/cgi-bin/v1/kb/spaces/{space_id}/tags

请求头

参数 是否必须 说明
Authorization 是 接口调用凭证 access_token
值格式:"Bearer access_token"
示例值:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJS"

其他说明

事项 说明
权限要求 获取知识库标签列表
授权范围 AppKey 绑定团队时,入参 space_id 对应知识库需在授权的团队下
频率限制 3000次/分钟

URL 参数说明

参数 是否必须 说明
space_id 是 知识库ID

请求参数

参数 是否必须 说明
keyword 否 标签名称,用于匹配标签
match_mode 否 匹配模式,默认按照标签path路径模糊匹配,可选值:exact-按标签name精确匹配,仅返回name与keyword完全一致的标签列表

响应

200 Ok 状态码

{
  "data": [
    {
      "type": "tag",
      "id": "f24be52cb6ec4798a86442f172931836",
      "attributes": {
        "name": "标签a",
        "path":  "父标签/标签a",
        "created_at": "2025-12-18 17:37:19",
        "updated_at": "2025-12-18 17:37:19"
      },
      "relationships": {
        "owner": {
          "data": {
            "type": "staff",
            "id": "LX001"
          }
        }
      }
    }
  ],
  "included": [
    {
      "type": "staff",
      "id": "LX001",
      "attributes": {
        "name": "成员001",
        "english_name": "别名",
        "organization": "开发组"
      }
    }
  ]
}

参数说明

参数 说明
id 标签ID
attributes.name 标签名
attributes.path 标签path路径
attributes.created_at 标签创建时间
attributes.updated_at 标签最近一次更新时间
relationships.owner 标签创建者,可根据 id 在 included 中查找