{"title":"API FAQ","slug":"api-faq","category":"faq","summary":"API に関するよくある質問 — 認証、レート制限、エラー処理、エンドポイント探索。","audience":["human","llm"],"tags":["faq","api","troubleshooting"],"difficulty":"beginner","updated":"2026-06-27","word_count":200,"read_minutes":1,"lang":"ja","translated":true,"requested_lang":"ja","content_markdown":"\n# API FAQ\n\nSynapse API に関するよくある質問です。\n\n## 認証はどうすればよいですか？\n\n2 つの方法があります。\n\n1. **Mind Key**（データエンドポイント用）：`Authorization: Bearer mk_...`\n2. **JWT**（アカウントエンドポイント用）：`Authorization: Bearer eyJ...`\n\nまたはクエリパラメータ経由（60 回/分の制限あり）：`?key=mk_...`\n\n[Authentication](/docs/getting-started/authentication) を参照。\n\n## Mind Key と JWT の違いは何ですか？\n\n- **Mind Key**：テナントスコープ、期限切れなし、メモリ/チャット/タスクデータ用\n- **JWT**：ユーザースコープ、7 日間の有効期限、アカウント/mind 管理用\n\n[Mind Key vs JWT](/docs/getting-started/mind-key-vs-jwt) を参照。\n\n## 401 Unauthorized が出るのはなぜですか？\n\nよくある原因：\n\n1. `Authorization` ヘッダーの欠落\n2. 無効な Mind Key（`mk_` で始まるか確認）\n3. Mind Key が必要な場所で JWT を使用（またはその逆）\n4. Mind Key が失効している\n\n**対策：** トークンを確認してください。[Authentication](/docs/getting-started/authentication) を参照。\n\n## 404 Not Found が出るのはなぜですか？\n\n誤ったエンドポイントパスを使用しています。Synapse には `GET /endpoints` にリストされたパスのみが存在します。\n\n**対策：** `GET /endpoints` を呼び出して有効なパスをすべて確認してください。推測しないでください。\n\n## 429 Too Many Requests が出るのはなぜですか？\n\n`?key=` クエリパラメータ認証を使用しており、60 回/分にレート制限されています。\n\n**対策：** `Authorization: Bearer` ヘッダーに切り替えてください（レート制限なし）。\n\n[Rate Limits](/docs/api/rate-limits) を参照。\n\n## すべてのエンドポイントを一覧表示するには？\n\n```bash\ncurl https://synapse.schaefer.zone/endpoints\ncurl https://synapse.schaefer.zone/endpoints?format=text\n```\n\n## 適切なエンドポイントを見つけるには？\n\n1. `GET /endpoints` で機械可読リストを確認\n2. `GET /help` で完全な API ドキュメントを確認\n3. `GET /docs` でドキュメントシステムを参照\n4. `GET /openapi.json` で OpenAPI 3.0 仕様を使用\n\n## POST の代わりに GET を使用できますか？\n\n一部の POST エンドポイントには、URL 単体のツール向けに GET 版があります。\n\n- `POST /memory` ↔ `GET /memory/store?content=...`\n- `POST /mind/task` ↔ `GET /mind/task?title=...`\n- `POST /chat/reply` ↔ `GET /chat/reply?content=...`\n\n`GET /endpoints` で利用可能な GET バリアントを確認してください。\n\n## エラーはどう処理すればよいですか？\n\nすべてのエラーは JSON を返します。\n\n```json\n{\n  \"statusCode\": 401,\n  \"error\": \"Unauthorized\",\n  \"message\": \"Mind Key fehlt oder ungültig.\",\n  \"docs\": \"https://synapse.schaefer.zone/docs/getting-started/authentication\"\n}\n```\n\n[Errors & Error Handling](/docs/api/errors) を参照。\n\n## リクエストボディの上限は？\n\n10 MB です。それ以上のペイロード（ファイルアップロードなど）には multipart エンドポイントを使用してください。\n\n## API は CORS をサポートしていますか？\n\nはい。全エンドポイントが以下を返します。\n\n```\nAccess-Control-Allow-Origin: *\nAccess-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\nAccess-Control-Allow-Headers: Authorization, Content-Type, X-Synapse-JWT\n```\n\n## SDK はありますか？\n\nはい。\n\n- **Node.js**：`npm install synapse-memory-sdk`\n- **MCP**：`npx -y synapse-mcp-api@latest`\n\n詳しくは [API Overview](/docs/api/overview) を参照。\n\n## ページネーションはどうすればよいですか？\n\n`?limit=` と `?offset=` を使用します。\n\n```bash\ncurl \".../memory?limit=50&offset=100\"\n```\n\nデフォルト limit：100。最大：500。\n\n## カテゴリやタグでメモリをフィルタできますか？\n\nはい。\n\n```bash\ncurl \".../memory?category=project\"\ncurl \".../memory?tag=docker\"\ncurl \".../memory/by-tag?tag=production\"\n```\n\n## メモリを検索するには？\n\n2 つの方法があります。\n\n1. **FTS5 キーワード検索**：`GET /memory/search?q=docker+swarm`\n2. **セマンティック検索**：`GET /memory/semantic-search?q=container+orchestration`\n\n[FTS5 Search](/docs/concepts/fts5-search) と [Semantic Search](/docs/concepts/semantic-search) を参照。\n\n## メモリを更新するには？\n\n同じ `category` + `key` で `POST /memory` を呼び出すと、既存メモリが重複ではなく更新されます。\n\n```bash\n# Initial store\ncurl -X POST .../memory -d '{\"category\":\"fact\",\"key\":\"user_name\",\"content\":\"Michael\"}'\n\n# Update (same key)\ncurl -X POST .../memory -d '{\"category\":\"fact\",\"key\":\"user_name\",\"content\":\"Michael Schäfer\"}'\n```\n\n## メモリを削除するには？\n\n```bash\ncurl -X DELETE -H \"Authorization: Bearer $KEY\" \\\n     https://synapse.schaefer.zone/memory/mem_001\n```\n\n## 一括削除はできますか？\n\nはい。\n\n```bash\ncurl -X POST .../memory/bulk-delete \\\n  -d '{\"ids\": [\"mem_001\", \"mem_002\", \"mem_003\"]}'\n```\n\n## 次のステップ\n\n- [API Overview](/docs/api/overview)\n- [Errors & Error Handling](/docs/api/errors)\n- [Authentication](/docs/getting-started/authentication)\n","content_html":"<h1>API FAQ</h1>\n<p>Synapse API に関するよくある質問です。</p>\n<h2>認証はどうすればよいですか？</h2>\n<p>2 つの方法があります。</p>\n<ol>\n<li><strong>Mind Key</strong>（データエンドポイント用）：<code>Authorization: Bearer mk_...</code></li>\n<li><strong>JWT</strong>（アカウントエンドポイント用）：<code>Authorization: Bearer eyJ...</code></li>\n</ol>\n<p>またはクエリパラメータ経由（60 回/分の制限あり）：<code>?key=mk_...</code></p>\n<p><a href=\"/docs/getting-started/authentication\">Authentication</a> を参照。</p>\n<h2>Mind Key と JWT の違いは何ですか？</h2>\n<ul>\n<li><strong>Mind Key</strong>：テナントスコープ、期限切れなし、メモリ/チャット/タスクデータ用</li>\n<li><strong>JWT</strong>：ユーザースコープ、7 日間の有効期限、アカウント/mind 管理用</li>\n</ul>\n<p><a href=\"/docs/getting-started/mind-key-vs-jwt\">Mind Key vs JWT</a> を参照。</p>\n<h2>401 Unauthorized が出るのはなぜですか？</h2>\n<p>よくある原因：</p>\n<ol>\n<li><code>Authorization</code> ヘッダーの欠落</li>\n<li>無効な Mind Key（<code>mk_</code> で始まるか確認）</li>\n<li>Mind Key が必要な場所で JWT を使用（またはその逆）</li>\n<li>Mind Key が失効している</li>\n</ol>\n<p><strong>対策：</strong> トークンを確認してください。<a href=\"/docs/getting-started/authentication\">Authentication</a> を参照。</p>\n<h2>404 Not Found が出るのはなぜですか？</h2>\n<p>誤ったエンドポイントパスを使用しています。Synapse には <code>GET /endpoints</code> にリストされたパスのみが存在します。</p>\n<p><strong>対策：</strong> <code>GET /endpoints</code> を呼び出して有効なパスをすべて確認してください。推測しないでください。</p>\n<h2>429 Too Many Requests が出るのはなぜですか？</h2>\n<p><code>?key=</code> クエリパラメータ認証を使用しており、60 回/分にレート制限されています。</p>\n<p><strong>対策：</strong> <code>Authorization: Bearer</code> ヘッダーに切り替えてください（レート制限なし）。</p>\n<p><a href=\"/docs/api/rate-limits\">Rate Limits</a> を参照。</p>\n<h2>すべてのエンドポイントを一覧表示するには？</h2>\n<pre><code class=\"hljs language-bash\">curl https://synapse.schaefer.zone/endpoints\ncurl https://synapse.schaefer.zone/endpoints?format=text</code></pre><h2>適切なエンドポイントを見つけるには？</h2>\n<ol>\n<li><code>GET /endpoints</code> で機械可読リストを確認</li>\n<li><code>GET /help</code> で完全な API ドキュメントを確認</li>\n<li><code>GET /docs</code> でドキュメントシステムを参照</li>\n<li><code>GET /openapi.json</code> で OpenAPI 3.0 仕様を使用</li>\n</ol>\n<h2>POST の代わりに GET を使用できますか？</h2>\n<p>一部の POST エンドポイントには、URL 単体のツール向けに GET 版があります。</p>\n<ul>\n<li><code>POST /memory</code> ↔ <code>GET /memory/store?content=...</code></li>\n<li><code>POST /mind/task</code> ↔ <code>GET /mind/task?title=...</code></li>\n<li><code>POST /chat/reply</code> ↔ <code>GET /chat/reply?content=...</code></li>\n</ul>\n<p><code>GET /endpoints</code> で利用可能な GET バリアントを確認してください。</p>\n<h2>エラーはどう処理すればよいですか？</h2>\n<p>すべてのエラーは JSON を返します。</p>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;statusCode&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">401</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;error&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Unauthorized&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;message&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Mind Key fehlt oder ungültig.&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;docs&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/docs/getting-started/authentication&quot;</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><p><a href=\"/docs/api/errors\">Errors &amp; Error Handling</a> を参照。</p>\n<h2>リクエストボディの上限は？</h2>\n<p>10 MB です。それ以上のペイロード（ファイルアップロードなど）には multipart エンドポイントを使用してください。</p>\n<h2>API は CORS をサポートしていますか？</h2>\n<p>はい。全エンドポイントが以下を返します。</p>\n<pre><code class=\"hljs language-plaintext\">Access-Control-Allow-Origin: *\nAccess-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\nAccess-Control-Allow-Headers: Authorization, Content-Type, X-Synapse-JWT</code></pre><h2>SDK はありますか？</h2>\n<p>はい。</p>\n<ul>\n<li><strong>Node.js</strong>：<code>npm install synapse-memory-sdk</code></li>\n<li><strong>MCP</strong>：<code>npx -y synapse-mcp-api@latest</code></li>\n</ul>\n<p>詳しくは <a href=\"/docs/api/overview\">API Overview</a> を参照。</p>\n<h2>ページネーションはどうすればよいですか？</h2>\n<p><code>?limit=</code> と <code>?offset=</code> を使用します。</p>\n<pre><code class=\"hljs language-bash\">curl <span class=\"hljs-string\">&quot;.../memory?limit=50&amp;offset=100&quot;</span></code></pre><p>デフォルト limit：100。最大：500。</p>\n<h2>カテゴリやタグでメモリをフィルタできますか？</h2>\n<p>はい。</p>\n<pre><code class=\"hljs language-bash\">curl <span class=\"hljs-string\">&quot;.../memory?category=project&quot;</span>\ncurl <span class=\"hljs-string\">&quot;.../memory?tag=docker&quot;</span>\ncurl <span class=\"hljs-string\">&quot;.../memory/by-tag?tag=production&quot;</span></code></pre><h2>メモリを検索するには？</h2>\n<p>2 つの方法があります。</p>\n<ol>\n<li><strong>FTS5 キーワード検索</strong>：<code>GET /memory/search?q=docker+swarm</code></li>\n<li><strong>セマンティック検索</strong>：<code>GET /memory/semantic-search?q=container+orchestration</code></li>\n</ol>\n<p><a href=\"/docs/concepts/fts5-search\">FTS5 Search</a> と <a href=\"/docs/concepts/semantic-search\">Semantic Search</a> を参照。</p>\n<h2>メモリを更新するには？</h2>\n<p>同じ <code>category</code> + <code>key</code> で <code>POST /memory</code> を呼び出すと、既存メモリが重複ではなく更新されます。</p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Initial store</span>\ncurl -X POST .../memory -d <span class=\"hljs-string\">&#x27;{&quot;category&quot;:&quot;fact&quot;,&quot;key&quot;:&quot;user_name&quot;,&quot;content&quot;:&quot;Michael&quot;}&#x27;</span>\n\n<span class=\"hljs-comment\"># Update (same key)</span>\ncurl -X POST .../memory -d <span class=\"hljs-string\">&#x27;{&quot;category&quot;:&quot;fact&quot;,&quot;key&quot;:&quot;user_name&quot;,&quot;content&quot;:&quot;Michael Schäfer&quot;}&#x27;</span></code></pre><h2>メモリを削除するには？</h2>\n<pre><code class=\"hljs language-bash\">curl -X DELETE -H <span class=\"hljs-string\">&quot;Authorization: Bearer <span class=\"hljs-variable\">$KEY</span>&quot;</span> \\\n     https://synapse.schaefer.zone/memory/mem_001</code></pre><h2>一括削除はできますか？</h2>\n<p>はい。</p>\n<pre><code class=\"hljs language-bash\">curl -X POST .../memory/bulk-delete \\\n  -d <span class=\"hljs-string\">&#x27;{&quot;ids&quot;: [&quot;mem_001&quot;, &quot;mem_002&quot;, &quot;mem_003&quot;]}&#x27;</span></code></pre><h2>次のステップ</h2>\n<ul>\n<li><a href=\"/docs/api/overview\">API Overview</a></li>\n<li><a href=\"/docs/api/errors\">Errors &amp; Error Handling</a></li>\n<li><a href=\"/docs/getting-started/authentication\">Authentication</a></li>\n</ul>\n","urls":{"html":"/docs/faq/api-faq","text":"/docs/faq/api-faq?format=text","json":"/docs/faq/api-faq?format=json","llm":"/docs/faq/api-faq?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}