API
https://api.llamalink.net

תיעוד API

כל הבקשות דורשות מפתח API (llk_…).

בסיס: https://api.llamalink.net
בכל בקשה מוגנת: Authorization: Bearer <your_api_key>
בקשות POST עם JSON: Content-Type: application/json

אימות

HEADER Authorization

נשלח בכל בקשה מוגנת (ראו דוגמת בקשה).

בקשה
{
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY",
    "Content-Type": "application/json"
  }
}

שרתים וירטואליים

הקמה: חבילות ← כרטיס תשלום ← מערכת הפעלה ← POST /user/subscribe-vps (חבילה) או POST /user/custom-packages (מותאם) ← מעקב התקדמות

GET /user/payment

כרטיסי אשראי שמורים — בדיקה לפני הקמת שרת. דורש מפתח.

בקשה
{
  "method": "GET",
  "path": "/user/payment",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY"
  }
}
200 תגובה מוצלחת
[
  {
    "id": 3,
    "last4dig": "4242",
    "exp_month": 12,
    "exp_year": 2027,
    "brand": "visa"
  }
]
GET /platform/vps-plans

חבילות שרת זמינות לרכישה (מזהה id לשימוש ב-planId). כולל מחירון לשרת מותאם ב-custom. ללא מפתח API.

בקשה
{
  "method": "GET",
  "path": "/platform/vps-plans"
}
200 תגובה מוצלחת
{
  "shopPurchasesEnabled": true,
  "items": [
    {
      "id": "spark",
      "name": "Llama Spark",
      "price": 54,
      "currency": "ILS",
      "cpuCores": 2,
      "ramGB": 2,
      "storageGB": 50
    }
  ],
  "custom": {
    "available": true,
    "endpoint": "/user/custom-packages",
    "pricing": {
      "currency": "ILS",
      "ramPerGB": 7,
      "cpuPerCore": { "xeonE5": 15.6, "xeonGold": 17 }
    }
  }
}
GET /platform/os-templates

מערכות הפעלה לבחירה בהקמה. ללא מפתח API.

בקשה
{
  "method": "GET",
  "path": "/platform/os-templates"
}
200 תגובה מוצלחת
{
  "items": [
    { "id": "ubuntu-22", "label": "Ubuntu 22.04", "enabled": true },
    { "id": "windows-2022", "label": "Windows Server 2022", "enabled": true }
  ]
}
POST /user/subscribe-vps

הקמת שרת מחבילת חנות (חיוב בכרטיס שמור בחשבון). קודם GET /platform/vps-plans — השתמשו ב-id כ-planId.

בקשה
{
  "method": "POST",
  "path": "/user/subscribe-vps",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY",
    "Content-Type": "application/json",
    "x-provision-op-id": "my-unique-op-001"
  },
  "body": {
    "planId": "spark",
    "os": "ubuntu-22"
  }
}
201 תגובה מוצלחת
{
  "subscribed": true,
  "vpsId": 42,
  "message": "השרת הוקם בהצלחה."
}
POST /user/custom-packages

הקמת שרת עם מפרט חומרה מותאם (כמו «בנו שרת» בחנות). חיוב בכרטיס שמור בחשבון. השדה estimatedPrice חייב להתאים לחישוב השרת (סטייה מקסימלית 0.02 ₪). מחיר חודשי (ILS): (מעבד לליבה × ליבות) + (7 × RAM GB) + (אחסון ל-GB × GB) + (4 × IPv4) — מעבד: xeonE5 = 15.6, xeonGold = 17.0 לליבה; אחסון: SSD 1.5, HDD 1.2 ל-GB. Windows: מינימום 32GB דיסק.

בקשה
{
  "method": "POST",
  "path": "/user/custom-packages",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY",
    "Content-Type": "application/json",
    "x-provision-op-id": "my-unique-op-002"
  },
  "body": {
    "name": "my-api-vps",
    "cpuType": "xeonE5",
    "cpuCores": 4,
    "ram": 8,
    "storageType": "ssd",
    "storageGB": 160,
    "ipv4": 1,
    "estimatedPrice": 362.4,
    "os": "ubuntu-22"
  }
}
201 תגובה מוצלחת
{
  "subscribed": true,
  "vpsId": 43,
  "message": "השרת הוקם בהצלחה."
}
GET /user/vps/provision-progress/:opId

מעקב התקדמות אחרי הקמה.

בקשה
{
  "method": "GET",
  "path": "/user/vps/provision-progress/my-unique-op-001",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY"
  }
}
200 תגובה מוצלחת
{
  "status": "success",
  "percent": 100,
  "vpsId": 42,
  "message": "completed"
}
GET /user/vps

כל השרתים בחשבון.

בקשה
{
  "method": "GET",
  "path": "/user/vps",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY"
  }
}
200 תגובה מוצלחת
[
  {
    "id": 42,
    "name": "production-web",
    "status": "running",
    "paymentStatus": "active",
    "disk": 40.5,
    "cpu_used": 12,
    "cpus_avail": 4,
    "memory": { "used": 1.2, "max": 4, "usage_percent": 30 },
    "uptime": 86400,
    "ip_addresses": ["203.0.113.50"]
  }
]
GET /user/vps/:id

פרטי שרת בודד.

בקשה
{
  "method": "GET",
  "path": "/user/vps/42",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY"
  }
}
200 תגובה מוצלחת
{
  "id": 42,
  "name": "production-web",
  "status": "running",
  "ip_addresses": ["203.0.113.50"],
  "memory": { "used": 1.2, "max": 4, "usage_percent": 30 },
  "cpu_used": 12,
  "uptime": 86400
}
GET /user/vps/start|stop|restart/:id

נתיבים: /user/vps/start/:id · stop · restart

בקשה
{
  "method": "GET",
  "path": "/user/vps/restart/42",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY"
  }
}
200 תגובה מוצלחת
{
  "message": "פעולה נשלחה לשרת",
  "status": "running"
}
GET /user/vps/:id/metrics-history

היסטוריית CPU / זיכרון.

בקשה
{
  "method": "GET",
  "path": "/user/vps/42/metrics-history",
  "query": {
    "metric": "cpu",
    "range": "day"
  },
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY"
  }
}
200 תגובה מוצלחת
{
  "range": "day",
  "points": [
    { "time": 1716508800, "value": 24.5 },
    { "time": 1716512400, "value": 31.2 }
  ]
}

אתרים

GET /user/websites

רשימת אתרי האירוח.

בקשה
{
  "method": "GET",
  "path": "/user/websites",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY"
  }
}
200 תגובה מוצלחת
[
  {
    "id": "8f2a1c00-1111-2222-3333-444455556666",
    "domain": "example.co.il",
    "status": "active",
    "plan": "business",
    "diskUsedMb": 1200,
    "diskLimitMb": 10240
  }
]
GET /user/websites/info/:id

פרטי אתר בודד.

בקשה
{
  "method": "GET",
  "path": "/user/websites/info/8f2a1c00-1111-2222-3333-444455556666",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY"
  }
}
200 תגובה מוצלחת
{
  "id": "8f2a1c00-1111-2222-3333-444455556666",
  "domain": "example.co.il",
  "status": "active",
  "phpVersion": "8.2",
  "ssl": true,
  "nameservers": ["ns1.llamalink.net", "ns2.llamalink.net"]
}
POST /user/websites/new

יצירת אתר (דורש תוכנית אתרים פעילה בחשבון).

בקשה
{
  "method": "POST",
  "path": "/user/websites/new",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY",
    "Content-Type": "application/json"
  },
  "body": {
    "domain": "mysite.co.il",
    "planId": "business",
    "phpVersion": "8.2"
  }
}
201 תגובה מוצלחת
{
  "id": "9a3b2c10-aaaa-bbbb-cccc-dddddddddddd",
  "domain": "mysite.co.il",
  "status": "provisioning",
  "message": "האתר בתהליך הקמה"
}

חשבון וחיוב

GET /user/profile

פרטי חשבון (קריאה בלבד).

בקשה
{
  "method": "GET",
  "path": "/user/profile",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY"
  }
}
200 תגובה מוצלחת
{
  "id": 7,
  "username": "client1",
  "email": "user@example.com",
  "realname": "ישראל ישראלי",
  "phone": "0501234567",
  "userpfp": "avatar-7.png",
  "role": "user"
}
GET /user/subscriptions

מנויים פעילים וממתינים.

בקשה
{
  "method": "GET",
  "path": "/user/subscriptions",
  "headers": {
    "Authorization": "Bearer llk_YOUR_KEY"
  }
}
200 תגובה מוצלחת
[
  {
    "id": 101,
    "type": "vps",
    "name": "VPS Business",
    "status": "active",
    "renewalDate": "2026-06-01",
    "priceMonthly": 89
  }
]

קודי תשובה

קודמשמעות
200הצלחה
201נוצר בהצלחה
401חסרה כותרת Authorization
402אין כרטיס תשלום תקף / החיוב נכשל
403מפתח לא תקף / פג תוקף
404לא נמצא
429יותר מדי בקשות
500שגיאת שרת