# 操作日志接口

# 获取知识操作日志列表

请求URL

GET https://lxapi.lexiangla.com/cgi-bin/v1/kb/operation-logs

请求头

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

其他说明

事项 说明
权限要求 操作日志
频率限制 3000次/分钟

参数说明

参数 是否必须 说明
log_type 必须传kb
limit 拉取条数
page_token 分页游标,根据上一页返回的page_token传入
started_at 开始时间,例如2025-12-01 00:00:00(注意时间格式)
ended_at 结束时间,例如2025-12-04 00:59:59(注意时间格式)

响应

200 Ok 状态码

{
  "data": [
    {
      "type": "kb_operation_log",
      "id": "2345d5c1f2914799b6def17c0980991d",
      "attributes": {
        "created_at": "2025-11-14 10:25:40",
        "action_data": "添加 xxx 可管理权限",
        "ip": "119.147.10.200",
        "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
        "knowledge_type_name": "在线文档",
        "action_name": "添加权限",
        "location": {
          "city": "深圳",
          "region": "广东",
          "country": "中国"
        },
        "recorded_at": "2025-12-04 15:00:19"
      },
      "relationships": {
        "owner": {
          "data": {
            "type": "staff",
            "id": "LX002"
          }
        },
        "target": {
          "data": {
            "type": "kb_entry",
            "id": "6edc5953aeaa431d97b11bde68c2a072"
          }
        },
        "source": {
          "data": {
            "type": "kb_space",
            "id": "d79b0482e95249dc9a8f965794f4f1c3"
          }
        }
      }
    },
    {
      "type": "kb_operation_log",
      "id": "e8bde13589334d28ba996ce0f3290c67",
      "attributes": {
        "created_at": "2025-11-14 10:25:21",
        "action_data": "",
        "ip": "119.147.10.200",
        "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
        "knowledge_type_name": "在线文档",
        "action_name": "新建",
        "location": {
          "city": "深圳",
          "region": "广东",
          "country": "中国"
        },
        "recorded_at": "2025-11-14 10:25:21"
      },
      "relationships": {
        "owner": {
          "data": {
            "type": "staff",
            "id": "LX002"
          }
        },
        "target": {
          "data": {
            "type": "kb_entry",
            "id": "6edc5953aeaa431d97b11bde68c2a072"
          }
        },
        "source": {
          "data": {
            "type": "kb_space",
            "id": "d79b0482e95249dc9a8f965794f4f1c3"
          }
        }
      }
    },
    {
      "type": "kb_operation_log",
      "id": "7a0f8ba476fe49129f99150e310f0801",
      "attributes": {
        "created_at": "2025-11-14 10:25:18",
        "action_data": "",
        "ip": "119.147.10.200",
        "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
        "knowledge_type_name": "文件",
        "action_name": "新建",
        "location": {
          "city": "深圳",
          "region": "广东",
          "country": "中国"
        },
        "recorded_at": "2025-11-14 10:25:19"
      },
      "relationships": {
        "owner": {
          "data": {
            "type": "staff",
            "id": "LX002"
          }
        },
        "target": {
          "data": {
            "type": "kb_entry",
            "id": "75676512f1c649948e0bb74b87200132"
          }
        },
        "source": {
          "data": {
            "type": "kb_space",
            "id": "d79b0482e95249dc9a8f965794f4f1c3"
          }
        }
      }
    }
  ],
  "included": [
    {
      "type": "staff",
      "id": "LX002",
      "attributes": {
        "name": "xxx",
        "english_name": ""
      }
    },
    {
      "type": "kb_entry",
      "id": "6edc5953aeaa431d97b11bde68c2a072",
      "attributes": {
        "name": "xxx",
        "has_children": true
      }
    },
    {
      "type": "kb_entry",
      "id": "75676512f1c649948e0bb74b87200132",
      "attributes": {
        "name": "xxx",
        "has_children": true
      }
    },
    {
      "type": "kb_space",
      "id": "d79b0482e95249dc9a8f965794f4f1c3",
      "attributes": {
        "name": "xxx"
      }
    }
  ],
  "meta": {
    "page_token": "eyJTb3J0IjpbMTc2MzA4NzExODAwMCwiN2EwZjhiYTQ3NmZlNDkxMjlmOTkxNTBlMzEwZjA4MDEiXX0%3D"
  }
}

参数 说明
created_at 创建时间
recorded_at 日志实际被记录到数据库的时间
action_data 操作详情
ip 终端IP
location 用户的地理位置信息,包含国家、地区和城市三级信息
ua 终端设备
knowledge_type_name 知识类型名称
action_name 操作名称
relationships.owner 日志创建者,可根据 id 在 included 中查找
relationships.target 知识实体,可根据 id 在 included 中查找
relationships.source 所属知识库,可根据 id 在 included 中查找

# 获取管理操作日志列表

请求URL

GET https://lxapi.lexiangla.com/cgi-bin/v1/kb/operation-logs

请求头

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

其他说明

事项 说明
权限要求 操作日志
频率限制 3000次/分钟

参数说明

参数 是否必须 说明
log_type 必须传manager
limit 拉取条数
page_token 分页游标,根据上一页返回的page_token传入
started_at 开始时间,例如2025-12-01 00:00:00(注意时间格式)
ended_at 结束时间,例如2025-12-04 00:59:59(注意时间格式)

响应

200 Ok 状态码

{
  "data": [
    {
      "type": "kb_operation_log",
      "id": "3b29a601cd3b4bc29f2b1ea1b279cb64",
      "attributes": {
        "created_at": "2025-11-14 10:48:42",
        "action_data": "添加 xxx 仅查看权限",
        "ip": "119.147.10.200",
        "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
        "action_name": "添加权限",
        "op_type_name": "知识库管理",
        "location": {
          "city": "深圳",
          "region": "广东",
          "country": "中国"
        },
        "recorded_at": "2025-11-14 10:48:43"
      },
      "relationships": {
        "owner": {
          "data": {
            "type": "staff",
            "id": "LX002"
          }
        },
        "target": {
          "data": {
            "type": "kb_space",
            "id": "d79b0482e95249dc9a8f965794f4f1c3"
          }
        }
      }
    },
    {
      "type": "kb_operation_log",
      "id": "f3237f2dafd7437fada851c167bd8e57",
      "attributes": {
        "created_at": "2025-11-14 10:45:49",
        "action_data": "删除平台管理员 xxx",
        "ip": "119.147.10.200",
        "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
        "action_name": "删除平台管理员",
        "op_type_name": "平台管理",
        "location": {
          "city": "深圳",
          "region": "广东",
          "country": "中国"
        },
        "recorded_at": "2025-11-14 10:45:50"
      },
      "relationships": {
        "owner": {
          "data": {
            "type": "staff",
            "id": "LX002"
          }
        }
      }
    },
    {
      "type": "kb_operation_log",
      "id": "767db6147fd94ff681620140ad542971",
      "attributes": {
        "created_at": "2025-11-14 10:45:45",
        "action_data": "添加平台管理员 xxx",
        "ip": "119.147.10.200",
        "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
        "action_name": "添加平台管理员",
        "op_type_name": "平台管理",
        "location": {
          "city": "深圳",
          "region": "广东",
          "country": "中国"
        },
        "recorded_at": "2025-11-14 10:45:45"
      },
      "relationships": {
        "owner": {
          "data": {
            "type": "staff",
            "id": "LX002"
          }
        }
      }
    }
  ],
  "included": [
    {
      "type": "staff",
      "id": "LX002",
      "attributes": {
        "name": "xxx",
        "english_name": ""
      }
    },
    {
      "type": "kb_space",
      "id": "d79b0482e95249dc9a8f965794f4f1c3",
      "attributes": {
        "name": "xxx知识库"
      }
    }
  ],
  "meta": {
    "page_token": "eyJTb3J0IjpbMTc2MzA4ODM0NTAwMCwiNzY3ZGI2MTQ3ZmQ5NGZmNjgxNjIwMTQwYWQ1NDI5NzEiXX0%3D"
  }
}
参数 说明
created_at 创建时间
recorded_at 日志实际被记录到数据库的时间
action_data 操作详情
ip 终端IP
location 用户的地理位置信息,包含国家、地区和城市三级信息
ua 终端设备
action_name 操作名称
op_type_name 操作类型(后续可能新增):平台管理/通讯录管理/许可管理团队管理/知识库管理
relationships.owner 日志创建者,可根据 id 在 included 中查找
relationships.target 操作位置,可根据 id 在 included 中查找