Use the IngestWiki interface to freeze the current sources and asynchronously build a new set of Wiki pages. The currently published pages remain readable until the new build is successfully published.
Prerequisites
-
An AgentStorage instance has been created and is in the
normalstate, and the instance endpoint and instance name have been obtained. -
An API Key has been created.
-
Wiki operations use the full three-segment Agent Scope (
appId/tenantId/agentId). Each segment must be non-empty, cannot be*, can be up to 128 bytes in length, and cannot contain/. Do not passrunId. -
Sources are stored in the
/.wiki/raw/directory under a specificmemoryStoreNameand three-segment Agent Scope. Uploads and builds use the sameappId,tenantId, andagentId, and omitrunId.
Wiki source files are written to the /.wiki/raw/ directory described above through the AddItem operation, using the same three-segment Agent Scope as the build and omitting runId. This is an exception to the Scope rule for file operations; other file operations require the full four-segment Scope (including runId). For more information, see Create a file. Upload example:
{
"type": "memoryfile",
"memoryStoreName": "agent_memory",
"scope": {
"appId": "app-001",
"tenantId": "user-001",
"agentId": "assistant"
},
"path": "/.wiki/raw/payment-spec.md",
"content": "# Payment rules\nA refund requires the order number.\n"
}
Request parameters
|
Field |
Type |
Required |
Description |
|
|
string |
Yes |
The name of the memory store. |
|
|
object |
Yes |
The full three-segment Agent Scope. The rules are the same as for |
|
|
string |
No |
The idempotency token, up to 256 bytes. The same source and token allow safe retries. |
|
|
array |
No |
The Dream artifact references to include in this build, up to 100 entries. |
|
|
string |
Yes |
The ID of the completed Dream, up to 128 bytes. |
|
|
string |
Yes |
The ID of the applied artifact action, up to 128 bytes. |
dreamActionRefs only takes effect for this build. References must belong to the same memory store and Agent, and correspond to applied, still-valid Skill or Profile artifacts; duplicate references are rejected.
Request example
When using API Key authentication, pass the instance name and API Key through the x-ots-instancename and x-ots-apikey request headers.
curl -X POST https://<endpoint>/IngestWiki \
-H "x-ots-instancename: <instance-name>" \
-H "x-ots-apikey: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"memoryStoreName": "agent_memory",
"scope": {
"appId": "app-001",
"tenantId": "user-001",
"agentId": "assistant"
},
"clientToken": "payment-wiki-20260904"
}'
Response
|
Field |
Description |
|
|
The initial status of the new build, typically |
|
|
Whether an existing build was reused based on the same |
|
|
Whether the build was skipped because the sources had not changed. |
{
"status": "pending",
"reused": false,
"skipped": false
}
The build is an asynchronous process. After it is initiated, poll the latestBuild.status returned by GetWiki until it becomes ready or fails. If no source is available, a 400 VALIDATION_ERROR is returned.