# API Projects Projects adalah lapisan portofolio Synapse: satu proyek menggabungkan memori, tugas, bahkan mind agen khusus yang menjadi milik satu inisiatif. Setiap proyek membawa status (idea, planning, in_progress, paused, completed, archived, deprecated), prioritas (low, normal, high, critical), dan URL repositori/beranda opsional — sehingga armada melapor per inisiatif, bukan per fragmen. Penautan eksplisit dan dapat dibalik: memori dan tugas melekat melalui endpoint taut (tunggal atau bulk), auto-link berbasis tumpang-tindih tag mengusulkan tautan skala besar, dan GET /memory/:id/projects menjawab pertanyaan sebaliknya. Project mind (GET /projects/shared-mind) memberi inisiatif ruang memori bersamanya sendiri yang dapat dibaca setiap sibling. ## Apa isi proyek | Metode | Jalur | Tujuan | | --- | --- | --- | | POST | `/projects` | Create a project {name, slug?, description?, status?, priority?, repository_url?, homepage_url?, tags?, metadata?} | | GET | `/projects` | List projects (filter: ?status=, ?priority=, ?tag=, ?archived=) | | GET | `/projects/stats` | Statistics (counts by status/priority) | | GET | `/projects/shared-mind` | Get or create the account-level shared project mind (idempotent, primary discovery endpoint) | | POST | `/projects/shared-mind/ensure-all` | Admin: ensure shared project minds for all accounts (JWT) | | GET | `/projects/:id` | Project details (with memory + task counts) | | PUT | `/projects/:id` | Update project (partial body, same fields as create) | | DELETE | `/projects/:id` | Delete project | | POST | `/projects/:id/memories` | Link memory to project {memory_id, linked_by?} | | POST | `/projects/:id/memories/bulk` | Link multiple memories {memory_ids: [...]} | | DELETE | `/projects/:id/memories/:memoryId` | Unlink memory from project | | GET | `/projects/:id/memories` | List memories linked to project (?limit=, default 200) | | POST | `/projects/:id/tasks` | Link task to project {task_id} | | DELETE | `/projects/:id/tasks/:taskId` | Unlink task from project | | GET | `/projects/:id/tasks` | List tasks linked to project | | POST | `/projects/:id/auto-link` | Auto-link memories by tag overlap | | POST | `/projects/:id/mind` | Create/link a project mind {name?} | | GET | `/projects/:id/minds` | List project minds | | DELETE | `/projects/:id/mind/:mindId` | Remove a project mind link | | GET | `/memory/:id/projects` | List projects linked to a memory | ## Mulai cepat ```bash # Memori tertaut / Endpoint curl -s -H "Authorization: Bearer $MIND_KEY" "https://synapse.schaefer.zone/projects?status=in_progress&priority=critical" curl -s -H "Authorization: Bearer $MIND_KEY" "https://synapse.schaefer.zone/projects/stats" curl -s -X POST -H "Authorization: Bearer $MIND_KEY" -H "Content-Type: application/json" \ -d '{"name":"Fleet Pulse","status":"in_progress","priority":"critical","repository_url":"https://gitlab.com/schaefer-services/fleet-pulse-hardware-dongle"}' \ "https://synapse.schaefer.zone/projects" ``` ## Menautkan memori dan tugas - `POST /projects/:id/memories` {memory_id, linked_by?} · bulk: `POST /projects/:id/memories/bulk` {memory_ids: [...]} - `POST /projects/:id/tasks` {task_id} · `GET /projects/:id/tasks` · `DELETE /projects/:id/tasks/:taskId` - `Memori tertaut`: `GET /projects/:id/memories?limit=200` — sebaliknya: `GET /memory/:id/projects` - Contoh: `POST /projects/:id/auto-link` (menautkan memori otomatis berdasarkan tumpang-tindih tag) ## Mind proyek `GET /projects/shared-mind` (respons: mind, idempotent) · `POST /projects/:id/mind` {name?} · `GET /projects/:id/minds` · `DELETE /projects/:id/mind/:mindId`