{"title":"API Utilisateur & Minds","slug":"user","category":"api","summary":"Gestion de compte — inscription, connexion, création de minds, liste de minds, suppression de minds. Protégé par JWT.","audience":["human","llm"],"tags":["api","user","account","minds","jwt"],"difficulty":"beginner","updated":"2026-06-27","word_count":332,"read_minutes":2,"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":"fr","translated":true,"requested_lang":"fr","content_markdown":"\n# API Utilisateur & Minds\n\nL'API Utilisateur & Minds gère l'administration de compte. Ces endpoints utilisent\nl'authentification JWT (pas les Mind Keys) car ils opèrent au niveau du compte, pas au\nniveau du mind.\n\n## Endpoints d'authentification\n\n### POST /register\n\nCrée un nouveau compte utilisateur.\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\nRéponse :\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\nConnexion à un compte existant.\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\nRéponse : identique à `/register`.\n\n## Endpoints Minds\n\n### POST /minds\n\nCrée un nouveau mind. Renvoie la Mind Key — **sauvegardez-la immédiatement**, elle\nn'est affichée qu'une seule fois.\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\nRéponse :\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> La `mind_key` n'est affichée qu'une seule fois. Si vous la perdez, vous ne pouvez\n> pas la récupérer — vous devez supprimer le mind et en créer un nouveau (ce qui\n> perd toutes les mémoires stockées).\n\n### GET /minds\n\nListe tous les minds de l'utilisateur courant.\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_JWT\" \\\n     https://synapse.schaefer.zone/minds\n```\n\nRéponse :\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\nSupprime un mind définitivement.\n\n```bash\ncurl -X DELETE -H \"Authorization: Bearer YOUR_JWT\" \\\n     https://synapse.schaefer.zone/minds/m_xyz789\n```\n\n> [!WARNING]\n> Supprimer un mind est **irréversible**. Toutes les mémoires, tâches, historique de\n> chat et scripts de ce mind sont définitivement perdus. Exportez d'abord via\n> `GET /memory/mind-export` si vous avez besoin d'une sauvegarde.\n\n## Schéma multi-mind\n\nLa plupart des utilisateurs bénéficient de plusieurs minds pour isoler les contextes :\n\n```bash\n# Créer des minds pour différents contextes\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\nUtilisez différentes Mind Keys dans différentes sessions LLM pour garder les contextes\nisolés.\n\n## Sécurité du compte\n\n### Exigences de mot de passe\n\n- Minimum 6 caractères\n- Pas de maximum (utilisez un gestionnaire de mots de passe)\n- Stocké sous forme de hachage bcrypt (jamais en clair)\n\n### Expiration du JWT\n\nLes JWT expirent après **7 jours**. Une fois expirés, appelez simplement `/login` à\nnouveau.\n\n### Sécurité de la Mind Key\n\nLes Mind Keys n'expirent jamais. Si une Mind Key est compromise :\n\n1. Créez un nouveau mind via `POST /minds`\n2. Mettez à jour votre configuration LLM avec la nouvelle Mind Key\n3. Supprimez le mind compromis via `DELETE /minds/:id`\n\n## Prochaines étapes\n\n- [Authentification](/docs/getting-started/authentication) — guide complet d'auth\n- [Mind Key vs JWT](/docs/getting-started/mind-key-vs-jwt) — guide de décision\n- [API Sharing](/docs/api/user) — partager des minds avec d'autres utilisateurs\n","content_html":"<h1>API Utilisateur &amp; Minds</h1>\n<p>L&#39;API Utilisateur &amp; Minds gère l&#39;administration de compte. Ces endpoints utilisent\nl&#39;authentification JWT (pas les Mind Keys) car ils opèrent au niveau du compte, pas au\nniveau du mind.</p>\n<h2>Endpoints d&#39;authentification</h2>\n<h3>POST /register</h3>\n<p>Crée un nouveau compte utilisateur.</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>Réponse :</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>Connexion à un compte existant.</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>Réponse : identique à <code>/register</code>.</p>\n<h2>Endpoints Minds</h2>\n<h3>POST /minds</h3>\n<p>Crée un nouveau mind. Renvoie la Mind Key — <strong>sauvegardez-la immédiatement</strong>, elle\nn&#39;est affichée qu&#39;une seule fois.</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>Réponse :</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\">La `mind_key` n'est affichée qu'une seule fois. Si vous la perdez, vous ne pouvez\npas la récupérer — vous devez supprimer le mind et en créer un nouveau (ce qui\nperd toutes les mémoires stockées).</div><h3>GET /minds</h3>\n<p>Liste tous les minds de l&#39;utilisateur courant.</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>Réponse :</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>Supprime un mind définitivement.</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\">Supprimer un mind est **irréversible**. Toutes les mémoires, tâches, historique de\nchat et scripts de ce mind sont définitivement perdus. Exportez d'abord via\n`GET /memory/mind-export` si vous avez besoin d'une sauvegarde.</div><h2>Schéma multi-mind</h2>\n<p>La plupart des utilisateurs bénéficient de plusieurs minds pour isoler les contextes :</p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Créer des minds pour différents contextes</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>Utilisez différentes Mind Keys dans différentes sessions LLM pour garder les contextes\nisolés.</p>\n<h2>Sécurité du compte</h2>\n<h3>Exigences de mot de passe</h3>\n<ul>\n<li>Minimum 6 caractères</li>\n<li>Pas de maximum (utilisez un gestionnaire de mots de passe)</li>\n<li>Stocké sous forme de hachage bcrypt (jamais en clair)</li>\n</ul>\n<h3>Expiration du JWT</h3>\n<p>Les JWT expirent après <strong>7 jours</strong>. Une fois expirés, appelez simplement <code>/login</code> à\nnouveau.</p>\n<h3>Sécurité de la Mind Key</h3>\n<p>Les Mind Keys n&#39;expirent jamais. Si une Mind Key est compromise :</p>\n<ol>\n<li>Créez un nouveau mind via <code>POST /minds</code></li>\n<li>Mettez à jour votre configuration LLM avec la nouvelle Mind Key</li>\n<li>Supprimez le mind compromis via <code>DELETE /minds/:id</code></li>\n</ol>\n<h2>Prochaines étapes</h2>\n<ul>\n<li><a href=\"/docs/getting-started/authentication\">Authentification</a> — guide complet d&#39;auth</li>\n<li><a href=\"/docs/getting-started/mind-key-vs-jwt\">Mind Key vs JWT</a> — guide de décision</li>\n<li><a href=\"/docs/api/user\">API Sharing</a> — partager des minds avec d&#39;autres utilisateurs</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"]}