{"title":"API користувачів та mind-ів","slug":"user","category":"api","summary":"Керування обліковим записом — реєстрація, вхід, створення mind-ів, список mind-ів, видалення mind-ів. Захищено JWT.","audience":["human","llm"],"tags":["api","user","account","minds","jwt"],"difficulty":"beginner","updated":"2026-06-27","word_count":284,"read_minutes":1,"llm_context":"Auth: JWT (from /register or /login)\nRegister: POST /register { email, password, display_name? } → returns JWT\nLogin: POST /login { email, password } → returns JWT\nCreate mind: POST /minds { name, description? } → returns mind_key (shown once!)\nList minds: GET /minds\nDelete mind: DELETE /minds/:id (irreversible — deletes all memories!)\nJWT expires after 7 days. Mind Key never expires.\nMind Key is shown only once at creation — save it permanently.\n","lang":"uk","translated":true,"requested_lang":"uk","content_markdown":"\n# API користувачів та mind-ів\n\nAPI користувачів та mind-ів обробляє керування обліковим записом. Ці кінцеві\nточки використовують JWT-автентифікацію (а не Mind Keys), оскільки працюють на\nрівні облікового запису, а не на рівні mind-у.\n\n## Кінцеві точки автентифікації\n\n### POST /register\n\nСтворити новий обліковий запис користувача.\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/register \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"you@example.com\",\n    \"password\": \"your-secure-password\",\n    \"display_name\": \"Michael\"\n  }'\n```\n\nВідповідь:\n\n```json\n{\n  \"jwt\": \"eyJhbGci...\",\n  \"user\": {\n    \"id\": \"u_abc123\",\n    \"email\": \"you@example.com\",\n    \"display_name\": \"Michael\",\n    \"created_at\": \"2026-06-27T...\"\n  }\n}\n```\n\n### POST /login\n\nУвійти до наявного облікового запису.\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"email\": \"you@example.com\",\n    \"password\": \"your-secure-password\"\n  }'\n```\n\nВідповідь: як у `/register`.\n\n## Кінцеві точки mind-ів\n\n### POST /minds\n\nСтворити новий mind. Повертає Mind Key — **збережіть його негайно**, він\nпоказується лише один раз.\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/minds \\\n  -H \"Authorization: Bearer YOUR_JWT\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"name\": \"Work Mind\",\n    \"description\": \"Job-related memories\"\n  }'\n```\n\nВідповідь:\n\n```json\n{\n  \"id\": \"m_xyz789\",\n  \"name\": \"Work Mind\",\n  \"description\": \"Job-related memories\",\n  \"mind_key\": \"mk_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789\",\n  \"created_at\": \"2026-06-27T...\"\n}\n```\n\n> [!CRITICAL]\n> `mind_key` показується лише один раз. Якщо ви його втратите, відновити його\n> неможливо — доведеться видалити mind і створити новий (що знищить усі збережені\n> спогади).\n\n### GET /minds\n\nСписок усіх mind-ів для поточного користувача.\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_JWT\" \\\n     https://synapse.schaefer.zone/minds\n```\n\nВідповідь:\n\n```json\n{\n  \"minds\": [\n    {\n      \"id\": \"m_xyz789\",\n      \"name\": \"Work Mind\",\n      \"description\": \"Job-related memories\",\n      \"created_at\": \"2026-06-27T...\",\n      \"memory_count\": 142,\n      \"last_activity\": \"2026-06-27T...\"\n    }\n  ]\n}\n```\n\n### DELETE /minds/:id\n\nВидалити mind назавжди.\n\n```bash\ncurl -X DELETE -H \"Authorization: Bearer YOUR_JWT\" \\\n     https://synapse.schaefer.zone/minds/m_xyz789\n```\n\n> [!WARNING]\n> Видалення mind **незворотне**. Усі спогади, завдання, історія чату та скрипти\n> в цьому mind-і будуть безповоротно втрачені. Спочатку експортуйте через\n> `GET /memory/mind-export`, якщо потрібна резервна копія.\n\n## Шаблон кількох mind-ів\n\nБільшості користувачів корисно мати кілька mind-ів для ізоляції контекстів:\n\n```bash\n# Створення mind-ів для різних контекстів\ncurl -X POST .../minds -d '{\"name\": \"work\", \"description\": \"Job\"}'\n# → mind_key: mk_work...\n\ncurl -X POST .../minds -d '{\"name\": \"personal\", \"description\": \"Personal life\"}'\n# → mind_key: mk_personal...\n\ncurl -X POST .../minds -d '{\"name\": \"project-synapse\", \"description\": \"Synapse dev\"}'\n# → mind_key: mk_synapse...\n```\n\nВикористовуйте різні Mind Keys у різних сесіях LLM, щоб ізолювати контексти.\n\n## Безпека облікового запису\n\n### Вимоги до пароля\n\n- Мінімум 6 символів\n- Без максимуму (використовуйте менеджер паролів)\n- Зберігається як bcrypt-хеш (ніколи у відкритому вигляді)\n\n### Термін дії JWT\n\nJWT-токени закінчуються через **7 днів**. Коли термін дії закінчується, просто\nвикличте `/login` знову.\n\n### Безпека Mind Key\n\nMind Keys ніколи не закінчуються. Якщо Mind Key скомпрометовано:\n\n1. Створіть новий mind через `POST /minds`\n2. Оновіть конфігурацію LLM новим Mind Key\n3. Видаліть скомпрометований mind через `DELETE /minds/:id`\n\n## Наступні кроки\n\n- [Автентифікація](/docs/getting-started/authentication) — повний посібник з автентифікації\n- [Mind Key проти JWT](/docs/getting-started/mind-key-vs-jwt) — посібник з вибору\n- [API спільного доступу](/docs/api/user) — надання іншим користувачам доступу до mind-ів\n","content_html":"<h1>API користувачів та mind-ів</h1>\n<p>API користувачів та mind-ів обробляє керування обліковим записом. Ці кінцеві\nточки використовують JWT-автентифікацію (а не Mind Keys), оскільки працюють на\nрівні облікового запису, а не на рівні mind-у.</p>\n<h2>Кінцеві точки автентифікації</h2>\n<h3>POST /register</h3>\n<p>Створити новий обліковий запис користувача.</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/register \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{\n    &quot;email&quot;: &quot;you@example.com&quot;,\n    &quot;password&quot;: &quot;your-secure-password&quot;,\n    &quot;display_name&quot;: &quot;Michael&quot;\n  }&#x27;</span></code></pre><p>Відповідь:</p>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;jwt&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;eyJhbGci...&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;user&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">{</span>\n    <span class=\"hljs-attr\">&quot;id&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;u_abc123&quot;</span><span class=\"hljs-punctuation\">,</span>\n    <span class=\"hljs-attr\">&quot;email&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;you@example.com&quot;</span><span class=\"hljs-punctuation\">,</span>\n    <span class=\"hljs-attr\">&quot;display_name&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Michael&quot;</span><span class=\"hljs-punctuation\">,</span>\n    <span class=\"hljs-attr\">&quot;created_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;2026-06-27T...&quot;</span>\n  <span class=\"hljs-punctuation\">}</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><h3>POST /login</h3>\n<p>Увійти до наявного облікового запису.</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/login \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{\n    &quot;email&quot;: &quot;you@example.com&quot;,\n    &quot;password&quot;: &quot;your-secure-password&quot;\n  }&#x27;</span></code></pre><p>Відповідь: як у <code>/register</code>.</p>\n<h2>Кінцеві точки mind-ів</h2>\n<h3>POST /minds</h3>\n<p>Створити новий mind. Повертає Mind Key — <strong>збережіть його негайно</strong>, він\nпоказується лише один раз.</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/minds \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_JWT&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{\n    &quot;name&quot;: &quot;Work Mind&quot;,\n    &quot;description&quot;: &quot;Job-related memories&quot;\n  }&#x27;</span></code></pre><p>Відповідь:</p>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;id&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;m_xyz789&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;name&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Work Mind&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;description&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Job-related memories&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;mind_key&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;mk_aBcDeFgHiJkLmNoPqRsTuVwXyZ0123456789&quot;</span><span class=\"hljs-punctuation\">,</span>\n  <span class=\"hljs-attr\">&quot;created_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;2026-06-27T...&quot;</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><div class=\"callout callout-critical\">`mind_key` показується лише один раз. Якщо ви його втратите, відновити його\nнеможливо — доведеться видалити mind і створити новий (що знищить усі збережені\nспогади).</div><h3>GET /minds</h3>\n<p>Список усіх mind-ів для поточного користувача.</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_JWT&quot;</span> \\\n     https://synapse.schaefer.zone/minds</code></pre><p>Відповідь:</p>\n<pre><code class=\"hljs language-json\"><span class=\"hljs-punctuation\">{</span>\n  <span class=\"hljs-attr\">&quot;minds&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-punctuation\">[</span>\n    <span class=\"hljs-punctuation\">{</span>\n      <span class=\"hljs-attr\">&quot;id&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;m_xyz789&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;name&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Work Mind&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;description&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;Job-related memories&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;created_at&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;2026-06-27T...&quot;</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;memory_count&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-number\">142</span><span class=\"hljs-punctuation\">,</span>\n      <span class=\"hljs-attr\">&quot;last_activity&quot;</span><span class=\"hljs-punctuation\">:</span> <span class=\"hljs-string\">&quot;2026-06-27T...&quot;</span>\n    <span class=\"hljs-punctuation\">}</span>\n  <span class=\"hljs-punctuation\">]</span>\n<span class=\"hljs-punctuation\">}</span></code></pre><h3>DELETE /minds/:id</h3>\n<p>Видалити mind назавжди.</p>\n<pre><code class=\"hljs language-bash\">curl -X DELETE -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_JWT&quot;</span> \\\n     https://synapse.schaefer.zone/minds/m_xyz789</code></pre><div class=\"callout callout-warn\">Видалення mind **незворотне**. Усі спогади, завдання, історія чату та скрипти\nв цьому mind-і будуть безповоротно втрачені. Спочатку експортуйте через\n`GET /memory/mind-export`, якщо потрібна резервна копія.</div><h2>Шаблон кількох mind-ів</h2>\n<p>Більшості користувачів корисно мати кілька mind-ів для ізоляції контекстів:</p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Створення mind-ів для різних контекстів</span>\ncurl -X POST .../minds -d <span class=\"hljs-string\">&#x27;{&quot;name&quot;: &quot;work&quot;, &quot;description&quot;: &quot;Job&quot;}&#x27;</span>\n<span class=\"hljs-comment\"># → mind_key: mk_work...</span>\n\ncurl -X POST .../minds -d <span class=\"hljs-string\">&#x27;{&quot;name&quot;: &quot;personal&quot;, &quot;description&quot;: &quot;Personal life&quot;}&#x27;</span>\n<span class=\"hljs-comment\"># → mind_key: mk_personal...</span>\n\ncurl -X POST .../minds -d <span class=\"hljs-string\">&#x27;{&quot;name&quot;: &quot;project-synapse&quot;, &quot;description&quot;: &quot;Synapse dev&quot;}&#x27;</span>\n<span class=\"hljs-comment\"># → mind_key: mk_synapse...</span></code></pre><p>Використовуйте різні Mind Keys у різних сесіях LLM, щоб ізолювати контексти.</p>\n<h2>Безпека облікового запису</h2>\n<h3>Вимоги до пароля</h3>\n<ul>\n<li>Мінімум 6 символів</li>\n<li>Без максимуму (використовуйте менеджер паролів)</li>\n<li>Зберігається як bcrypt-хеш (ніколи у відкритому вигляді)</li>\n</ul>\n<h3>Термін дії JWT</h3>\n<p>JWT-токени закінчуються через <strong>7 днів</strong>. Коли термін дії закінчується, просто\nвикличте <code>/login</code> знову.</p>\n<h3>Безпека Mind Key</h3>\n<p>Mind Keys ніколи не закінчуються. Якщо Mind Key скомпрометовано:</p>\n<ol>\n<li>Створіть новий mind через <code>POST /minds</code></li>\n<li>Оновіть конфігурацію LLM новим Mind Key</li>\n<li>Видаліть скомпрометований mind через <code>DELETE /minds/:id</code></li>\n</ol>\n<h2>Наступні кроки</h2>\n<ul>\n<li><a href=\"/docs/getting-started/authentication\">Автентифікація</a> — повний посібник з автентифікації</li>\n<li><a href=\"/docs/getting-started/mind-key-vs-jwt\">Mind Key проти JWT</a> — посібник з вибору</li>\n<li><a href=\"/docs/api/user\">API спільного доступу</a> — надання іншим користувачам доступу до mind-ів</li>\n</ul>\n","urls":{"html":"/docs/api/user","text":"/docs/api/user?format=text","json":"/docs/api/user?format=json","llm":"/docs/api/user?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}