# ภาพรวม API และ Base URL SUMMARY: endpoint ทั้งหมดของ Synapse API, base URL, รูปแบบการยืนยันตัวตน และรูปแบบการตอบกลับในภาพรวม KEY CONTEXT: Base URL: https://synapse.schaefer.zone Auth: Authorization: Bearer YOUR_MIND_KEY (header, no rate limit) OR ?key=YOUR_MIND_KEY (query, 60 req/min) All responses are JSON except /memory/recall (text/plain) and /docs (HTML/text/json) All 404 responses mean the path does not exist — do NOT guess paths. GET /endpoints returns machine-readable list of all valid endpoints. ภาพรวม API และ Base URL Synapse API เป็น RESTful HTTP API ทุก endpoint ส่งกลับเป็น JSON (ยกเว้นในกรณีที่ระบุไว้เป็นอย่างอื่น) เอกสารหน้านี้ครอบคลุมสิ่งสำคัญที่คุณต้องรู้ก่อนเจาะลึก endpoint เฉพาะทาง Base URL [CODE BLOCK] พาธทั้งหมดในเอกสารนี้เป็นแบบ relative ต่อ base URL นี้ สำหรับ instance ที่ self-hosted ให้แทนที่ด้วย URL ของคุณเอง การยืนยันตัวตน มีสองวิธี ทั้งคู่ส่งผ่าน header: [CODE BLOCK] หรือผ่าน query parameter (จำกัดอัตรา 60 ครั้ง/นาที): [CODE BLOCK] ดูรายละเอียดที่ Authentication กลุ่มของ Endpoint | กลุ่ม | Auth | คำอธิบาย | |-------|------|-------------| | Public | None | Landing page, health, OpenAPI, docs | | Memory | Mind Key | CRUD, search, sync, embeddings | | Chat | Mind Key / JWT | การส่งข้อความแบบ asynchronous ระหว่าง human และ agent | | Tasks | Mind Key | การจัดการ task | | Scripts | Mind Key / JWT | ที่เก็บ script แบบถาวร | | Scheduler | Mind Key | Cron jobs + variables | | Webhooks | Mind Key | HTTP callback บน event | | Computers | Mind Key / JWT | ควบคุม computer ระยะไกล | | User/Minds | JWT | บัญชี + การจัดการ mind | | Sharing | JWT | การแชร์ mind ระหว่างผู้ใช้ | | Push | JWT | Web Push subscriptions | | Tools | None | Time, calc, random (public utilities) | รูปแบบการตอบกลับ - JSON (ค่าเริ่มต้น): - Plain text: ส่งกลับเป็น text ที่ปรับให้เหมาะกับ LLM - HTML: , , , , Standard Response Envelope Response สำเร็จส่งข้อมูลกลับมาโดยตรง: [CODE BLOCK] Response ผิดพลาดใช้รูปแบบนี้: [CODE BLOCK] > [!NOTE] > ฟิลด์ เชื่อมโยงไปยังเอกสารที่เกี่ยวข้องสำหรับ error ทั่วไป HTTP Status Codes | Code | ความหมาย | |------|---------| | 200 | Success (GET, PUT) | | 201 | Created (POST) | | 204 | No content (DELETE) | | 400 | Bad request (validation error) | | 401 | Unauthorized (missing/invalid token) | | 403 | Forbidden (wrong token type) | | 404 | Not found (path doesn't exist) | | 409 | Conflict (duplicate) | | 429 | Too many requests (rate limit) | | 500 | Server error | Discoverability Endpoints | Endpoint | วัตถุประสงค์ | |----------|---------| | | Landing page (LLM-optimized) | | | รายการ machine-readable ของ endpoint ทั้งหมด | | | รายการ endpoint ในรูปแบบ plain-text | | | OpenAPI 3.0 specification | | | เอกสาร API แบบเต็ม (HTML) | | | เอกสาร API ในรูปแบบ JSON | | | ระบบเอกสาร (HTML) | | | ดัชนีเอกสาร (JSON) | | | เอกสารทั้งหมดในรูปแบบ text block เดียว | | | Interactive API playground | Rate Limits | วิธี Auth | Limit | |-------------|-------| | Mind Key (header) | None | | Mind Key (?key=) | 60/min per IP | | JWT (header) | None | | Public endpoints | None | Response ที่ถูกจำกัดอัตราจะมี: [CODE BLOCK] Pagination Endpoint แบบ list รองรับ และ : [CODE BLOCK] Limit เริ่มต้น: 100 สูงสุด: 500 CORS ทุก endpoint รองรับ CORS สำหรับ client ที่เป็น browser: [CODE BLOCK] SDKs & Clients - Node.js SDK: (repo) - MCP Server: (repo) - HTTP client: ไลบรารี HTTP ใดก็ได้ (curl, fetch, axios, etc.) ขั้นตอนถัดไป - Memory API — endpoint ที่สำคัญที่สุด - Chat API — การสื่อสารระหว่าง human-agent แบบ asynchronous - Errors & Error Handling