メインコンテンツへスキップ

Documentation Index

Fetch the complete documentation index at: https://docs.qoder.com/llms.txt

Use this file to discover all available pages before exploring further.

POST /v1/memory_stores/{memory_store_id}/memories 指定された Memory Store に新しいメモリエントリを作成します。

パスパラメータ

パラメータ必須説明
memory_store_idstringはいMemory Store ID(memstore_ プレフィックス)

ヘッダー

ヘッダー必須
AuthorizationBearer $QODER_PATはい
Content-Typeapplication/jsonはい

リクエストボディ

フィールド必須説明
pathstringはい相対パス(/ で始まることはできない)
contentstringはいメモリ内容(テキスト)

リクエスト例

curl -X POST "https://openapi.qoder.sh/api/v1/cloud/memory_stores/memstore_xxx/memories" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "notes/meeting.md",
    "content": "会議議事録の内容..."
  }'

レスポンス例

HTTP 201 Created 作成された MemoryEntry オブジェクトを返します。
{
  "id": "mem_019e3bb965a671fca51bde1cf8d87de0",
  "type": "memory",
  "store_id": "memstore_019e3bb93b7074f9a5130d39ddcca90f",
  "path": "notes/meeting.md",
  "content": "会議議事録の内容...",
  "size": 11,
  "content_sha256": "64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c",
  "version": 1,
  "metadata": {},
  "created_at": "2026-05-18T15:34:26.494349Z",
  "updated_at": "2026-05-18T15:34:26.494349Z"
}

レスポンスフィールド

フィールド説明
idstring一意識別子、mem_ プレフィックス
typestring固定値 "memory"
store_idstring所属する Memory Store の ID
pathstring相対パス
contentstringメモリ内容
sizeint64内容サイズ(バイト)
content_sha256string内容の SHA-256 ハッシュ
versionint64バージョン番号(初回作成は 1)
metadataobjectカスタムメタデータ
created_atstring作成時刻(ISO 8601)
updated_atstring最終更新時刻(ISO 8601)

エラーレスポンス

HTTPtype説明
400invalid_request_errorリクエストパラメータエラー(path/ で始まるなど)
401TOKEN_INVALID認証トークンが提供されていないまたは無効
404not_found_error指定の Memory Store が存在しない
409conflict_error同一 Store 配下に同一 path のエントリがすでに存在

エラー例

path/ で始まる場合:
{
  "error": {
    "message": "Field 'path' must be a relative path (cannot start with '/').",
    "type": "invalid_request_error"
  },
  "type": "error"
}
パス競合:
{
  "error": {
    "message": "Version or state conflict.",
    "type": "conflict_error"
  },
  "type": "error"
}

注意事項

  • path は相対パスでなければならず、/ で始まることはできません
  • 同一 Store 配下に同一 path のメモリエントリは 2 つ存在できません(409 を返します)
  • 作成時のバージョン番号は初期値 1 です
  • サーバー側で sizecontent_sha256 を自動計算します
  • 作成操作は同期的に action: "created" のバージョンレコードを生成します