# API Documentation

# ASETQU V.2 - Digital Asset Ecosystem Platform

---

## 📋 Document Information

| Item               | Detail                          |
| ------------------ | ------------------------------- |
| **Project Name**   | ASETQU V.2                      |
| **Document Type**  | API Documentation               |
| **API Version**    | v1.0.0                          |
| **Base URL**       | `https://api.asetqu.com/api/v1` |
| **Authentication** | Laravel Sanctum (Bearer Token)  |
| **Created Date**   | January 2026                    |

---

## 1. Overview

### 1.1 API Standards

-   **Protocol**: HTTPS
-   **Format**: JSON
-   **Encoding**: UTF-8
-   **Date Format**: ISO 8601 (YYYY-MM-DDTHH:mm:ssZ)
-   **Pagination**: Cursor-based or offset-based

### 1.2 Authentication

All authenticated endpoints require a Bearer token in the Authorization header:

```http
Authorization: Bearer {token}
```

### 1.3 Response Structure

**Success Response:**

```json
{
    "success": true,
    "message": "Operation successful",
    "data": { ... }
}
```

**Error Response:**

```json
{
    "success": false,
    "message": "Error description",
    "errors": {
        "field": ["Error message"]
    }
}
```

### 1.4 HTTP Status Codes

| Code | Description                              |
| ---- | ---------------------------------------- |
| 200  | OK - Request successful                  |
| 201  | Created - Resource created               |
| 204  | No Content - Successful deletion         |
| 400  | Bad Request - Invalid request            |
| 401  | Unauthorized - Authentication required   |
| 403  | Forbidden - Access denied                |
| 404  | Not Found - Resource not found           |
| 422  | Unprocessable Entity - Validation failed |
| 429  | Too Many Requests - Rate limit exceeded  |
| 500  | Internal Server Error                    |

---

## 2. Authentication API

### 2.1 Register

Create a new user account.

**Endpoint:** `POST /auth/register`

**Request Body:**

```json
{
    "name": "John Doe",
    "email": "john@example.com",
    "password": "Password123!",
    "password_confirmation": "Password123!",
    "phone": "+6281234567890",
    "terms": true
}
```

**Response (201):**

```json
{
    "success": true,
    "message": "Registration successful. Please verify your email.",
    "data": {
        "user": {
            "id": 1,
            "uuid": "550e8400-e29b-41d4-a716-446655440000",
            "name": "John Doe",
            "email": "john@example.com",
            "phone": "+6281234567890",
            "status": "pending",
            "created_at": "2026-01-06T10:00:00Z"
        }
    }
}
```

---

### 2.2 Login

Authenticate user and get access token.

**Endpoint:** `POST /auth/login`

**Request Body:**

```json
{
    "email": "john@example.com",
    "password": "Password123!",
    "remember": true
}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Login successful",
    "data": {
        "user": {
            "id": 1,
            "uuid": "550e8400-e29b-41d4-a716-446655440000",
            "name": "John Doe",
            "email": "john@example.com",
            "avatar": null,
            "coin_balance": 1500,
            "point_balance": 300,
            "roles": ["visitor"]
        },
        "token": "1|abcdefghijklmnopqrstuvwxyz123456",
        "token_type": "Bearer",
        "expires_at": "2026-02-06T10:00:00Z"
    }
}
```

---

### 2.3 Logout

Revoke current access token.

**Endpoint:** `POST /auth/logout`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Logged out successfully"
}
```

---

### 2.4 Forgot Password

Request password reset email.

**Endpoint:** `POST /auth/forgot-password`

**Request Body:**

```json
{
    "email": "john@example.com"
}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Password reset link sent to your email"
}
```

---

### 2.5 Reset Password

Reset password with token.

**Endpoint:** `POST /auth/reset-password`

**Request Body:**

```json
{
    "email": "john@example.com",
    "token": "reset_token_here",
    "password": "NewPassword123!",
    "password_confirmation": "NewPassword123!"
}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Password reset successful"
}
```

---

### 2.6 Get Current User

Get authenticated user profile.

**Endpoint:** `GET /auth/me`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (200):**

```json
{
    "success": true,
    "data": {
        "id": 1,
        "uuid": "550e8400-e29b-41d4-a716-446655440000",
        "name": "John Doe",
        "email": "john@example.com",
        "phone": "+6281234567890",
        "avatar": "https://cdn.asetqu.com/avatars/1.jpg",
        "status": "active",
        "coin_balance": 1500,
        "point_balance": 300,
        "email_verified_at": "2026-01-06T12:00:00Z",
        "last_login_at": "2026-01-06T14:00:00Z",
        "roles": ["visitor"],
        "created_at": "2026-01-06T10:00:00Z"
    }
}
```

---

## 3. User Profile API

### 3.1 Update Profile

Update user profile information.

**Endpoint:** `PUT /profile`

**Headers:**

```http
Authorization: Bearer {token}
```

**Request Body:**

```json
{
    "name": "John Doe Updated",
    "phone": "+6281234567899"
}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Profile updated successfully",
    "data": {
        "id": 1,
        "name": "John Doe Updated",
        "email": "john@example.com",
        "phone": "+6281234567899"
    }
}
```

---

### 3.2 Update Avatar

Upload new avatar image.

**Endpoint:** `POST /profile/avatar`

**Headers:**

```http
Authorization: Bearer {token}
Content-Type: multipart/form-data
```

**Request Body:**

```
avatar: (binary file, max 2MB, jpg/png)
```

**Response (200):**

```json
{
    "success": true,
    "message": "Avatar updated successfully",
    "data": {
        "avatar_url": "https://cdn.asetqu.com/avatars/1_new.jpg"
    }
}
```

---

### 3.3 Change Password

Update user password.

**Endpoint:** `PUT /profile/password`

**Headers:**

```http
Authorization: Bearer {token}
```

**Request Body:**

```json
{
    "current_password": "OldPassword123!",
    "password": "NewPassword123!",
    "password_confirmation": "NewPassword123!"
}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Password changed successfully"
}
```

---

## 4. Wallet API

### 4.1 List Wallets

Get user's wallet list.

**Endpoint:** `GET /wallets`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (200):**

```json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "platform": {
                "id": 1,
                "name": "MetaMask",
                "slug": "metamask",
                "type": "web3",
                "icon": "https://cdn.asetqu.com/icons/metamask.svg"
            },
            "wallet_address": "0x1234...abcd",
            "label": "Main Wallet",
            "is_primary": true,
            "is_verified": true,
            "balances": [
                {
                    "currency": "SOL",
                    "balance": "125.50000000",
                    "updated_at": "2026-01-06T14:00:00Z"
                },
                {
                    "currency": "ASQ",
                    "balance": "50000.00000000",
                    "updated_at": "2026-01-06T14:00:00Z"
                }
            ],
            "created_at": "2026-01-01T10:00:00Z"
        }
    ]
}
```

---

### 4.2 Get Wallet Platforms

List available wallet platforms.

**Endpoint:** `GET /wallets/platforms`

**Response (200):**

```json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "MetaMask",
            "slug": "metamask",
            "type": "web3",
            "icon": "https://cdn.asetqu.com/icons/metamask.svg",
            "description": "Popular Ethereum wallet"
        },
        {
            "id": 2,
            "name": "Phantom",
            "slug": "phantom",
            "type": "web3",
            "icon": "https://cdn.asetqu.com/icons/phantom.svg",
            "description": "Solana wallet"
        },
        {
            "id": 3,
            "name": "Indodax",
            "slug": "indodax",
            "type": "exchange",
            "icon": "https://cdn.asetqu.com/icons/indodax.svg",
            "description": "Indonesian crypto exchange"
        }
    ]
}
```

---

### 4.3 Add Wallet

Create new wallet connection.

**Endpoint:** `POST /wallets`

**Headers:**

```http
Authorization: Bearer {token}
```

**Request Body:**

```json
{
    "platform_id": 1,
    "wallet_address": "0x1234567890abcdef1234567890abcdef12345678",
    "label": "My Secondary Wallet",
    "is_primary": false
}
```

**Response (201):**

```json
{
    "success": true,
    "message": "Wallet added successfully",
    "data": {
        "id": 2,
        "platform": {
            "id": 1,
            "name": "MetaMask",
            "slug": "metamask"
        },
        "wallet_address": "0x1234...5678",
        "label": "My Secondary Wallet",
        "is_primary": false,
        "is_verified": false,
        "created_at": "2026-01-06T15:00:00Z"
    }
}
```

---

### 4.4 Update Wallet

Update wallet information.

**Endpoint:** `PUT /wallets/{id}`

**Headers:**

```http
Authorization: Bearer {token}
```

**Request Body:**

```json
{
    "label": "Updated Label",
    "is_primary": true
}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Wallet updated successfully",
    "data": {
        "id": 2,
        "label": "Updated Label",
        "is_primary": true
    }
}
```

---

### 4.5 Delete Wallet

Remove wallet from account.

**Endpoint:** `DELETE /wallets/{id}`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (204):**

```
No Content
```

---

### 4.6 Sync Wallet Balance

Manually trigger balance sync.

**Endpoint:** `POST /wallets/{id}/sync`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Balance sync initiated",
    "data": {
        "wallet_id": 1,
        "status": "syncing"
    }
}
```

---

## 5. Game API

### 5.1 List Games

Get available games.

**Endpoint:** `GET /games`

**Response (200):**

```json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "Coin Collector",
            "slug": "coin-collector",
            "description": "Collect as many coins as possible in 60 seconds",
            "thumbnail": "https://cdn.asetqu.com/games/coin-collector.jpg",
            "point_reward": 100,
            "daily_limit": 5,
            "is_active": true,
            "user_stats": {
                "plays_today": 2,
                "remaining_plays": 3,
                "high_score": 850,
                "total_points_earned": 450
            }
        },
        {
            "id": 2,
            "name": "Quiz Challenge",
            "slug": "quiz-challenge",
            "description": "Test your crypto knowledge",
            "thumbnail": "https://cdn.asetqu.com/games/quiz.jpg",
            "point_reward": 150,
            "daily_limit": 3,
            "is_active": true,
            "user_stats": {
                "plays_today": 0,
                "remaining_plays": 3,
                "high_score": 0,
                "total_points_earned": 0
            }
        }
    ]
}
```

---

### 5.2 Get Game Detail

Get specific game information.

**Endpoint:** `GET /games/{slug}`

**Response (200):**

```json
{
    "success": true,
    "data": {
        "id": 1,
        "name": "Coin Collector",
        "slug": "coin-collector",
        "description": "Collect as many coins as possible in 60 seconds",
        "instructions": "Use arrow keys or swipe to move...",
        "thumbnail": "https://cdn.asetqu.com/games/coin-collector.jpg",
        "game_type": "casual",
        "min_score": 0,
        "max_score": 1000,
        "point_reward": 100,
        "daily_limit": 5,
        "cooldown_minutes": 0,
        "is_active": true
    }
}
```

---

### 5.3 Start Game Session

Initialize a new game session.

**Endpoint:** `POST /games/{slug}/start`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (201):**

```json
{
    "success": true,
    "message": "Game session started",
    "data": {
        "session_id": 12345,
        "game_id": 1,
        "started_at": "2026-01-06T15:30:00Z",
        "expires_at": "2026-01-06T15:35:00Z"
    }
}
```

**Error Response (429):**

```json
{
    "success": false,
    "message": "Daily play limit reached",
    "errors": {
        "limit": "You have reached the maximum plays for today (5/5)"
    }
}
```

---

### 5.4 End Game Session

Submit game score and complete session.

**Endpoint:** `POST /games/sessions/{session_id}/end`

**Headers:**

```http
Authorization: Bearer {token}
```

**Request Body:**

```json
{
    "score": 750,
    "metadata": {
        "level_reached": 5,
        "items_collected": 25
    }
}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Game completed!",
    "data": {
        "session_id": 12345,
        "score": 750,
        "points_earned": 75,
        "is_high_score": true,
        "rank": 15,
        "total_coin_balance": 1575,
        "completed_at": "2026-01-06T15:31:30Z"
    }
}
```

---

### 5.5 Get Leaderboard

Get game leaderboard.

**Endpoint:** `GET /games/{slug}/leaderboard`

**Query Parameters:**
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| period | string | weekly | daily, weekly, monthly, all_time |
| limit | integer | 10 | Max 100 |

**Response (200):**

```json
{
    "success": true,
    "data": {
        "period": "weekly",
        "period_start": "2026-01-01",
        "period_end": "2026-01-07",
        "rankings": [
            {
                "rank": 1,
                "user": {
                    "id": 5,
                    "name": "Top Player",
                    "avatar": "https://cdn.asetqu.com/avatars/5.jpg"
                },
                "score": 980,
                "games_played": 15,
                "points_earned": 1200
            },
            {
                "rank": 2,
                "user": {
                    "id": 1,
                    "name": "John Doe",
                    "avatar": null
                },
                "score": 850,
                "games_played": 10,
                "points_earned": 950
            }
        ],
        "current_user_rank": 15
    }
}
```

---

## 6. Points & Coins API

### 6.1 Get Coin Balance

Get user's coin balance and history.

**Endpoint:** `GET /coins`

**Headers:**

```http
Authorization: Bearer {token}
```

**Query Parameters:**
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| page | integer | 1 | Page number |
| per_page | integer | 20 | Items per page (max 50) |
| type | string | all | earned, spent, expired |

**Response (200):**

```json
{
    "success": true,
    "data": {
        "balance": 1500,
        "transactions": {
            "data": [
                {
                    "id": 100,
                    "type": "earned",
                    "amount": 75,
                    "balance_after": 1500,
                    "source": "game_reward",
                    "description": "Coin Collector game reward",
                    "created_at": "2026-01-06T15:31:30Z"
                },
                {
                    "id": 99,
                    "type": "earned",
                    "amount": 50,
                    "balance_after": 1425,
                    "source": "daily_reward",
                    "description": "Daily login reward (Day 5)",
                    "created_at": "2026-01-06T08:00:00Z"
                }
            ],
            "meta": {
                "current_page": 1,
                "last_page": 5,
                "per_page": 20,
                "total": 100
            }
        }
    }
}
```

---

### 6.2 Get Point Balance

Get user's point balance and history.

**Endpoint:** `GET /points`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (200):**

```json
{
    "success": true,
    "data": {
        "balance": 300,
        "transactions": {
            "data": [
                {
                    "id": 50,
                    "amount": 100,
                    "balance_after": 300,
                    "source": "coin_conversion",
                    "description": "Converted 1000 coins to points",
                    "created_at": "2026-01-05T12:00:00Z"
                }
            ],
            "meta": {
                "current_page": 1,
                "last_page": 2,
                "per_page": 20,
                "total": 25
            }
        }
    }
}
```

---

### 6.3 Convert Coins to Points

Convert coins to points.

**Endpoint:** `POST /coins/convert`

**Headers:**

```http
Authorization: Bearer {token}
```

**Request Body:**

```json
{
    "coins": 1000
}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Conversion successful",
    "data": {
        "coins_converted": 1000,
        "points_received": 100,
        "conversion_rate": 0.1,
        "new_coin_balance": 500,
        "new_point_balance": 400
    }
}
```

---

### 6.4 Claim Daily Reward

Claim daily login reward.

**Endpoint:** `POST /rewards/daily`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Daily reward claimed!",
    "data": {
        "points_earned": 50,
        "streak_day": 5,
        "streak_bonus": 10,
        "total_coins": 60,
        "new_balance": 1560,
        "next_claim_at": "2026-01-07T00:00:00Z"
    }
}
```

**Error Response (400):**

```json
{
    "success": false,
    "message": "Daily reward already claimed",
    "data": {
        "next_claim_at": "2026-01-07T00:00:00Z"
    }
}
```

---

## 7. Events API

> **Note:** Events are created by Admin only through CMS.
> Only 1 event per date is allowed.
> System sends email reminders to registered users (before event and on event day).

### 7.1 List Events

Get upcoming events.

**Endpoint:** `GET /events`

**Query Parameters:**
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| page | integer | 1 | Page number |
| month | string | current | YYYY-MM format |
| status | string | published | published, upcoming |

**Response (200):**

```json
{
    "success": true,
    "data": {
        "data": [
            {
                "id": 1,
                "title": "ASQ Product Launch",
                "slug": "asq-product-launch",
                "description": "Peluncuran produk ASQ terbaru",
                "featured_image": "https://cdn.asetqu.com/events/launch.jpg",
                "event_type": "online",
                "platform": "Discord",
                "platform_link": "https://discord.gg/asetqu",
                "event_date": "2026-01-19",
                "start_time": "10:00:00",
                "end_time": "12:00:00",
                "registration_deadline": "2026-01-18T23:59:59Z",
                "max_participants": 500,
                "registered_count": 250,
                "is_registered": false,
                "status": "published"
            }
        ],
        "meta": {
            "current_page": 1,
            "last_page": 2,
            "total": 15
        }
    }
}
```

---

### 7.2 Get Event Detail

Get specific event information.

**Endpoint:** `GET /events/{slug}`

**Response (200):**

```json
{
    "success": true,
    "data": {
        "id": 1,
        "title": "ASQ Product Launch",
        "slug": "asq-product-launch",
        "description": "Peluncuran produk ASQ terbaru",
        "content": "Full HTML content...",
        "featured_image": "https://cdn.asetqu.com/events/launch.jpg",
        "event_type": "online",
        "platform": "Discord",
        "platform_link": "https://discord.gg/asetqu",
        "event_date": "2026-01-19",
        "start_time": "10:00:00",
        "end_time": "12:00:00",
        "registration_deadline": "2026-01-18T23:59:59Z",
        "max_participants": 500,
        "registered_count": 250,
        "spots_remaining": 250,
        "is_registered": false,
        "registration_status": "open",
        "reminder_info": {
            "days_before": 1,
            "reminder_enabled": true
        },
        "status": "published"
    }
}
```

---

### 7.3 Register for Event

Register user for event.

**Endpoint:** `POST /events/{slug}/register`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (201):**

```json
{
    "success": true,
    "message": "Successfully registered for event",
    "data": {
        "registration_id": 123,
        "event_id": 1,
        "event_title": "ASQ Product Launch",
        "event_date": "2026-01-19",
        "status": "registered",
        "registered_at": "2026-01-06T16:00:00Z",
        "reminder_info": {
            "pre_event_reminder": "You will receive a reminder 1 day before the event",
            "day_of_reminder": "You will receive a reminder on the event day"
        }
    }
}
```

---

### 7.4 Cancel Registration

Cancel event registration.

**Endpoint:** `DELETE /events/{slug}/register`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Registration cancelled successfully"
}
```

---

## 8. Newsletter API

### 8.1 Subscribe

Subscribe to newsletter.

**Endpoint:** `POST /newsletter/subscribe`

**Request Body:**

```json
{
    "email": "subscriber@example.com",
    "name": "John Doe"
}
```

**Response (201):**

```json
{
    "success": true,
    "message": "Successfully subscribed to newsletter"
}
```

---

### 8.2 Unsubscribe

Unsubscribe from newsletter.

**Endpoint:** `POST /newsletter/unsubscribe`

**Request Body:**

```json
{
    "email": "subscriber@example.com",
    "token": "unsubscribe_token"
}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Successfully unsubscribed"
}
```

---

## 9. Academy API

> **Note:** Academy provides educational video content via YouTube links only.
> There is NO enrollment system - users browse videos and click to watch on YouTube.
> System tracks view history for logged-in users.

### 9.1 List Videos

Get available educational videos.

**Endpoint:** `GET /academy/videos`

**Query Parameters:**
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| page | integer | 1 | Page number |
| level | string | all | beginner, intermediate, advanced |
| category | string | all | Video category |
| status | string | published | Video status |

**Response (200):**

```json
{
    "success": true,
    "data": {
        "data": [
            {
                "id": 1,
                "title": "Introduction to Blockchain",
                "slug": "intro-blockchain",
                "description": "Learn blockchain fundamentals",
                "thumbnail": "https://cdn.asetqu.com/academy/blockchain.jpg",
                "youtube_url": "https://www.youtube.com/watch?v=SSo_EIwHSd4",
                "youtube_video_id": "SSo_EIwHSd4",
                "duration_minutes": 15,
                "category": "blockchain",
                "level": "beginner",
                "view_count": 1250,
                "has_watched": false
            },
            {
                "id": 2,
                "title": "Understanding Crypto Trading",
                "slug": "crypto-trading-basics",
                "description": "Basic crypto trading concepts",
                "thumbnail": "https://cdn.asetqu.com/academy/trading.jpg",
                "youtube_url": "https://www.youtube.com/watch?v=abc123xyz",
                "youtube_video_id": "abc123xyz",
                "duration_minutes": 20,
                "category": "trading",
                "level": "intermediate",
                "view_count": 890,
                "has_watched": true
            }
        ],
        "meta": {
            "current_page": 1,
            "total": 50
        }
    }
}
```

---

### 9.2 Get Video Detail

Get specific video information.

**Endpoint:** `GET /academy/videos/{slug}`

**Response (200):**

```json
{
    "success": true,
    "data": {
        "id": 1,
        "title": "Introduction to Blockchain",
        "slug": "intro-blockchain",
        "description": "Learn blockchain fundamentals in this comprehensive video",
        "thumbnail": "https://cdn.asetqu.com/academy/blockchain.jpg",
        "youtube_url": "https://www.youtube.com/watch?v=SSo_EIwHSd4",
        "youtube_video_id": "SSo_EIwHSd4",
        "duration_minutes": 15,
        "category": "blockchain",
        "level": "beginner",
        "view_count": 1250,
        "has_watched": false,
        "related_videos": [
            {
                "id": 3,
                "title": "How Blockchain Works",
                "slug": "how-blockchain-works",
                "thumbnail": "https://cdn.asetqu.com/academy/blockchain2.jpg",
                "duration_minutes": 12,
                "level": "beginner"
            }
        ]
    }
}
```

---

### 9.3 Track Video Watch

Record that user watched a video (called when user clicks "Watch on YouTube").

**Endpoint:** `POST /academy/videos/{slug}/watch`

**Headers:**

```http
Authorization: Bearer {token}
```

**Response (200):**

```json
{
    "success": true,
    "message": "Watch recorded",
    "data": {
        "video_id": 1,
        "watch_count": 2,
        "last_watched_at": "2026-01-06T17:00:00Z",
        "youtube_url": "https://www.youtube.com/watch?v=SSo_EIwHSd4"
    }
}
```

---

### 9.4 Get Watch History

Get user's video watch history.

**Endpoint:** `GET /academy/history`

**Headers:**

```http
Authorization: Bearer {token}
```

**Query Parameters:**
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| page | integer | 1 | Page number |
| per_page | integer | 20 | Items per page |

**Response (200):**

```json
{
    "success": true,
    "data": {
        "data": [
            {
                "id": 1,
                "video": {
                    "id": 1,
                    "title": "Introduction to Blockchain",
                    "slug": "intro-blockchain",
                    "thumbnail": "https://cdn.asetqu.com/academy/blockchain.jpg",
                    "youtube_url": "https://www.youtube.com/watch?v=SSo_EIwHSd4",
                    "duration_minutes": 15,
                    "level": "beginner"
                },
                "watch_count": 3,
                "first_watched_at": "2026-01-01T10:00:00Z",
                "last_watched_at": "2026-01-06T17:00:00Z"
            }
        ],
        "meta": {
            "current_page": 1,
            "total": 15
        }
    }
}
```

---

## 10. Public Content API

### 10.1 Get Pages

Get CMS pages.

**Endpoint:** `GET /pages/{slug}`

**Response (200):**

```json
{
    "success": true,
    "data": {
        "id": 1,
        "title": "Tokenomics",
        "slug": "tokenomics",
        "content": "HTML content...",
        "meta_title": "AsetQu V.2 Tokenomics",
        "meta_description": "Learn about AsetQu V.2 tokenomics",
        "sections": [
            {
                "id": 1,
                "title": "Token Distribution",
                "content": "...",
                "type": "content"
            }
        ]
    }
}
```

---

### 10.2 Get Roadmap

Get roadmap phases and items.

**Endpoint:** `GET /roadmap`

**Response (200):**

```json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "title": "Phase 1: Peluncuran AsetQu V.2",
            "description": "Initial launch phase",
            "phase_number": 1,
            "status": "completed",
            "items": [
                {
                    "id": 1,
                    "title": "Migrasi token 1:1 dari versi sebelumnya",
                    "is_completed": true
                },
                {
                    "id": 2,
                    "title": "Pembaruan branding & identitas ekosistem",
                    "is_completed": true
                }
            ]
        },
        {
            "id": 2,
            "title": "Phase 2: AsetBid On-Chain Auction",
            "description": "Auction platform development",
            "phase_number": 2,
            "status": "in_progress",
            "items": [
                {
                    "id": 6,
                    "title": "Implementasi sistem anti-manipulasi bidding",
                    "is_completed": true
                }
            ]
        }
    ]
}
```

---

### 10.3 Get FAQs

Get FAQ list.

**Endpoint:** `GET /faqs`

**Query Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| category | string | Filter by category |

**Response (200):**

```json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "question": "Apa itu AsetQu V2?",
            "answer": "AsetQu V.2 adalah versi terbaru...",
            "category": "general"
        },
        {
            "id": 2,
            "question": "Apa fungsi token AsetQu V.2?",
            "answer": "Token AsetQu V.2 berfungsi sebagai...",
            "category": "token"
        }
    ]
}
```

---

### 10.4 Get Testimonials (Community Feed)

Get community testimonials for homepage display.

> **Note:** Testimonials/Community Feed content is managed by Admin only.
> Users cannot submit testimonials - all content is curated by Admin through CMS.

**Endpoint:** `GET /testimonials`

**Response (200):**

```json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "Michel Alexander",
            "role": "Investor",
            "avatar": "https://cdn.asetqu.com/testimonials/1.jpg",
            "content": "Saya menyimpan sebagian koin kripto...",
            "rating": 5
        }
    ]
}
```

---

## 11. Rate Limiting

### 11.1 Rate Limits

| Endpoint Type                   | Limit        | Window   |
| ------------------------------- | ------------ | -------- |
| Public endpoints                | 60 requests  | 1 minute |
| Authenticated endpoints         | 120 requests | 1 minute |
| Auth endpoints (login/register) | 10 requests  | 1 minute |
| Game endpoints                  | 30 requests  | 1 minute |

### 11.2 Rate Limit Headers

```http
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 115
X-RateLimit-Reset: 1704556800
```

### 11.3 Rate Limit Exceeded Response (429)

```json
{
    "success": false,
    "message": "Too Many Requests",
    "errors": {
        "rate_limit": "Rate limit exceeded. Please try again in 45 seconds."
    },
    "retry_after": 45
}
```

---

## 12. Webhooks (Future)

### 12.1 Webhook Events

| Event                   | Description                      |
| ----------------------- | -------------------------------- |
| `user.registered`       | New user registration            |
| `wallet.synced`         | Wallet balance updated           |
| `game.completed`        | Game session completed           |
| `event.registered`      | User registered for event        |
| `event.reminder.sent`   | Pre-event reminder email sent    |
| `event.day_reminder`    | Day-of event reminder email sent |
| `academy.video.watched` | User watched academy video       |

---

_Document Version: 1.0.0 | Last Updated: January 2026_
