# API Catalog — รายการ API ทั้งหมด

**GOFLOW Enterprise AI OS Master Package v4.0** · อ้างอิง [ENG-15](../docs/engineering-os/00-index.md) · ไฟล์ OpenAPI: [openapi.yaml](openapi.yaml)

> สเปกเต็มอยู่ใน `api/openapi.yaml` (OpenAPI 3.0.3) — นำเข้า Swagger UI / Redoc / Postman ได้เลย

## กลุ่ม API

| กลุ่ม | เส้นทาง | เอกสารอ้างอิง | สถานะ |
|---|---|---|---|
| Auth | `/auth/register`, `/auth/login`, `/auth/refresh` | [ENG-14](../docs/engineering-os/00-index.md) | ✅ Foundation |
| AI Chat | `POST /api/ai/chat` (NEXUS AI v7.3) | [AI-37](../docs/ai-os/00-index.md) | ✅ Production |
| AI Resolve | `POST /api/ai/resolve` (AI Workforce) | [AI-13](../docs/ai-os/00-index.md) | 🚧 Sprint 2 |
| Knowledge | `POST /api/knowledge/search` (RAG) | [KB-04](../docs/knowledge-center/00-index.md) | 🚧 Sprint 2 |
| Executive | `GET /api/executive/report`, `/api/executive/tasks` | [AI-36](../docs/ai-os/00-index.md) | 🚧 Sprint 3 |
| Bookings | `POST /api/bookings` | [COM-11](../docs/commercial-os/00-index.md) | 🚧 Sprint 1 |
| Recruitment | `POST /api/applications` | [COM-24](../docs/commercial-os/00-index.md) | 🚧 Sprint 1 |
| Contact | `POST /api/contact`, `POST /api/partners/apply` | [COM-17](../docs/commercial-os/00-index.md) | 🚧 Sprint 1 |
| Marketplace | `/api/marketplace/*` (products, orders, carts) | [BIZ-02](../docs/business-os/00-index.md) | 🚧 Sprint 3 |
| Wallet | `/api/wallet/*` (balance, transfer, topup) | [BIZ-40](../docs/business-os/00-index.md) | 🚧 Sprint 4 |

## มาตรฐานการเรียก API

- **Base URL:** `https://api.goflow.click/v1` (Production)
- **Auth:** `Authorization: Bearer <JWT>` — access token อายุ 15 นาที, refresh token 7 วัน
- **รูปแบบ error:**

```json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "อีเมลไม่ถูกต้อง",
    "details": [{ "field": "email", "reason": "invalid_format" }]
  }
}
```

- **รหัสสถานะ:** 200 OK · 201 Created · 400 Bad Request · 401 Unauthorized · 403 Forbidden · 404 Not Found · 409 Conflict · 422 Unprocessable · 429 Too Many Requests · 500 Server Error

## ตัวอย่าง: สนทนากับ NEXUS AI

```bash
curl -X POST https://api.goflow.click/v1/ai/chat \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "message": "ระบบ Agent Runtime ทำงานอย่างไร",
    "reasoningMode": "rag-memory-intelligence-fusion-reasoning-v7.3"
  }'
```

## ความเชื่อมโยง (Digital Twin)

- ทุก API มีเอกสารอ้างอิงใน Engineering OS / AI OS
- ตัวอย่างโค้ด: [examples.md](examples.md)
- Knowledge Graph เก็บความสัมพันธ์ API ↔ เอกสาร: [../knowledge/knowledge-graph.json](../knowledge/knowledge-graph.json)

*ส่วนหนึ่งของ GOFLOW Enterprise AI OS Master Package v4.0*
