# Accounts API

Hosting hesaplarını programatik olarak yönetmek için Accounts API'sini kullanın.

## Endpoint'ler

<ApiEndpointCard method="GET" path="/api/v1/accounts" description="Tüm hesapları listele (sayfalanmış)" />

<ApiEndpointCard method="POST" path="/api/v1/accounts" description="Yeni hosting hesabı oluştur" />

<ApiEndpointCard method="GET" path="/api/v1/accounts/{username}" description="Hesap detayı" />

<ApiEndpointCard method="PUT" path="/api/v1/accounts/{username}" description="Hesap bilgilerini güncelle" />

<ApiEndpointCard method="DELETE" path="/api/v1/accounts/{username}" description="Hesabı kalıcı olarak sil" />

<ApiEndpointCard method="POST" path="/api/v1/accounts/{username}/suspend" description="Hesabı askıya al" />

<ApiEndpointCard method="POST" path="/api/v1/accounts/{username}/unsuspend" description="Askıyı kaldır" />

<ApiEndpointCard method="POST" path="/api/v1/accounts/{username}/change-password" description="Panel şifresini değiştir" />

<ApiEndpointCard method="GET" path="/api/v1/accounts/{username}/usage" description="Kaynak kullanım istatistikleri" />

## Hesap Listesi

```bash
GET /api/v1/accounts?page=1&per_page=25&status=active
```

Yanıt:

```json
{
    "success": true,
    "data": [
        {
            "username": "ahmet",
            "email": "ahmet@example.com",
            "domain": "ahmet.com",
            "status": "active",
            "package": { "id": 2, "name": "Silver" },
            "php_version": "8.3",
            "disk_used_mb": 1024,
            "disk_limit_mb": 10240,
            "created_at": "2026-03-01T10:00:00Z"
        }
    ],
    "meta": {
        "current_page": 1,
        "per_page": 25,
        "total": 87
    }
}
```

## Hesap Oluşturma

```bash
POST /api/v1/accounts
Content-Type: application/json

{
    "username": "yeni_musteri",
    "email": "musteri@example.com",
    "password": "güçlü_şifre_123!",
    "domain": "musteri.com",
    "package_id": 2,
    "php_version": "8.3",
    "ip": "shared",
    "notify_welcome": true
}
```

Başarılı yanıt (`201 Created`):

```json
{
    "success": true,
    "data": {
        "username": "yeni_musteri",
        "email": "musteri@example.com",
        "domain": "musteri.com",
        "status": "active",
        "homedir": "/home/yeni_musteri",
        "nameservers": ["ns1.panel.com", "ns2.panel.com"],
        "server_ip": "5.9.100.1"
    }
}
```

## Hesap Askıya Alma

```bash
POST /api/v1/accounts/yeni_musteri/suspend
Content-Type: application/json

{
    "reason": "Ödeme gecikimi"
}
```

## Kaynak Kullanımı

```bash
GET /api/v1/accounts/yeni_musteri/usage
```

```json
{
    "success": true,
    "data": {
        "disk": { "used_mb": 1024, "limit_mb": 10240, "percent": 10 },
        "bandwidth": { "used_gb": 5.2, "limit_gb": 100, "month": "2026-05" },
        "email_accounts": { "count": 3, "limit": 25 },
        "databases": { "count": 2, "limit": 10 },
        "domains": { "count": 2, "limit": 5 }
    }
}
```
