Skip to main content

Memory Store の Identity へのマウント

Memory Store を Identity と Template にマウントします。

既存の Memory Store を (identity, template) にマウントします。その Identity が Template を使用して作成する Session には Store の Memory 内容が自動的に提供されます。 同じ Store の再マウント: access を指定すると権限を更新し、省略すると現在の権限を保持します。マウントは重複作成されず、created_at は最初のマウント時刻のままです。

パス

POST /api/v1/forward/identities/{identity_id}/templates/{template_id}/memory_stores

ヘッダー

ヘッダー必須説明
AuthorizationはいBearer <PAT, admin SAT, or SAT for this Identity>
Content-Typeはいapplication/json
Identity レベルの Service Account Token は自身の Identity のみ操作できます。別の Identity を操作すると 403 が返されます。

パスパラメータ

パラメータ型必須説明
identity_idstringはいIdentity ID(idn_...)。
template_idstringはいTemplate ID(tmpl_...)。

リクエストボディ

フィールド型必須説明
memory_store_idstringはいマウントする Memory Store ID(memstore_...)。呼び出し元から参照できる active 状態の Store である必要があります。
accessstringいいえread_only または read_write。省略時、新しいマウントは read_only、既存のマウントは現在の権限を保持します。

リクエスト例

curl -X POST "https://api.qoder.com/api/v1/forward/identities/idn_63ee28747a35cff93771c491/templates/tmpl_eb3377fb74ad413e17b3d755/memory_stores" \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "memory_store_id": "memstore_00mc7mukn7lkxr454tjd",
    "access": "read_write"
  }'

レスポンス例

HTTP 200 OK
{
  "memory_store_id": "memstore_00mc7mukn7lkxr454tjd",
  "identity_id": "idn_63ee28747a35cff93771c491",
  "template_id": "tmpl_eb3377fb74ad413e17b3d755",
  "access": "read_write",
  "system_managed": false,
  "name": "team-a",
  "status": "active",
  "entry_count": 12,
  "created_at": "2026-08-14T10:00:00Z"
}

レスポンス

Memory Store マウントオブジェクトを返します。

注意事項

複数の Store をマウントすると、Agent にはすべての Store の Memory が path で統合されたフラットな名前空間として見えます。同じ path は互いに隠れる可能性があります。Session 内での見え方を参照してください。 マウントと権限の変更は以後に作成される Session に適用され、既存の Session は自動更新されません。

エラー

HTTPType発生条件
400invalid_request_errormemory_store_id または access が無効、Store がアーカイブ済み、またはシステム管理のデフォルト Store を読み取り専用に変更しようとしました。
401authentication_error認証トークンがないか無効です。
403permission_errorIdentity レベルの SAT が別の Identity を操作しようとしました。
404not_found_errorIdentity、Template、Memory Store のいずれかが存在しないか参照できません。
500/502/503api_errorForward または依存サービスでエラーが発生しました。