> This page is for 平台, version 旧版.
> For other versions, use one of these documentation indexes:
> - V4 (default): https://next.developer.frame.io/platform/v4/llms.txt
> - V4 实验版: https://next.developer.frame.io/platform/v4-experimental/llms.txt
> - 旧版: https://next.developer.frame.io/platform/v2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://next.developer.frame.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://next.developer.frame.io/_mcp/server.

# 使用审核日志

## 概述

Frame.io 支持并维护其应用程序中绝大多数活动的审核日志。这包括对核心资源的基本增删改查 (CRUD) 操作，以及一些特殊的抽象处理（例如 `AssetVersioned`）。
<Warning title="审核日志在 30 天后截断">
  


Frame.io 审核日志可通过 API 获取最近 30 天的滚动窗口数据，之后它们将被移入冷存储。因此，如果您希望保留 Frame.io 事件的长期历史记录，请确保您自行独立存储历史日志数据。



</Warning>


### 权限范围与权限

只有帐户管理员可以访问帐户的审核日志，并且对审核日志端点的所有调用都必须限定在 `account_id` 范围内，如下所示：

```
GET https://api.frame.io/v2/accounts/:id/audit_logs
```





### 响应





审核日志响应都采用类似的格式：





```json
{
    "_type": "audit",
    "account_id": "<account-id>",
    "action": "<ActionTaken>",
    "actor": {
        "_type": "user",
        "id": "<user-id>",
    },
    "actor_id": "<user-id>",
    "id": "<audit-id>",
    "inserted_at": "<ISO-8601-datetime>",
    "item_id": "<resource-id>",
    "item_type": "<ResourceType>",
    "resource": {...},
    "team_id": "<team-id>",
    "updated_at": "<ISO-8601-datetime>"
}
```




<Info title="不要忘记进行分页！">
  审核日志响应数据可能相当冗长，因此请确保您熟悉[分页](/getting-started/key-concepts#pagination)！
</Info>


## 筛选条件

审核日志支持多种筛选条件，包括日期范围。与 Frame.io 的[搜索](/workflows-assets/search-for-assets)端点不同，筛选条件只能以 `GET` 查询字符串参数的形式发送。

筛选条件都遵循相同的格式：





### GET + 查询字符串





```html
GET
https://api.frame.io/accounts/:id/audit_logs?filter[filter_type1]=value1&filter[filter_type2]=value2
```




<Info title="每种筛选类型仅支持一个值">
  目前，审核日志每种筛选类型仅支持一个值。如果您提供了两个相同类型的筛选条件（例如 `filter[action]=ActionOne&amp;filter[action]=ActionTwo`），则第二个筛选条件将优先生效。
</Info>


### 关键筛选类型





用于筛选和导航审核日志的关键筛选类型包括：




| 筛选类型 | 描述 | 示例值 |
| ------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `item_type` | 筛选单一类型的所有资源。 | _Presentation_、_Comment_、_ReviewLink_、_Asset_ |
| `item_id` | 筛选单个特定资源，例如一个资产或演示文稿。 | _\<asset-id>_, _\<presentation-id>_ |
| `action` | 筛选单个操作，通常与 `item_type` 相关联 | _ProjectCreated_、_AssetVersioned_、_CommentDeleted_ |
| `actor_id` | 筛选特定用户（操作者）的 ID。 | _\<user-id>_ |
| `team_id` | 筛选与单个团队相关的活动。此筛选条件仅可用于拥有多个团队的团队。 | _\<team-id>_ |
| `inserted_at` | 筛选在特定日期时间之前或之后发生的审核事件。必须为 ISO-8601 格式，UTC。 | _2022-08-25T00:00:00Z_ |




### 项目类型和操作




| 资源 | 操作 |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **帐户** | `AccountCreated`、`AccountUpdate`、`AccountLocked` |
| **资产** | `AssetCopied`、`AssetCreated`、`AssetDeleted`、`AssetUpdated`、`AssetVersioned`、`AssetUnversioned`、`AssetLabelUpdated`、`AssetMoved`、`AssetPreserved`、`AssetPrivatized`、`AssetPublicized`、`AssetRestored` |
| **协作者** | `CollaboratorCreated`、`CollaboratorDeleted` |
| **评论** | `CommentCreated`、`CommentCompleted`、`CommentDeleted`、`CommentLiked`、`CommentUncompleted`、`CommentUnliked`、`CommentUpdated`、`ReplyCreated` |
| **演示文稿** | `PresentationCreated`、`PresentationDeleted`、`PresentationUpdated` |
| **项目** | `ProjectCreated`、`ProjectDeleted`、`ProjectMoved`、`ProjectRestored`、`ProjectUpdated` |
| ReviewLink | `ReviewLinkCreated`、`ReviewLinkDeleted`、`ReviewLinkUpdated` |
| **团队** | `TeamCreated`、`TeamUpdated`、`TeamDeleted` |
| **团队成员** | `TeamMemberCreated`、`TeamMemberAccepted`、`TeamMemberDeclined`、`TeamMemberRemoved`、`TeamMemberUpdated` |




## 筛选条件示例





所有筛选条件都采用类似的格式，如上所述。下面是一些针对特定用例的示例，可以帮助您快速入门。




| 场景 | 查询字符串 |
| ---------------------------------------- | ----------------------------------------------------------- |
| 由单个用户执行的操作。 | `?filter[actor_id]=<user-id>` |
| 特定演示文稿上的所有活动。 | `?filter[item_id]=<presentation-id>` |
| 用户留下的评论。 | `?filter[action]=CommentCreated&amp;filter[actor_id]=<user-id>` |
| 团队上的所有审阅链接活动。 | `?filter[item_type]=ReviewLink&amp;filter[team_id]=<team-id>` |




## 日期范围

日期范围是一个稍微特殊的情况，因为需要同时指定 `inserted_at` 日期时间值 (`value`)，以及要应用于该日期时间的操作 (`op`)。因此，日期范围查询将始终包含两个筛选元素，每个元素本身都嵌套在 `[inserted_at]` 参数旁边。

支持的操作包括：




* **gt**：大于
* **gte**：大于或等于
* **lt**：小于
* **lte**：小于或等于




### 日期范围示例




| 场景 | 查询字符串 |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| 从某个日期开始的所有审核日志记录。 | `?filter[inserted_at][op]=gt&amp;filter[inserted_at][value]=2019-03-25T00:00:00Z` |
| 特定用户在某个日期之前上传的所有资产。 | `?filter[inserted_at][op]=lt&amp;filter[inserted_at][value]=2019-03-25T00:00:00Z&amp;filter[actor_id]=<user-id>&amp;filter[action]=AssetCreated` |