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.*`.

Parameters

FieldTypeReqDefaultDescription
workspaceIdstringN—Filer's own workspace; members without a default workspace must pass it explicitly

Request Body

FieldTypeReqDefaultDescription
sourceWorkspaceIdstringY—The granting side being asked
targetWorkspaceIdstringN—Must equal the filer's own resolved workspace (filing for a third party is 403)
expiresInDaysintegerN30

Try it out

Sign in to use your API key
Request Body
Response
Click Execute to test