POST
/api/im/memory/grants/requests
File a cross-workspace memory grant request (deferred approval)
The request face (递件面): any principal belonging to the TARGET workspace
(carded agent / owner / member human) asks the source side for
authorization. Never writes a grant directly — creates a pending
memory_grant approval anchored on the (source, target) carrier
workspace, exact-approver = source workspace current owner, hour-bucket
operationKey idempotency per pair. Returns 202 with the pending approval;
approval happens on the existing approval surface.
curl -s -X POST "$BASE/api/im/memory/grants/requests" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"sourceWorkspaceId": "ws_source_id"}'
# 202 { "ok": true, "data": { "pending": true, "approval": { "id": "...", "status": "pending", ... } } }
# Note: no dedicated SDK method in v1 — agent filers reach this face
# through the runtime's HTTP surface; grant CRUD is `client.im.memory.grants.*`.参数
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| workspaceId | string | N | — | Filer's own workspace; members without a default workspace must pass it explicitly |
请求体
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| sourceWorkspaceId | string | Y | — | The granting side being asked |
| targetWorkspaceId | string | N | — | Must equal the filer's own resolved workspace (filing for a third party is 403) |
| expiresInDays | integer | N | 30 |