platform-trust-archive-manage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSalesforce Archive
Salesforce Archive
Operate Salesforce Archive (also called Trusted Services Archive) through its Connect API and the job-metadata object. This skill covers how to search and restore archived records, run the analyzer, handle RTBF erasure and PII masking, check storage, and — the part most often missed — how to read archive job status from and use a job's Id + Type to download its logs.
ArchiveActivityArchiveActivity通过其Connect API和任务元数据对象操作Salesforce Archive(也称为Trusted Services Archive)。本Skill涵盖如何搜索和恢复归档记录、运行分析器、处理RTBF擦除和PII掩码、检查存储,以及最常被忽略的部分——如何从读取归档任务状态,并使用任务的Id + Type下载其日志。
ArchiveActivityArchiveActivityScope
范围
- In scope: Calling the Archive Connect API operations under ; querying the
/platform/data-resilience/archive/object via SOQL/Connect; correlating a job'sArchiveActivityrecord with its log-download endpoints; the verify-after-write pattern for each async operation.ArchiveActivity - Out of scope: Defining archive policies / metadata; building UI; generating Flows over archive data (
ArchivePolicyDefinitionis not Flow-queryable — see Gotchas); generic backup/export tooling unrelated to the add-on.ArchiveActivity
- 包含范围:调用下的Archive Connect API操作;通过SOQL/Connect查询
/platform/data-resilience/archive/对象;将任务的ArchiveActivity记录与其日志下载端点关联;每个异步操作的写后验证模式。ArchiveActivity - 排除范围:定义归档策略/元数据;构建UI;基于归档数据生成Flow(
ArchivePolicyDefinition不支持Flow查询——参见注意事项);与该附加组件无关的通用备份/导出工具。ArchiveActivity
Required Inputs
必要输入
Gather or infer before acting:
- Operation intent: search (this is also how you view archived records), unarchive, analyze, mask, RTBF, storage check, or job-status/log lookup.
- Target sObject (): required for search and unarchive.
sobjectName - Filters: search and unarchive require + at least one filter.
sobjectName - For log downloads: the (an
requestIdId,ArchiveActivityprefix) of a completed, log-producing job, and8qv…= that activity'sreportType.Type
Preconditions (confirm or surface to the user if a call returns a not-permitted error):
- The org must have Salesforce Archive enabled. Every operation is gated on this first.
- Each operation requires a specific user permission on top of the org gate — see the Permissions table below. There is no single "archive admin" role; access is per-capability.
执行操作前需收集或推断:
- 操作意图:搜索(这也是查看归档记录的方式)、取消归档、分析、掩码、RTBF、存储检查或任务状态/日志查询。
- 目标sObject():搜索和取消归档操作必填。
sobjectName - 筛选条件:搜索和取消归档需要+ 至少一个筛选条件。
sobjectName - 日志下载:已完成且生成日志的任务的(
requestIdId,前缀为ArchiveActivity),以及8qv…= 该活动的reportType。Type
前置条件(如果调用返回未授权错误,需确认或告知用户):
- 组织必须启用Salesforce Archive。所有操作均以此为前提。
- 每个操作除了组织层面的权限外,还需要特定的用户权限——参见下方的权限表。不存在单一的“归档管理员”角色;权限按功能划分。
Permissions
权限
Every operation first requires the org to have Salesforce Archive enabled. On top of that org gate, each capability is gated by a distinct user permission. A call the user isn't permitted for fails with a "not permitted" error — match the error to the missing permission below.
| Operation | User permission required |
|---|---|
| |
| |
| |
| |
| |
| |
| |
所有操作首先要求组织已启用Salesforce Archive。在此基础上,每个功能都受不同的用户权限限制。用户无权限执行的调用会返回“未授权”错误——请将错误与下方缺失的权限匹配。
| 操作 | 所需用户权限 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
Workflow
工作流程
All steps are sequential within a task. Read the referenced file the first time you touch that area.
-
Identify the operation and read the contract — do not rely on general knowledge of the Archive API, which has non-obvious contracts. Loadfor the exact request/response shape, required inputs, and per-operation gotchas of every Archive Connect API operation. Do this before constructing any call (e.g.
references/connect-api-operations.mdplural vs singular,dateRangesflag vs HTTP status,isSuccessmeaning no log).url: null -
For job status / monitoring, read the data model — when the task involves archive jobs, failures, progress, counts, or logs, loadfor the
references/archive-activity-entity.mdfield reference and how it links to the Connect API. QueryArchiveActivityvia SOQL or Connect — not Flow. For a worked end-to-end example (find failed/in-progress jobs, then pull their execution-detail and failed-records logs), loadArchiveActivity.examples/monitor-failed-jobs.md -
Construct and send the call — every operation is aREST call. Send it with whatever Connect/REST API tool your environment provides (an MCP server that invokes Connect/REST APIs, the
{method, path, body}CLI, or any REST client). Two path rules are critical (full per-operation contracts are insf):references/connect-api-operations.md- The operation names in this skill are NOT URL paths. ,
search-archived-records, etc. are labels; never put them in the path. Use the short literal paths below (each relative to baseunarchive-records). Sending the operation name as a path segment (e.g./platform/data-resilience/archive) returns 404./…/archive/search-archived-records - The path stops at — there is NO
/platform/data-resilience/archive/…segment, even though this is a Connect API. A 404 //connecthere means the path is wrong, NOT that Archive is disabled — fix the path before concluding the add-on is missing.NOT_FOUND
Operation Method + Path Notes search-archived-records POST /searchrequires + ≥1 filtersobjectNamesearch next page GET /search/next/{scrollId}stop when scroll_id == "-1"search with sharing rules POST /search/with-sharing-rulesuses object mapfiltersJsonunarchive-records POST /unarchive+ filterssobjectNamerun-analyzer / report ·POST /analyzer/runGET /analyzer/reportforget / RTBF + status ·POST /rtbfGET /rtbf/{requestId}mask + status ·POST /maskGET /mask/{requestId}storage used GET /storage/archive-usedexecution-detail / failed-records log ·GET /log/execution-details-stream-urlGET /log/failed-records-stream-urlquery params ,requestIdreportTypeWith theCLI, prefix the path withsf; some MCP/REST tools take the bare path and add the version themselves (tool-dependent — see the reference). Then follow the contract: for searches, supply/services/data/v67.0+ ≥1 filter; for date filtering use the pluralsobjectNamearray ofdateRangeswith full ISO-8601 datetimes.{field, from, to} - The operation names in this skill are NOT URL paths.
-
Branch on the right signal — some operations return HTTP 201 with a body-level success flag (,
body.statusCode). Readbody.isSuccessfor which signal to trust per operation; never assume the HTTP status alone means success.references/connect-api-operations.md -
Verify after every write — re-read state to confirm the effect (see the Verify-After-Write table below). Async operations (analyzer, RTBF, masking) return a request id you must poll.
任务内的所有步骤均为顺序执行。首次接触某领域时,请阅读参考文件。
-
识别操作并阅读契约——不要依赖Archive API的通用知识,其契约存在非直观的细节。加载以获取每个Archive Connect API操作的确切请求/响应格式、必填输入和各操作的注意事项。构建任何调用前都需执行此步骤(例如
references/connect-api-operations.md复数与单数的区别、dateRanges标志与HTTP状态的区别、isSuccess表示无日志)。url: null -
任务状态/监控需阅读数据模型——当任务涉及归档任务、失败、进度、计数或日志时,加载获取
references/archive-activity-entity.md字段参考及其与Connect API的关联方式。通过SOQL或Connect查询ArchiveActivity——不要使用Flow。如需端到端示例(查找失败/进行中的任务,然后拉取其执行详情和失败记录日志),请加载ArchiveActivity。examples/monitor-failed-jobs.md -
构建并发送调用——所有操作均为格式的REST调用。使用环境提供的任意Connect/REST API工具发送调用(调用Connect/REST API的MCP服务器、
{method, path, body}CLI或任何REST客户端)。以下两条路径规则至关重要(完整的各操作契约见sf):references/connect-api-operations.md- 本Skill中的操作名称并非URL路径。、
search-archived-records等为标签;切勿将其放入路径。请使用下方的简短字面路径(均相对于基础路径unarchive-records)。将操作名称作为路径段发送(例如/platform/data-resilience/archive)会返回404。/…/archive/search-archived-records - 路径止于——不存在
/platform/data-resilience/archive/…段,尽管这是Connect API。此处返回404 //connect表示路径错误,而非Archive已禁用——在判定附加组件缺失前,请先修正路径。NOT_FOUND
操作 方法 + 路径 备注 search-archived-records POST /search需要 + ≥1筛选条件sobjectName搜索下一页 GET /search/next/{scrollId}当 时停止scroll_id == "-1"带共享规则的搜索 POST /search/with-sharing-rules使用 对象映射filtersJsonunarchive-records POST /unarchive+ 筛选条件sobjectName运行分析器/获取报告 ·POST /analyzer/runGET /analyzer/report擦除/RTBF + 状态 ·POST /rtbfGET /rtbf/{requestId}掩码 + 状态 ·POST /maskGET /mask/{requestId}已用存储 GET /storage/archive-used执行详情/失败记录日志 ·GET /log/execution-details-stream-urlGET /log/failed-records-stream-url查询参数 、requestIdreportType使用CLI时,请在路径前添加sf;部分MCP/REST工具仅需提供裸路径,自行添加版本号(取决于工具——参见参考文档)。然后遵循契约:搜索操作需提供/services/data/v67.0+ ≥1筛选条件;日期筛选需使用复数形式sobjectName数组,包含dateRanges和完整的ISO-8601日期时间格式。{field, from, to} - 本Skill中的操作名称并非URL路径。
-
根据正确信号分支处理——部分操作返回HTTP 201并带有主体级成功标志(、
body.statusCode)。请阅读body.isSuccess了解每个操作需信任的信号;切勿仅通过HTTP状态判断成功。references/connect-api-operations.md -
每次写入后验证——重新读取状态以确认操作效果(参见下方的写后验证表)。异步操作(分析器、RTBF、掩码)会返回请求ID,需轮询该ID。
Verify-After-Write
写后验证
| After this write | Confirm by |
|---|---|
| Poll |
| Re-run |
| Poll |
| Poll |
| 执行写入操作后 | 验证方式 |
|---|---|
| 轮询 |
| 重新运行 |
| 使用返回的 |
| 使用返回的 |
Rules / Constraints
规则/约束
| Constraint | Rationale |
|---|---|
Search & unarchive require | An unfiltered request is rejected with "Search must be based on at least 1 field" — a full-object operation is never allowed. |
Date filters must be full ISO-8601 datetimes ( | A date-only value ( |
Search uses | They are genuinely different fields on the two endpoints; using the wrong shape silently drops the filter or 400s. |
Stop pagination when | Calling |
Log downloads need a real | The backend resolves the log by the activity record; a mismatched |
| Excluded objects are not retrievable | |
Query | |
| 约束 | 原因 |
|---|---|
搜索和取消归档需要 | 未筛选的请求会被拒绝,提示“搜索必须基于至少一个字段”——绝不允许全对象操作。 |
日期筛选必须使用完整的ISO-8601日期时间格式( | 仅日期值( |
搜索使用 | 这两个端点的字段确实不同;使用错误格式会静默丢弃筛选条件或返回400错误。 |
当 | 使用 |
日志下载需要真实的 | 后端通过活动记录解析日志; |
| 排除的对象无法检索 | |
通过SOQL/Connect查询 | |
Gotchas
注意事项
| Issue | Resolution |
|---|---|
| Treating HTTP 201 as success | Several operations return 201 with a body-level outcome. Branch on |
| It is always |
| |
Log | |
Misreading | |
Expecting | It is not Flow-enabled ( |
| Hitting unarchive caps | Unarchive processes ≤1000 matched records per request and ≤50 requests/hour/org, and restores the whole archived hierarchy of each match. |
| RTBF/masking caps | |
| 问题 | 解决方案 |
|---|---|
| 将HTTP 201视为成功 | 部分操作返回201并带有主体级结果。请根据 |
使用 | 该字段始终为 |
| |
因状态为201而认为日志 | |
误读 | |
期望在Flow中使用 | 它不支持Flow( |
| 达到取消归档上限 | 取消归档每个请求最多处理≤1000条匹配记录,每个组织每小时≤50个请求,并恢复每个匹配项的整个归档层级。 |
| RTBF/掩码上限 | |
Output Expectations
输出预期
This is a knowledge/API skill — it produces API calls and their interpreted results, plus SOQL against . It does not generate deployable metadata. Deliverables per task: the correct operation invocation(s), the right success-signal branching, and a verify-after-write confirmation.
ArchiveActivity这是一个知识/API Skill——它生成API调用及其解析结果,以及针对的SOQL查询。它不生成可部署的元数据。每个任务的交付物:正确的操作调用、正确的成功信号分支处理,以及写后验证确认。
ArchiveActivityReference File Index
参考文件索引
| File | When to read |
|---|---|
| Before constructing any Archive Connect API call — full per-operation contracts, success signals, and limits |
| For any job-status / failure / progress / log task — |
| To follow an end-to-end monitoring flow: find failed/in-progress jobs, then download their logs |
| 文件 | 阅读时机 |
|---|---|
| 构建任何Archive Connect API调用前——完整的各操作契约、成功信号和限制 |
| 处理任何任务状态/失败/进度/日志任务时—— |
| 遵循端到端监控流程时:查找失败/进行中的任务,然后下载其日志 |