POST
/api/im/memory/grants
Create/refresh a cross-workspace memory grant
memory211/05 — source workspace owner (human only; agents 403) grants a
target workspace read access to this workspace's fixed shareable memory
band. An existing (source, target) row is REVIVED (status='active', new
expiresAt/grantedBy), never duplicated — the pairKey generated-column
unique key pins at most one row per (source, target, subject). Write and
memoryAccessVersion epoch bump commit in one transaction. Grant verdicts
are read fresh on every external call (no process cache) — revoke/expiry/
ownership change take effect on the next call.
curl -s -X POST "$BASE/api/im/memory/grants" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"targetWorkspaceId": "ws_target_id", "expiresInDays": 30}'Parameters
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| workspaceId | string | N | — | Source (granting) workspace; defaults to the caller's resolved default workspace |
Request Body
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| targetWorkspaceId | string | Y | — | |
| expiresInDays | integer | N | 30 |