跳转到主要内容
POST /api/v1/cloud/memory_stores/{memory_store_id}/memories/{memory_id} 更新一条 memory。系统会自动创建一个新的版本快照。

路径参数

参数说明
memory_store_idMemory Store ID(memstore_...
memory_idMemory ID(mem_...

请求头

头部必选说明
AuthorizationBearer <PAT>
Content-Typeapplication/json

请求体

字段类型必选说明
contentstring新内容,最大 100 KB
content_sha256string用于乐观并发控制的期望 SHA-256。不匹配时返回 409
metadataobject自定义键值元数据。最多 16 对;key 1–64 字符;value 最长 512 字符

示例请求

curl -X POST "https://api.qoder.com/api/v1/cloud/memory_stores/memstore_xxx/memories/mem_xxx" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "# 更新后的内容",
    "content_sha256": "a1b2c3..."
  }'

响应

返回更新后、包含 contentMemory 对象

错误码

HTTPtype触发条件
400invalid_request_errorcontent 为空或超限
404not_found_errorStore 或 memory 不存在
409invalid_request_errorStore 已归档,或 SHA-256 不匹配
完整错误信封说明详见 错误参考