NetlenAPI Dokümanı

Başlangıç

Netlen API v2

Sunucular'ınızı, Sanal Veri Merkezi'nizi, Alan Adları'nızı, Web Hosting'lerinizi, destek taleplerinizi ve hesabınızı RESTful API ile yönetin.

Introduction

Netlen API v2, sunucu, VDC (sanal veri merkezi), domain, web hosting, destek ve hesap kaynaklarınızı programatik olarak yönetmenizi sağlar. RESTful, JSON tabanlı ve İngilizce-only bir arayüzdür.

Base URL
https://api.netlen.com.tr/v2
Kimlik doğrulama
Authorization: Bearer <api_key>
İçerik tipi
application/json
Zaman damgaları
RFC 3339 UTC (2026-07-13T14:40:12Z)
Para formatı
Money objesi: {amount:"12.50", currency:"USD"} (decimal string, USD).
Alan casing
Bütün JSON alanları snake_case.
GET/servers · List servers
curl -s "https://api.netlen.com.tr/v2/servers" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": [
    { "id": "NET10231", "name": "web01", "status": "active", "power_state": null,
      "specs": { "cpu_cores": 6, "ram_mb": 16384, "storage_gb": 120 },
      "plan": { "id": 6, "name": "VPS-6" },
      "billing": { "amount": "39.00", "currency": "USD", "cycle": "monthly", "next_billing_at": "2026-08-13T00:00:00Z", "deletable": true } }
  ],
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3",
            "pagination": { "page": 1, "per_page": 25, "total": 3, "total_pages": 1 } }
}
Yeni · MCPSunucularınızı yapay zeka ile yönetin — Claude, ChatGPT, Gemini ve diğer AI istemcilerini panele bağlayın.Keşfet

Başlangıç

Authentication

Her istek Authorization: Bearer <api_key> header'ı ile gönderilmelidir. API anahtarları panelden oluşturulur, IP allowlist zorunludur. ?api_key= query fallback'i v2'de kaldırıldı.

Yaygın auth hataları
401AUTH_REQUIREDToken gönderilmedi.
401AUTH_INVALIDToken geçersiz veya iptal edilmiş.
403AUTH_IP_NOT_ALLOWEDÇağıran IP anahtarın allowlist'inde değil.
403ACCOUNT_INACTIVEHesap askıda/kapalı.
403AUTH_SCOPE_INSUFFICIENTToken bu işlem için gerekli scope'a sahip değil.
Request header
curl -s "https://api.netlen.com.tr/v2/servers" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
API anahtarınızı panelden API Keys sayfasından oluşturabilirsiniz. IP allowlist zorunludur.

Başlangıç

Response envelope

Her başarılı yanıt data + meta, her hata error objesi ile döner. Üst seviye success flag'i v2'de yoktur — HTTP status kodu tek başına başarı sinyalidir.

Success (object)
{
  "data": { "...": "..." },
  "meta": { "request_id": "req_9f2c1a", "version": "2.0.3" }
}
Success (list)
{
  "data": [ { "...": "..." } ],
  "meta": {
    "request_id": "req_9f2c1a",
    "version": "2.0.3",
    "pagination": { "page": 1, "per_page": 25, "total": 1650, "total_pages": 66 }
  }
}
Error
{
  "error": {
    "code": "LOCATION_INVALID",
    "message": "The selected location is not available for this account.",
    "errors": [
      { "field": "location_id", "code": "INVALID", "message": "Location 999 does not exist." }
    ],
    "request_id": "req_9f2c1a",
    "doc_url": "https://api.netlen.com.tr/v2/docs/errors#LOCATION_INVALID"
  }
}

Başlangıç

Pagination

Liste endpoint'leri sayfa-tabanlı pagination kullanır. page ve per_page query parametreleri (per_page max 100). Response meta.pagination içinde {page, per_page, total, total_pages} döner.

bash
GET /servers?page=1&per_page=25

Başlangıç

Idempotency

Ücretlendirme yapan POST istekleri (server create, domain register, web-hosting order) Idempotency-Key: <uuid4> header'ı desteklemelidir. Aynı anahtar + aynı body → orijinal response tekrar döner (çift ödeme yok). Farklı body → 409 IDEMPOTENCY_KEY_CONFLICT.

bash
Idempotency-Key: 6f1c2b90-8f7a-4e51-9c3f-1a2b3c4d5e6f

Başlangıç

Async operations

Uzun süren işlemler (create, migrate, resize, reinstall, snapshot) 202 status ile birlikte bir operation objesi döner. GET /operations/{id} ile poll edip status'unu (queued/running/completed/failed) izleyebilirsiniz.

json
{
  "data": {
    "operation": {
      "id": "op_9f2c...",
      "type": "server.migrate",
      "status": "running",
      "resource": { "type": "server", "id": "NET10231" },
      "progress_pct": 63,
      "detail": "78/120 GB",
      "created_at": "2026-07-13T14:40:12Z",
      "updated_at": "2026-07-13T14:41:00Z"
    }
  },
  "meta": { "request_id": "req_9f2c1a", "version": "2.0.3" }
}

Başlangıç

Rate limiting

Her response üç RateLimit-* header'ı taşır. Limit aşıldığında 429 RATE_LIMITED döner ve Retry-After header'ında beklenecek saniye yer alır.

bash
RateLimit-Limit: 600
RateLimit-Remaining: 597
RateLimit-Reset: 42
Retry-After: 42      (yalnızca 429 yanıtında)

Başlangıç

Sandbox mode

Test API anahtarları (is_test) sandbox'a yönlendirilir. Bütün kontrat çalışır ama gerçek etki yoktur: bakiye çekilmez, provider'a çağrı gitmez, kayıt oluşmaz. Sandbox yanıtları meta.sandbox: true işaretini taşır. Validation çalışmaya devam eder (422 üretilebilir).

Başlangıç

Error catalog

Tüm hata yanıtları aynı zarfı taşır (error.code stabil ve makine-okunur; message İngilizce). Client'lar code üzerinde branch etmelidir.

400REQUEST_MALFORMEDRequest body is not valid JSON.
405METHOD_NOT_ALLOWEDThis method is not allowed on this endpoint.
404ENDPOINT_NOT_FOUNDThe requested endpoint does not exist.
415UNSUPPORTED_MEDIA_TYPEContent-Type must be application/json.
401AUTH_REQUIREDAuthentication is required. Provide an "Authorization: Bearer <token>" header.
401AUTH_INVALIDThe API token is invalid or has been revoked.
403AUTH_IP_NOT_ALLOWEDThis IP address is not allowed for this API token.
403ACCOUNT_INACTIVEThis account is not active.
403AUTH_SCOPE_INSUFFICIENTThe API token does not have the required scope for this operation.
404RESOURCE_NOT_FOUNDThe requested resource was not found.
409STATE_CONFLICTThe resource is not in a state that allows this operation.
409IDEMPOTENCY_KEY_CONFLICTThis idempotency key was already used with a different request.
422VALIDATION_FAILEDOne or more request parameters are invalid.
422INSUFFICIENT_BALANCEAccount balance is insufficient for this operation.
422QUOTA_EXCEEDEDA resource quota or limit for this account has been exceeded.
429RATE_LIMITEDToo many requests. Please retry after the period in the Retry-After header.
422LOCATION_INVALIDThe selected location is not available for this account.
422OS_VERSION_INVALIDThe selected operating system version is invalid.
422INVALID_PASSWORDPassword must be at least 8 characters and include an uppercase letter, a lowercase letter, a digit and a symbol.
409HOSTNAME_IN_USEAn active server with this hostname already exists. Choose a different hostname.
422PLAN_NOT_FOUNDThe selected plan does not exist.
422CAPACITY_UNAVAILABLEThere is no capacity available to satisfy this request.
422NODE_INCOMPATIBLE_LIVE_MIGRATELive migration is not possible between these CPU vendors. Use a cold migration instead.
422SOURCE_NOT_FOUNDThe source snapshot or backup was not found.
501NOT_IMPLEMENTEDThis endpoint is not implemented yet.
500INTERNAL_ERRORAn unexpected error occurred. Contact support with the request_id.
502UPSTREAM_ERRORAn upstream provider failed to process the request.
503SERVICE_UNAVAILABLEThe service is temporarily unavailable. Please retry shortly.

Entegrasyon

Modüller

WHMCS ve WiseCP için hazır entegrasyon modüllerimizi indirin; sunucu, hosting ve domain siparişlerini kendi panelinizden otomatik provizyon edip yönetin.

WHMCS

Güncel sürüm

WHMCS için hazır provizyon modülü — sunucu, hosting ve domain siparişlerini otomatik açın, yönetin ve faturalayın.

WHMCS Modülünü İndir

WiseCP

Güncel sürüm

WiseCP için hazır entegrasyon modülü — ürünlerinizi kendi WiseCP panelinizden otomatik satışa açın ve yönetin.

WiseCP Modülünü İndir

Kurulum adımları modül paketindeki README dosyasında yer alır. API anahtarınızı müşteri panelinizden oluşturabilirsiniz.

17 endpoint

Servers

Fiziksel & sanal sunucularınızı yönetin. Listeleme, oluşturma (3 mod: package / custom / snapshot'tan), güncelleme, silme, power actions (start/stop/reboot/reset_password/reinstall/resize/clone) ve alt kaynaklar: snapshots, backups, firewall, IP'ler + rDNS, metrics/traffic, operations. Sunucular aylık ya da yıllık (billing_cycle) faturalanır.

The server object

idstringStabil public id (NET10231).
namestringHostname.
statusenumactive · suspended · pending · cancelled
power_stateenum | nullrunning · stopped · starting · stopping · provisioning · migrating · error · unknown. Liste yanıtlarında null.
osstring | nullOS slug (yalnızca detay endpoint'inde).
specsobjectcpu_cores, ram_mb, storage_gb.
networkobjectipv4, ipv6, extra_ips.
planobject | null{id, name}
billingobject{amount, currency, cycle, next_billing_at, deletable}. cycle: monthly · yearly; yıllıkta amount yıllık tutardır. deletable: false (yıllık sunucu) → DELETE 409 STATE_CONFLICT döner.
created_atstring | nullRFC3339 UTC.
example.json
{
  "id": "NET10231",
  "name": "web01",
  "status": "active",
  "power_state": "running",
  "os": "ubuntu-24.04",
  "location_id": 3,
  "specs": { "cpu_cores": 6, "ram_mb": 16384, "storage_gb": 120 },
  "network": {
    "ipv4": { "address": "77.92.151.40", "gateway": "77.92.151.1", "netmask": "255.255.255.0", "subnet": "77.92.151.0/24" },
    "ipv6": { "address": "2a01:f900:10::40", "gateway": null, "subnet": "2a01:f900:10::/48" },
    "extra_ips": [ { "address": "77.92.151.41", "version": 4 } ]
  },
  "plan": { "id": 6, "name": "VPS-6" },
  "billing": { "amount": "39.00", "currency": "USD", "cycle": "monthly", "next_billing_at": "2026-08-13T00:00:00Z", "deletable": true },
  "created_at": "2026-07-13T14:40:12Z"
}

List servers

GET/servers#

Hesaba ait sunucuları döner (silinmişler hariç). Liste yanıtında power_state ve os performans için null; canlı değerler için detay endpoint'ini çağırın.

Query parameters
pageintoptionaldefault: 1

Sayfa numarası.

per_pageintoptionaldefault: 25

Sayfa başına öğe (max 100).

statusenumoptional

active · suspended · pending · cancelled

Yaygın hatalar
AUTH_REQUIREDAUTH_INVALIDRATE_LIMITED
curl -s "https://api.netlen.com.tr/v2/servers" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": [
    { "id": "NET10231", "name": "web01", "status": "active", "power_state": null,
      "specs": { "cpu_cores": 6, "ram_mb": 16384, "storage_gb": 120 },
      "plan": { "id": 6, "name": "VPS-6" },
      "billing": { "amount": "39.00", "currency": "USD", "cycle": "monthly", "next_billing_at": "2026-08-13T00:00:00Z", "deletable": true } }
  ],
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3",
            "pagination": { "page": 1, "per_page": 25, "total": 3, "total_pages": 1 } }
}

Get server

GET/servers/{id}#

Bir sunucunun tam detayını döner. power_state, os ve specs provider'dan canlı olarak alınır (best-effort).

Path parameters
idstringrequired

Sunucu id (NET10231).

Yaygın hatalar
AUTH_REQUIREDRESOURCE_NOT_FOUNDRATE_LIMITED
curl -s "https://api.netlen.com.tr/v2/servers/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": { /* the server object */ },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Create server

POST/servers Billable Idempotency-Key#

Yeni bir sunucu oluşturur ve hesap bakiyesinden ücret keser. Üç mod: package (plan_id verin), custom (cpu_cores+ram_mb+storage_gb), from source (source: {snapshot_id | backup_id}). Package ve custom modda billing_cycle: "yearly" ile sunucu bir yıl peşin ücretlenir.

Notlar

Yıllık sunucular (billing.cycle = "yearly"): bir yıl peşin ücretlenir, billing.amount yıllık tutardır. Paket fiyatı GET /plans → yearly_price, özel sunucu fiyatı POST /plans/custom/quote ile öğrenilir. Yıllık sunucu API ile silinemez (billing.deletable = false, DELETE → 409 STATE_CONFLICT); iptal için panelden iptal talebi açılır. upgrade ve resize yıllık fiyat farkını yılın kalan oranıyla tahsil eder, küçültme yapılamaz. Ek IP ve snapshot/yedek koruması da yıllık olur ve sunucuyla aynı gün biter; o an yalnız yılın kalan kısmı alınır (charged).

Body parameters
namestringrequired

Hostname.

location_idintrequired

Konum id (NetlenVM'e route olmalı).

plan_idintoptional

server_packages.id (package mode).

cpu_coresintoptional

vCPU (custom mode).

ram_mbintoptional

RAM MB (custom mode).

storage_gbintoptional

Disk GB (custom mode).

os_version_idintrequired

OS versiyon id (package/custom modda zorunlu).

passwordstringrequired

≥8 karakter, büyük+küçük+rakam+sembol.

sourceobjectoptional

{snapshot_id} veya {backup_id} — from-source mode.

ipv4_countintoptionaldefault: 1

Ek IPv4 adet.

ipv6_countintoptionaldefault: 1

Ek IPv6 adet.

traffic_gbintoptional

Aylık trafik GB (custom mode, opsiyonel; yalnız tam TB ücretlenir).

billing_cycleenumoptionaldefault: monthly

monthly · yearly. Yıllık, planın yearly_price değeri varsa (package) ya da GET /plans/custom → yearly_available: true ise (custom) sunulur; aksi halde 422, errors[].field = billing_cycle, code = UNAVAILABLE. From source modda yoktur.

Yaygın hatalar
VALIDATION_FAILEDINSUFFICIENT_BALANCEPLAN_NOT_FOUNDLOCATION_INVALIDHOSTNAME_IN_USEIDEMPOTENCY_KEY_CONFLICTUPSTREAM_ERROR
curl -sX POST "https://api.netlen.com.tr/v2/servers" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2b90-8f7a-4e51-9c3f-1a2b3c4d5e6f" \
  -d '{ "name": "web01", "location_id": 3, "plan_id": 6, "os_version_id": 4, "password": "Str0ng!pw#9", "billing_cycle": "yearly" }'
Response201 Created
{
  "data": { /* full server object */ },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Update server (rename)

PATCH/servers/{id}#

Yalnızca hostname değişikliği desteklenir.

Path parameters
idstringrequired

Sunucu id.

Body parameters
namestringrequired

Yeni hostname.

Yaygın hatalar
VALIDATION_FAILEDRESOURCE_NOT_FOUND
curl -sX PATCH "https://api.netlen.com.tr/v2/servers/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "web-01-renamed" }'
Response200 OK
{ "data": { /* updated server object */ }, "meta": { "request_id": "..." } }

Delete server

DELETE/servers/{id}#

Sunucuyu siler ve kullanılmayan sürenin ücretini iade eder. Yıllık sunucular (billing.deletable = false) API ile silinemez: 409 STATE_CONFLICT; iptal için panelden iptal talebi açılır.

Path parameters
idstringrequired

Sunucu id.

Yaygın hatalar
RESOURCE_NOT_FOUNDSTATE_CONFLICT
curl -sX DELETE "https://api.netlen.com.tr/v2/servers/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "id": "NET10231",
    "status": "deleted",
    "refund": { "amount": "12.50", "currency": "USD" },
    "balance": { "amount": "55.00", "currency": "USD" }
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Server actions (power / lifecycle)

POST/servers/{id}/actions/{verb} Async#

start · stop · reboot · reset_password · reinstall · resize · clone. Async işlemler 202 + operation döner (poll edin). Yıllık sunucuda resize yıllık birim fiyatlarla hesaplanır (fark × yılın kalan oranı) ve kaynak azaltılamaz (422).

Path parameters
idstringrequired

Sunucu id.

verbenumrequired

İşlem adı.

Body parameters
passwordstringoptional

reset_password için opsiyonel; verilmezse otomatik oluşturulur.

os_version_idintoptional

reinstall için OS id.

cpuintoptional

resize — yeni vCPU (custom sunucular).

ram_gbintoptional

resize — yeni RAM.

disk_gbintoptional

resize — yeni disk (sadece büyütme).

traffic_gbintoptional

resize — yeni aylık trafik GB.

hostnamestringoptional

clone — yeni sunucu için hostname.

Yaygın hatalar
RESOURCE_NOT_FOUNDSTATE_CONFLICTINSUFFICIENT_BALANCEUPSTREAM_ERROR
curl -sX POST "https://api.netlen.com.tr/v2/servers/:id/actions/:verb" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ /* body */ }'
Response202 Accepted
{
  "data": {
    "operation": {
      "id": "op_9f2c...",
      "type": "server.reboot",
      "status": "queued",
      "resource": { "type": "server", "id": "NET10231" }
    }
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Paket yükseltme (upgrade)

POST/servers/{id}/actions/upgrade#

Sunucuyu daha yüksek bir pakete yükseltir. Yeni paket ile mevcut paket arasındaki fark, dönemin kalan süresi (remaining_hours) oranında hesaplanıp anında tahsil edilir. Yanıt; güncellenmiş tam sunucu objesini ve upgrade özetini (from/to, tahsil edilen tutar, kalan saat) döner. Senkron çalışır (200). Yıllık sunucuda paketlerin yearly_price değerleri kullanılır: fark × yılın kalan oranı. Hedef paketin yıllık fiyatı yoksa 422 (package_id), mevcut paketinki yoksa 409 STATE_CONFLICT.

Path parameters
idstringrequired

Sunucu id.

Body parameters
package_idintrequired

Yükseltilecek hedef paketin id'si.

Yaygın hatalar
RESOURCE_NOT_FOUNDVALIDATION_FAILEDSTATE_CONFLICTINSUFFICIENT_BALANCEUPSTREAM_ERROR
curl -sX POST "https://api.netlen.com.tr/v2/servers/:id/actions/upgrade" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "package_id": 42 }'
Response200 OK
{
  "data": {
    "id": "YJ9PUR6",
    "package": "VPS-8GB",
    "amount": "24.00",
    "upgrade": {
      "from": "VPS-4GB",
      "to": "VPS-8GB",
      "charged": { "amount": "6.40", "currency": "USD" },
      "remaining_hours": 192.0
    }
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Server add-on prices

GET/servers/{id}/addons#

Bu sunucu için satın alınabilir ek hizmetlerin fiyatı (satın almadan ÖNCE). Satın alma uçlarıyla aynı hesap. price = sunucunun fatura dönemi başına (billing_cycle; yıllık sunucuda yıllık); charge_now = satın alma bugün ne tahsil eder (yıllık sunucuda dönemin kalan kısmı). Alias: GET /servers/{id}/pricing.

Notlar

available: false → o eklenti bu sunucuda sunulmuyor (ör. NetlenVM olmayan sunucu). Satın alma: extra_ip → POST /servers/{id}/ips · snapshot → POST /servers/{id}/snapshots (free: true → ücretsiz; max_per_server limiti, null = sınırsız) · backup → POST /servers/{id}/backups · plan yükseltme → GET /plans fiyatları + POST /servers/{id}/actions/resize.

Path parameters
idstringrequired

Servis kodu (SRV-AB12C).

Yaygın hatalar
RESOURCE_NOT_FOUND
curl -s "https://api.netlen.com.tr/v2/servers/:id/addons" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "server_id": "SRV-AB12C",
    "billing_cycle": "monthly",
    "extra_ip": {
      "ipv4": { "available": true, "price": { "amount": "1.00", "currency": "USD" }, "charge_now": { "amount": "1.00", "currency": "USD" } },
      "ipv6": { "available": true, "price": { "amount": "1.00", "currency": "USD" }, "charge_now": { "amount": "1.00", "currency": "USD" } }
    },
    "snapshot": { "available": true, "free": true, "price": { "amount": "0.00", "currency": "USD" }, "charge_now": { "amount": "0.00", "currency": "USD" }, "max_per_server": 1 },
    "backup": { "available": true, "price": { "amount": "2.00", "currency": "USD" }, "charge_now": { "amount": "2.00", "currency": "USD" } }
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

List snapshots

GET/servers/{id}/snapshots#

Sunucuya ait snapshot'ları listeler.

Path parameters
idstringrequired

Sunucu id.

curl -s "https://api.netlen.com.tr/v2/servers/:id/snapshots" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": [
    { "id": 8123, "name": "pre-upgrade", "status": "available", "size_gb": 3.4, "created_at": "2026-07-01T09:00:00Z" }
  ],
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Create snapshot

POST/servers/{id}/snapshots Billable#

Snapshot oluşturur. Ücretli korumada ücret sunucunun dönemine göredir: aylık sunucuda ilk ay şimdi tahsil edilir; yıllık sunucuda koruma yıllıktır, sunucuyla aynı gün biter ve şimdi yılın kalan kısmı alınır (billing.charged). Ücretsiz snapshot'ta billing.cycle = "free". Silindiğinde faturalandırma durur.

Path parameters
idstringrequired

Sunucu id.

Body parameters
namestringrequired

Snapshot adı.

Yaygın hatalar
VALIDATION_FAILEDINSUFFICIENT_BALANCESTATE_CONFLICTUPSTREAM_ERROR
curl -sX POST "https://api.netlen.com.tr/v2/servers/:id/snapshots" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "pre-upgrade" }'
Response201 Created
{
  "data": {
    "id": 8124, "name": "pre-upgrade", "status": "creating", "size_gb": null,
    "billing": { "amount": "0.00", "currency": "USD", "cycle": "free", "charged": "0.00" },
    "created_at": "2026-07-13T12:00:00Z"
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

List firewall rules

GET/servers/{id}/firewall/rules#

Sunucunun stateful firewall kurallarını listeler (position asc sırada).

Path parameters
idstringrequired

Sunucu id.

curl -s "https://api.netlen.com.tr/v2/servers/:id/firewall/rules" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

List server IPs

GET/servers/{id}/ips#

Sunucuya atanmış IPv4 ve IPv6 adreslerini listeler.

Path parameters
idstringrequired

Sunucu id.

curl -s "https://api.netlen.com.tr/v2/servers/:id/ips" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Purchase extra IP

POST/servers/{id}/ips Billable#

Ek IP satın alır (billable). Body: {version: 4|6}. Aylık sunucuda IP ücreti aylık faturaya eklenir ve bir aylık şimdi alınır. Yıllık sunucuda yıllık tutara IP fiyatı × 12 eklenir, şimdi yalnız yılın kalan kısmı alınır. Yanıtta price döneme eklenen tutar, charged şimdi alınan tutardır.

Path parameters
idstringrequired

Sunucu id.

Body parameters
versionintrequired

4 veya 6.

Yaygın hatalar
INSUFFICIENT_BALANCECAPACITY_UNAVAILABLE
curl -sX POST "https://api.netlen.com.tr/v2/servers/:id/ips" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "version": 4 }'
Response201 Created
{
  "data": {
    "address": "77.92.151.42", "version": 4, "is_primary": false,
    "price": { "amount": "36.00", "currency": "USD" },
    "billing_cycle": "yearly",
    "charged": { "amount": "27.12", "currency": "USD" },
    "balance": { "amount": "112.88", "currency": "USD" }
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Get console URL (VNC)

GET/servers/{id}/console#

Kısa ömürlü, tek kullanımlık VNC/console viewer URL'i döner. Ham provider WebSocket'i dışarıya açılmaz — broker üzerinden gelir.

Path parameters
idstringrequired

Sunucu id.

Yaygın hatalar
RESOURCE_NOT_FOUNDSTATE_CONFLICTUPSTREAM_ERROR
curl -s "https://api.netlen.com.tr/v2/servers/:id/console" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "viewer_url": "https://console.netlen.com.tr/vnc/...",
    "expires_at": "2026-07-13T15:00:00Z",
    "expires_in": 300
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Server metrics

GET/servers/{id}/metrics#

CPU / memory / disk utilization.

Path parameters
idstringrequired

Sunucu id.

curl -s "https://api.netlen.com.tr/v2/servers/:id/metrics" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Server traffic

GET/servers/{id}/traffic#

Aylık in/out trafik bytes + kota bilgisi.

Path parameters
idstringrequired

Sunucu id.

curl -s "https://api.netlen.com.tr/v2/servers/:id/traffic" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Get operation

GET/operations/{id}#

Async bir operation'ın durumunu döner. status: queued · running · completed · failed.

Path parameters
idstringrequired

Operation id (op_...).

curl -s "https://api.netlen.com.tr/v2/operations/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

6 endpoint

VDC (Virtual Data Center)

Bir VDC, satın aldığınız CPU/RAM/disk/IP/bandwidth kaynak havuzudur. Bu havuzdan bireysel VM'ler oluşturursunuz. Havuz durumu, VM listesi/detayı, actions (start/stop/reboot/reinstall/reset_password/resize), snapshots (ücretsiz).

The vdc_vm object

Objenin alan listesi için endpoint response örneklerine bakın.

example.json
{
  "id": "VDC-00042",
  "name": "app-node-1",
  "status": "active",
  "power_state": "running",
  "os": "ubuntu-24.04",
  "specs": { "cpu_cores": 4, "ram_mb": 8192, "storage_gb": 80 },
  "primary_ip": "77.92.151.60",
  "primary_ipv6": "2a01:f900:10::60",
  "created_at": "2026-07-13T14:40:12Z"
}

VDC resource pool

GET/vdc/resources#

Havuzun toplam / kullanılan / kalan miktarlarını döner. Her kova {total, used, available}.

curl -s "https://api.netlen.com.tr/v2/vdc/resources" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "has_pool": true,
    "cpu":            { "total": 16,    "used": 8,    "available": 8    },
    "ram_mb":         { "total": 32768, "used": 16384,"available": 16384 },
    "storage_gb":     { "total": 500,   "used": 240,  "available": 260  },
    "ipv4":           { "total": 8,     "used": 3,    "available": 5    },
    "ipv6":           { "total": 4,     "used": 1,    "available": 3    },
    "bandwidth_mbit": { "total": 1000,  "used": 400,  "available": 600  }
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

List VDC VMs

GET/vdc/vms#

Havuzdaki VM'leri sayfalı listeler.

Query parameters
pageintoptionaldefault: 1

Sayfa numarası.

per_pageintoptionaldefault: 25

Sayfa başına öğe (max 100).

curl -s "https://api.netlen.com.tr/v2/vdc/vms" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Get VDC VM

GET/vdc/vms/{id}#

Bir VM'nin detayı; NetlenVM VM'leri için power_state, os, specs canlı çekilir.

Path parameters
idstringrequired

VM id (VDC-00042).

curl -s "https://api.netlen.com.tr/v2/vdc/vms/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

VDC VM usage

GET/vdc/vms/{id}/usage#

CPU, memory, disk utilization (son ölçüm).

Path parameters
idstringrequired

VM id.

curl -s "https://api.netlen.com.tr/v2/vdc/vms/:id/usage" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

VDC VM actions

POST/vdc/vms/{id}/actions/{verb} Async#

start · stop · reboot · reinstall · reset_password · resize. Resize havuzdan delta kadar kaynak tüketir (per-VM ücret yok).

Path parameters
idstringrequired

VM id.

verbenumrequired

İşlem.

curl -sX POST "https://api.netlen.com.tr/v2/vdc/vms/:id/actions/:verb" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

VDC snapshots (free)

GET/vdc/vms/{id}/snapshots#

NetlenVM-backed VM'ler için snapshot listesi. VDC'de snapshot ücretsizdir.

Path parameters
idstringrequired

VM id.

curl -s "https://api.netlen.com.tr/v2/vdc/vms/:id/snapshots" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

14 endpoint

Domains

Domain kayıt, transfer, yenileme, availability check, TLD pricing, nameserver yönetimi, transfer lock, WHOIS privacy, EPP/auth-code. Bulk register/transfer/renew desteği (max 100 domain/istek).

The domain object (detail)

Objenin alan listesi için endpoint response örneklerine bakın.

example.json
{
  "id": "4821",
  "domain": "example.com",
  "status": "active",
  "auto_renew": true,
  "registered_at": "2025-03-11T00:00:00Z",
  "expires_at": "2027-03-11T00:00:00Z",
  "nameservers": ["ns1.netlen.com.tr", "ns2.netlen.com.tr"],
  "tld": ".com",
  "service_id": "DOM-A1B2C",
  "registrar": "ResellerClub",
  "transfer_lock": true,
  "whois_privacy": false,
  "registration_years": 2,
  "billing": {
    "register": { "amount": "12.00", "currency": "USD" },
    "renewal":  { "amount": "14.00", "currency": "USD" }
  }
}

List domains

GET/domains#

Hesabınıza ait domainleri sayfalı listeler.

Query parameters
pageintoptionaldefault: 1

Sayfa.

per_pageintoptionaldefault: 25

Max 100.

statusstringoptional

active, transfer_pending, cancelled, ...

curl -s "https://api.netlen.com.tr/v2/domains" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Get domain

GET/domains/{id}#

Bir domain'in tam detayı (nameservers, lock, WHOIS privacy, billing).

Path parameters
idstringrequired

Domain id.

curl -s "https://api.netlen.com.tr/v2/domains/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Check availability

GET/domains/check#

Registrar'da bir domain'in müsaitliğini kontrol eder. Ücretsiz. IDN kabul, punycode'a normalize edilir.

Query parameters
domainstringrequired

Domain adı (example.com).

Yaygın hatalar
VALIDATION_FAILEDUPSTREAM_ERROR
curl -s "https://api.netlen.com.tr/v2/domains/check" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": { "domain": "example.com", "tld": ".com", "available": true },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

TLD pricing catalog

GET/domains/pricing#

TLD başına register/renew/transfer fiyatları. tld verirseniz tek TLD; vermezseniz sayfalı katalog.

Query parameters
tldstringoptional

Örn. com veya .com.

pageintoptionaldefault: 1

Katalog sayfası.

per_pageintoptionaldefault: 50

Max 200.

curl -s "https://api.netlen.com.tr/v2/domains/pricing" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "tld": ".com",
    "register": { "amount": "12.00", "currency": "USD" },
    "renewal":  { "amount": "14.00", "currency": "USD" },
    "transfer": { "amount": "12.00", "currency": "USD" },
    "supports_whois_privacy": true,
    "years_min": 1,
    "years_max": 10
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Register domain

POST/domains Billable Idempotency-Key#

Yeni domain kaydı. Balance yeterli olmalı. Bulk için /domains/bulk/register kullanın.

Notlar

contact gönderilmezse domain, API anahtarının ait olduğu hesabın profil bilgileriyle (hesap sahibi adına) kaydedilir. Göndermek domaini başka biri adına kaydeder; hesap profiliyle birleştirilip yeni bir kayıt sahibi oluşturulur.

  • Zorunlu alanlar: name (ya da first_name + last_name), email, phone, address (en az 5 karakter), city, postal_code, country (ISO 3166-1 alpha-2, ör. TR, SG).
  • phone: E.164 (+905321234567) ya da ulusal numara + phone_country_code (5321234567 + 90).
  • Şirket adına kayıt: organization. .tr kurumsalda ayrıca tax_number, .tr bireysel kayıt sahibinde tckn (11 hane). state opsiyonel.
  • Kayıtlı kişileri kullanmak için contact yerine contacts: { "registrant": "CT-…", "admin": "CT-…", "tech": "CT-…", "billing": "CT-…" } (bkz. /domains/contacts).
  • Profil kontrolü: GET /domains/contact?tld=com → complete, missing, fields.
  • Eksik/hatalı contact → 422 VALIDATION_FAILED (errors içinde contact.phone, contact.postal_code gibi alan hataları).
  • Idempotency-Key her yeni kayıt için farklı olmalı; aynı anahtarla tekrar gönderilen istek ilk sonucu döndürür.
Body parameters
domainstringrequired

Domain adı.

yearsintrequired

Kayıt süresi (yıl).

nameserversstring[]optional

En az 2 hostname.

whois_privacybooloptional

WHOIS privacy açık/kapalı.

auto_renewbooloptional

Otomatik yenileme.

contactobjectoptional

Kayıt sahibi (opsiyonel; gönderilmezse hesap sahibi profili kullanılır). Alt alanlar ve kurallar notlarda.

Yaygın hatalar
VALIDATION_FAILEDINSUFFICIENT_BALANCEUPSTREAM_ERROR
curl -sX POST "https://api.netlen.com.tr/v2/domains" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2b90-8f7a-4e51-9c3f-1a2b3c4d5e6f" \
  -d '{ "domain": "example.com", "years": 1, "nameservers": ["ns1.netlen.com.tr", "ns2.netlen.com.tr"], "whois_privacy": true, "auto_renew": true, "contact": { "name": "Jane Doe", "email": "jane@example.com", "phone": "+905321234567", "address": "Example Street 1", "city": "Istanbul", "postal_code": "34000", "country": "TR" } }'

Transfer domain

POST/domains/transfer Billable Idempotency-Key#

Başka registrardan transfer. auth_code (EPP kodu) zorunlu.

Body parameters
domainstringrequired

Domain adı.

auth_codestringrequired

EPP / auth kodu.

yearsintoptional

Yenileme yılı (bazı TLD için opsiyonel).

curl -sX POST "https://api.netlen.com.tr/v2/domains/transfer" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2b90-8f7a-4e51-9c3f-1a2b3c4d5e6f" \
  -d '{ "domain": "example.com", "auth_code": "aBc123!xyz" }'

Renew domain

POST/domains/{id}/renew Billable Idempotency-Key#

Domain'i belirtilen yıl kadar yeniler.

Path parameters
idstringrequired

Domain id.

Body parameters
yearsintoptionaldefault: 1

Yenileme yılı.

curl -sX POST "https://api.netlen.com.tr/v2/domains/:id/renew" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2b90-8f7a-4e51-9c3f-1a2b3c4d5e6f" \
  -d '{ /* body */ }'

Set auto-renew

PUT/domains/{id}/auto-renew#

Domain otomatik yenilemeyi açar/kapatır (panel ve v1 ile aynı). Yalnız ayarı değiştirir; hemen yenilemek için POST /domains/{id}/renew. Ücretsiz. Alias: PATCH metodu · /auto_renew · /autorenew.

Notlar

enabled zorunlu (eksik/geçersiz → 422 VALIDATION_FAILED). Askıdaki ya da transferi süren domain → 409 (DOMAIN_SUSPENDED veya STATE_CONFLICT).

Path parameters
idstringrequired

Domain id.

Body parameters
enabledboolrequired

Otomatik yenileme açık mı. Alias: auto_renew.

Yaygın hatalar
VALIDATION_FAILEDRESOURCE_NOT_FOUNDSTATE_CONFLICTRATE_LIMITED
curl -sX PUT "https://api.netlen.com.tr/v2/domains/:id/auto-renew" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": false }'
Response200 OK
{
  "data": { "auto_renew": false },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Bulk register / transfer / renew

POST/domains/bulk/{action} Billable#

Bulk işlem (max 100 domain/istek). action: register · transfer · renew. Response {ok_count, fail_count, results[]} — partial success.

Path parameters
actionenumrequired

register · transfer · renew

Body parameters
domainsarrayrequired

Domain adları (string) veya obje listesi.

yearsintoptional

Body-level default (item'da yoksa).

curl -sX POST "https://api.netlen.com.tr/v2/domains/bulk/:action" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ /* body */ }'

Get nameservers

GET/domains/{id}/nameservers#

Domain'in kayıtlı NS'lerini döner.

Path parameters
idstringrequired

Domain id.

curl -s "https://api.netlen.com.tr/v2/domains/:id/nameservers" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Set nameservers

PUT/domains/{id}/nameservers#

NS'leri registrar'da günceller (tam set gönderilir; en az 2). Ücretsiz.

Path parameters
idstringrequired

Domain id.

Body parameters
nameserversstring[]required

≥2 hostname.

curl -sX PUT "https://api.netlen.com.tr/v2/domains/:id/nameservers" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "nameservers": ["ns1.netlen.com.tr", "ns2.netlen.com.tr"] }'

Transfer lock

PUT/domains/{id}/lock#

Registrar transfer lock (hırsızlık koruması).

Path parameters
idstringrequired

Domain id.

Body parameters
enabledboolrequired

true = kilitle.

curl -sX PUT "https://api.netlen.com.tr/v2/domains/:id/lock" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ /* body */ }'

WHOIS privacy

PUT/domains/{id}/whois-privacy#

WHOIS privacy'yi açar/kapatır (destekleyen TLD'ler).

Path parameters
idstringrequired

Domain id.

Body parameters
enabledboolrequired

true = privacy açık.

curl -sX PUT "https://api.netlen.com.tr/v2/domains/:id/whois-privacy" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ /* body */ }'

Get EPP / auth code

GET/domains/{id}/auth-code#

Transfer için gerekli EPP kodunu döner (kayıtlı olan veya registrar'dan yeni istenmiş).

Path parameters
idstringrequired

Domain id.

curl -s "https://api.netlen.com.tr/v2/domains/:id/auth-code" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{ "data": { "auth_code": "aBc123!xyz" }, "meta": { "request_id": "..." } }

8 endpoint

Web Hosting

cPanel bazlı web hosting hesaplarınızı yönetin: list, get, order, renew, cancel + tek kullanımlık cPanel SSO login.

The web_hosting object

Objenin alan listesi için endpoint response örneklerine bakın.

example.json
{
  "id": "WH-1029",
  "domain": "example.com",
  "status": "active",
  "plan": { "id": 5, "name": "Business" },
  "server": { "hostname": "web12.netlen.com.tr" },
  "disk_usage": { "used_mb": null, "quota_mb": 10240 },
  "billing": {
    "amount": "12.00",
    "currency": "USD",
    "cycle": "monthly",
    "next_billing_at": "2026-08-13T00:00:00Z"
  },
  "created_at": "2026-07-13T09:20:11Z"
}

List hosting accounts

GET/web-hosting#

Hesaba ait web hosting servislerini listeler.

Query parameters
pageintoptionaldefault: 1

Sayfa.

per_pageintoptionaldefault: 25

Max 100.

statusstringoptional

active · suspended · cancelled

curl -s "https://api.netlen.com.tr/v2/web-hosting" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Get hosting account

GET/web-hosting/{id}#

Bir hosting hesabının detayı.

Path parameters
idstringrequired

Servis kodu (WH-1029).

curl -s "https://api.netlen.com.tr/v2/web-hosting/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

List hosting packages

GET/web-hosting/packages#

Sipariş edilebilir web hosting paketleri ve fiyatları. id, POST /web-hosting'in beklediği package_id'dir. İlk tahsilat = price (monthly) ya da yearly_price (yearly) + setup_fee (+ opsiyonel özel IP → GET /web-hosting/dedicated-ip); yenileme = price / yearly_price.

Notlar

specs değerleri paket limitleridir (null = pakette tanımlı değil). yearly_price: null → yıllık sunulmuyor. Sayfalıdır (meta.pagination).

Query parameters
pageintoptionaldefault: 1

Sayfa.

per_pageintoptionaldefault: 25

Max 100.

curl -s "https://api.netlen.com.tr/v2/web-hosting/packages" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": [
    {
      "id": 3,
      "name": "Pro",
      "description": null,
      "specs": { "disk_mb": 20480, "bandwidth_gb": 0, "domains": 5, "databases": 10, "email_accounts": 50, "ftp_accounts": 10, "inodes": 250000 },
      "price": { "amount": "9.99", "currency": "USD" },
      "yearly_price": { "amount": "99.00", "currency": "USD" },
      "setup_fee": { "amount": "0.00", "currency": "USD" },
      "available": true
    }
  ],
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Get hosting package

GET/web-hosting/packages/{id}#

Tek bir web hosting paketinin detayı ve fiyatı.

Notlar

Bilinmeyen ya da pasif paket → 404 RESOURCE_NOT_FOUND.

Path parameters
idintrequired

Paket id (package_id).

Yaygın hatalar
RESOURCE_NOT_FOUND
curl -s "https://api.netlen.com.tr/v2/web-hosting/packages/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Order hosting

POST/web-hosting Billable#

Web hosting paketi satın alır ve cPanel hesabını provisiyon eder. Provision başarısız olursa bakiye çekilmez.

Body parameters
domainstringrequired

Birincil domain.

package_idintrequired

GET /web-hosting/packages'tan bir id (aktif web_hosting_packages.id).

billing_cycleenumoptional

monthly (default) · yearly

Yaygın hatalar
VALIDATION_FAILEDSTATE_CONFLICTINSUFFICIENT_BALANCESERVICE_UNAVAILABLEUPSTREAM_ERROR
curl -sX POST "https://api.netlen.com.tr/v2/web-hosting" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "domain": "example.com", "package_id": 5, "billing_cycle": "monthly" }'

Renew hosting

POST/web-hosting/{id}/renew Billable#

Aktif hesabı bir döngü uzatır. Body opsiyonel.

Path parameters
idstringrequired

Servis kodu.

Yaygın hatalar
RESOURCE_NOT_FOUNDSTATE_CONFLICTINSUFFICIENT_BALANCE
curl -sX POST "https://api.netlen.com.tr/v2/web-hosting/:id/renew" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Cancel hosting

POST/web-hosting/{id}/cancel#

Hesabı iptal eder ve hemen sonlandırır. İade yapılmaz (refund / refund_balance parametreleri yok sayılır, yanıtta refund alanı dönmez).

Path parameters
idstringrequired

Servis kodu.

Body parameters
send_emailbooloptionaldefault: false

İptal e-postası.

reasonstringoptional

İptal nedeni.

curl -sX POST "https://api.netlen.com.tr/v2/web-hosting/:id/cancel" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ /* body */ }'

cPanel SSO login

GET/web-hosting/{id}/login#

Kısa ömürlü, tek kullanımlık cPanel SSO URL'i döner.

Path parameters
idstringrequired

Servis kodu.

curl -s "https://api.netlen.com.tr/v2/web-hosting/:id/login" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "id": "WH12345678",
    "username": "example1",
    "login_url": "https://web12.netlen.com.tr:2083/cpsess.../login/?session=...",
    "note": "Short-lived, single-use cPanel SSO URL — redirect immediately."
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

15 endpoint

Reseller Hosting

WHM/cPanel bayi (reseller) hosting hesaplarınızı yönetin: paketler, sipariş, yenileme, iptal talebi, WHM/cPanel tek kullanımlık SSO login ve özel IP. {id} = hizmet kodu (service_id, ör. RS100234). Sipariş, yenileme ve özel IP alımı Idempotency-Key başlığını destekler. Not: /reseller AYRI bir kaynaktır (bayi indirim programı); Reseller Hosting ürünü /reseller-hosting.

The reseller_hosting object

Objenin alan listesi için endpoint response örneklerine bakın.

example.json
{
  "id": "RS100234",
  "domain": "bayi-ornek.com",
  "status": "active",
  "plan": { "id": 2, "name": "Reseller 25" },
  "limits": { "accounts": 25, "disk_mb": 51200 },
  "server": { "hostname": "web-srv-04.netlen.com.tr" },
  "nameservers": ["ns1.netlen.com.tr", "ns2.netlen.com.tr"],
  "billing": { "amount": "30.00", "currency": "USD", "cycle": "monthly", "next_billing_at": "2026-11-08T00:00:00Z" },
  "created_at": "2026-10-08T12:00:00Z",
  "credentials": { "username": "bayiornk", "password": "…", "whm_url": "https://web-srv-04.netlen.com.tr:2087", "cpanel_url": "https://web-srv-04.netlen.com.tr:2083" },
  "dedicated_ips": []
}

List reseller packages

GET/reseller-hosting/packages#

Sipariş edilebilir bayi hosting paketleri ve fiyatları. id, POST /reseller-hosting'in beklediği package_id'dir. Kurulum ücreti yoktur.

Notlar

yearly_price: null → o pakette yıllık sipariş verilemez. Kurulum ücreti yoktur. Sayfalıdır (meta.pagination).

Query parameters
pageintoptionaldefault: 1

Sayfa.

per_pageintoptionaldefault: 25

Max 100.

curl -s "https://api.netlen.com.tr/v2/reseller-hosting/packages" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": [
    {
      "id": 2,
      "name": "Reseller 25",
      "description": null,
      "specs": { "accounts": 25, "disk_mb": 51200, "bandwidth_gb": 500, "ram_mb": 4096, "cpu_cores": 4, "inodes": 600000 },
      "price": { "amount": "30.00", "currency": "USD" },
      "yearly_price": { "amount": "300.00", "currency": "USD" },
      "available": true
    }
  ],
  "meta": { "pagination": { "page": 1, "per_page": 25, "total": 1, "total_pages": 1 } }
}

Get reseller package

GET/reseller-hosting/packages/{id}#

Tek bir bayi hosting paketinin detayı ve fiyatı.

Path parameters
idintrequired

Paket id (package_id).

Yaygın hatalar
RESOURCE_NOT_FOUND
curl -s "https://api.netlen.com.tr/v2/reseller-hosting/packages/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Dedicated IP offer

GET/reseller-hosting/dedicated-ip#

Özel IP eklentisinin dönem fiyatı (siparişte dedicated_ip_count ve sonradan POST /reseller-hosting/{id}/dedicated-ips için).

curl -s "https://api.netlen.com.tr/v2/reseller-hosting/dedicated-ip" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

List reseller accounts

GET/reseller-hosting#

Hesaba ait bayi hosting servislerini listeler. credentials listede DÖNMEZ.

Query parameters
pageintoptionaldefault: 1

Sayfa.

per_pageintoptionaldefault: 25

Max 100.

statusstringoptional

active · suspended · pending · cancelled

curl -s "https://api.netlen.com.tr/v2/reseller-hosting" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Order reseller hosting

POST/reseller-hosting Billable Idempotency-Key#

Bayi hosting paketi satın alır ve WHM hesabını provisiyon eder. Tutar = aylık/yıllık paket fiyatı + (özel IP dönem fiyatı × adet). Kurulum hata verirse (502 UPSTREAM_ERROR) tahsilat otomatik iade edilir.

Notlar

credentials yalnız sipariş yanıtında ve detayda döner (listede dönmez); şifre gizli tutulmalı. Domain'de zaten aktif bayi hizmeti varsa 409 STATE_CONFLICT.

Body parameters
domainstringrequired

Birincil domain.

package_idintrequired

GET /reseller-hosting/packages'tan bir id.

billing_cycleenumoptional

monthly (default) · yearly (paketin yearly_price'ı varsa).

dedicated_ip_countintoptionaldefault: 0

Siparişle alınacak özel IP adedi.

Yaygın hatalar
VALIDATION_FAILEDSTATE_CONFLICTINSUFFICIENT_BALANCESERVICE_UNAVAILABLEUPSTREAM_ERROR
curl -sX POST "https://api.netlen.com.tr/v2/reseller-hosting" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2b90-8f7a-4e51-9c3f-1a2b3c4d5e6f" \
  -d '{ "domain": "bayi-ornek.com", "package_id": 2, "billing_cycle": "monthly", "dedicated_ip_count": 0 }'
Response201 Created
{
  "data": {
    "id": "RS100234",
    "domain": "bayi-ornek.com",
    "status": "active",
    "plan": { "id": 2, "name": "Reseller 25" },
    "limits": { "accounts": 25, "disk_mb": 51200 },
    "server": { "hostname": "web-srv-04.netlen.com.tr" },
    "nameservers": ["ns1.netlen.com.tr", "ns2.netlen.com.tr"],
    "billing": { "amount": "30.00", "currency": "USD", "cycle": "monthly", "next_billing_at": "2026-11-08T00:00:00Z" },
    "created_at": "2026-10-08T12:00:00Z",
    "credentials": { "username": "bayiornk", "password": "…", "whm_url": "https://web-srv-04.netlen.com.tr:2087", "cpanel_url": "https://web-srv-04.netlen.com.tr:2083" },
    "dedicated_ips": [],
    "charged": { "amount": "30.00", "currency": "USD" }
  }
}

Get reseller account

GET/reseller-hosting/{id}#

Bir bayi hosting hesabının detayı: WHM/cPanel giriş bilgileri (credentials) ve özel IP'ler dahil. Sipariş yanıtıyla aynı nesne (charged hariç).

Path parameters
idstringrequired

Hizmet kodu (RS100234).

Yaygın hatalar
RESOURCE_NOT_FOUND
curl -s "https://api.netlen.com.tr/v2/reseller-hosting/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Renew reseller hosting

POST/reseller-hosting/{id}/renew Billable Idempotency-Key#

Aktif hesabı bir dönem uzatır (bakiyeden). Yalnız active hesaplarda; aksi halde 409 STATE_CONFLICT. 200 → hesap nesnesi + charged.

Path parameters
idstringrequired

Hizmet kodu.

Yaygın hatalar
RESOURCE_NOT_FOUNDSTATE_CONFLICTINSUFFICIENT_BALANCE
curl -sX POST "https://api.netlen.com.tr/v2/reseller-hosting/:id/renew" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Idempotency-Key: 6f1c2b90-8f7a-4e51-9c3f-1a2b3c4d5e6f"

Cancel reseller hosting

POST/reseller-hosting/{id}/cancel#

İptal TALEBİ açar (hesabı hemen sonlandırmaz, iade yapmaz); personel Manage'de onaylar. DELETE /reseller-hosting/{id} de aynı işi yapar. Hesap başına tek açık talep olabilir; ikincisinde 409 STATE_CONFLICT.

Path parameters
idstringrequired

Hizmet kodu.

Body parameters
reasonstringoptional

İptal nedeni.

cancel_timingenumoptional

immediate (default) · end_of_term (dönem sonunda; effective_date dönem sonu, hesap o tarihe kadar açık).

Yaygın hatalar
VALIDATION_FAILEDSTATE_CONFLICTRESOURCE_NOT_FOUND
curl -sX POST "https://api.netlen.com.tr/v2/reseller-hosting/:id/cancel" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "İhtiyaç kalmadı", "cancel_timing": "immediate" }'
Response202 Accepted
{
  "data": {
    "request_id": 812,
    "id": "RS100234",
    "status": "pending",
    "cancel_timing": "immediate",
    "effective_date": null
  }
}

cPanel SSO login

GET/reseller-hosting/{id}/login#

Kısa ömürlü, tek kullanımlık cPanel SSO URL'i döner (hemen yönlendirin).

Path parameters
idstringrequired

Hizmet kodu.

Yaygın hatalar
STATE_CONFLICT
curl -s "https://api.netlen.com.tr/v2/reseller-hosting/:id/login" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

WHM SSO login

GET/reseller-hosting/{id}/whm-login#

Kısa ömürlü, tek kullanımlık WHM SSO URL'i döner (hemen yönlendirin).

Path parameters
idstringrequired

Hizmet kodu.

Yaygın hatalar
STATE_CONFLICTUPSTREAM_ERROR
curl -s "https://api.netlen.com.tr/v2/reseller-hosting/:id/whm-login" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "id": "RS100234",
    "username": "bayiornk",
    "login_url": "https://web-srv-04.netlen.com.tr:2087/cpsess.../login/?session=...",
    "note": "Short-lived, single-use WHM SSO URL — redirect immediately."
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

List dedicated IPs

GET/reseller-hosting/{id}/dedicated-ips#

Hesabın özel IP'leri + satın alma teklifi. Biçim /web-hosting/{id}/dedicated-ips ile birebir aynıdır.

Path parameters
idstringrequired

Hizmet kodu.

curl -s "https://api.netlen.com.tr/v2/reseller-hosting/:id/dedicated-ips" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Buy dedicated IPs

POST/reseller-hosting/{id}/dedicated-ips Billable Idempotency-Key#

Özel IP satın alır (bakiyeden). 201.

Path parameters
idstringrequired

Hizmet kodu.

Body parameters
countintrequired

Alınacak IP adedi.

Yaygın hatalar
VALIDATION_FAILEDINSUFFICIENT_BALANCESTATE_CONFLICT
curl -sX POST "https://api.netlen.com.tr/v2/reseller-hosting/:id/dedicated-ips" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f1c2b90-8f7a-4e51-9c3f-1a2b3c4d5e6f" \
  -d '{ "count": 1 }'

Release dedicated IP

DELETE/reseller-hosting/{id}/dedicated-ips/{ref}#

Özel IP'yi bırakır. İade yapılmaz.

Path parameters
idstringrequired

Hizmet kodu.

refstringrequired

Özel IP kimliği.

Yaygın hatalar
RESOURCE_NOT_FOUND
curl -sX DELETE "https://api.netlen.com.tr/v2/reseller-hosting/:id/dedicated-ips/:ref" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Get dedicated IP rDNS

GET/reseller-hosting/{id}/dedicated-ips/{ref}/rdns#

Özel IP'nin rDNS (PTR) kaydını okur.

Path parameters
idstringrequired

Hizmet kodu.

refstringrequired

Özel IP kimliği.

curl -s "https://api.netlen.com.tr/v2/reseller-hosting/:id/dedicated-ips/:ref/rdns" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Set dedicated IP rDNS

PUT/reseller-hosting/{id}/dedicated-ips/{ref}/rdns#

Özel IP'nin rDNS (PTR) kaydını yazar.

Path parameters
idstringrequired

Hizmet kodu.

refstringrequired

Özel IP kimliği.

Body parameters
hostnamestringrequired

PTR hostname.

Yaygın hatalar
VALIDATION_FAILEDRESOURCE_NOT_FOUND
curl -sX PUT "https://api.netlen.com.tr/v2/reseller-hosting/:id/dedicated-ips/:ref/rdns" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "hostname": "mail.bayi-ornek.com" }'

7 endpoint

Catalog

Sipariş için gerekli katalog kaynakları: plans (server paketleri; aylık price, yıllık yearly_price), özel sunucu birim fiyatları ve fiyat teklifi (/plans/custom), packages (aynı katalog, sade view), operating systems, locations. Fiyat teklifi dışında yalnızca okuma; teklif de hiçbir şey oluşturmaz, ücret almaz. Fiyat kataloğu haritası (ürün → fiyat GET → sipariş POST): Sunucu GET /plans · /packages · /plans/custom → POST /servers; sunucu eklentileri GET /servers/{id}/addons → POST /servers/{id}/ips · /snapshots · /backups; web hosting GET /web-hosting/packages → POST /web-hosting; web hosting özel IP GET /web-hosting/dedicated-ip → POST /web-hosting; domain GET /domains/pricing → POST /domains · /domains/transfer · /domains/{id}/renew.

The plan object

idintKatalog id. POST /servers'a plan_id olarak verin.
namestringGörünen ad.
specsobjectcpu_cores, ram_mb, storage_gb; bandwidth_gb yalnız planda tanımlıysa (/plans).
pricemoneyAylık fiyat.
yearly_pricemoney | nullYıllık fiyat (bir yıl peşin). POST /servers'ta billing_cycle: "yearly" ile kullanılır; null = yıllık sunulmuyor.
availableboolSipariş edilebilir.
example.json
{
  "id": 6,
  "name": "VPS-6",
  "specs": { "cpu_cores": 6, "ram_mb": 16384, "storage_gb": 120, "bandwidth_gb": 8000 },
  "price": { "amount": "39.00", "currency": "USD" },
  "yearly_price": { "amount": "430.56", "currency": "USD" },
  "available": true
}

List plans

GET/plans#

Server paketleri (bandwidth_gb dahil). id'yi POST /servers'a plan_id olarak verin. price aylık, yearly_price yıllık fiyattır (null = yıllık sunulmuyor).

Query parameters
pageintoptionaldefault: 1

Sayfa.

per_pageintoptionaldefault: 25

Max 100.

curl -s "https://api.netlen.com.tr/v2/plans" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": [
    { "id": 6, "name": "VPS-6",
      "specs": { "cpu_cores": 6, "ram_mb": 16384, "storage_gb": 120, "bandwidth_gb": 8000 },
      "price": { "amount": "39.00", "currency": "USD" },
      "yearly_price": { "amount": "430.56", "currency": "USD" }, "available": true }
  ],
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Get plan

GET/plans/{id}#

Tek bir server planının detayı.

Path parameters
idintrequired

Plan id.

curl -s "https://api.netlen.com.tr/v2/plans/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

List packages

GET/packages#

Plans ile aynı katalog, bandwidth_gb olmayan sade view. price ve yearly_price burada da döner.

curl -s "https://api.netlen.com.tr/v2/packages" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Custom server unit prices

GET/plans/custom#

Özel sunucu (POST /servers, plan_id olmadan) için aylık ve yıllık birim fiyatlar ve fiyatlama kuralları. Birim fiyatlar 6 ondalığa kadar olabilir (ör. yıllık disk 0.275).

Notlar

available: özel sunucu sipariş edilebilir. yearly_available: özel sunucuda billing_cycle: "yearly" sunuluyor; değilse unit_prices.yearly null. Değeri null olan kalem ücretlendirilmez. Hesap (her satır 2 ondalığa yuvarlanır, sonra toplanır): cpu_core × cpu_cores · ram_gb × ⌈ram_mb / 1024⌉ · storage_gb × storage_gb · traffic_tb × ⌊traffic_gb / 1024⌋ (yalnız tam TB) · ipv4 × ipv4_count (en az 1) · ipv6 × (ipv6_count − 1; ilk IPv6 ücretsiz). Bayi paket indirimi özel sunucuya uygulanmaz.

Yaygın hatalar
METHOD_NOT_ALLOWED
curl -s "https://api.netlen.com.tr/v2/plans/custom" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "available": true,
    "yearly_available": true,
    "unit_prices": {
      "monthly": {
        "cpu_core":   { "amount": "1.00",  "currency": "USD" },
        "ram_gb":     { "amount": "1.00",  "currency": "USD" },
        "storage_gb": { "amount": "0.025", "currency": "USD" },
        "traffic_tb": null,
        "ipv4":       { "amount": "1.00",  "currency": "USD" },
        "ipv6":       { "amount": "1.00",  "currency": "USD" }
      },
      "yearly": {
        "cpu_core":   { "amount": "11.00", "currency": "USD" },
        "ram_gb":     { "amount": "11.00", "currency": "USD" },
        "storage_gb": { "amount": "0.275", "currency": "USD" },
        "traffic_tb": null,
        "ipv4":       { "amount": "11.00", "currency": "USD" },
        "ipv6":       { "amount": "11.00", "currency": "USD" }
      }
    },
    "rules": {
      "ram_billing_unit_mb": 1024, "traffic_billing_unit_gb": 1024, "ipv4_min_count": 1,
      "ipv6_free_count": 1, "line_rounding_decimals": 2, "reseller_discount": false
    }
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Quote a custom server

POST/plans/custom/quote#

Bir özel sunucu yapılandırmasının fiyatını POST /servers ile aynı hesapla döner: satır satır döküm ve toplam. Hiçbir şey oluşturulmaz, ücret alınmaz. amount, aynı yapılandırma ve dönem için POST /servers'ın tahsil edeceği tutardır.

Notlar

billing_cycle: "yearly" özel sunucuda sunulmuyorsa 422 VALIDATION_FAILED (errors[].code = UNAVAILABLE). Özel sunucu fiyatlaması tanımlı değilse 503 SERVICE_UNAVAILABLE.

Body parameters
cpu_coresintrequired

≥ 1.

ram_mbintrequired

≥ 1024. Tam GB'a yukarı yuvarlanarak ücretlenir.

storage_gbintrequired

≥ 1.

traffic_gbintoptionaldefault: 0

Aylık trafik; yalnız tam TB ücretlenir.

ipv4_countintoptionaldefault: 1

En az 1.

ipv6_countintoptionaldefault: 1

İlk IPv6 ücretsiz.

billing_cycleenumoptionaldefault: monthly

monthly · yearly.

Yaygın hatalar
VALIDATION_FAILEDMETHOD_NOT_ALLOWEDSERVICE_UNAVAILABLE
curl -sX POST "https://api.netlen.com.tr/v2/plans/custom/quote" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "cpu_cores": 2, "ram_mb": 4096, "storage_gb": 40, "ipv4_count": 1, "billing_cycle": "yearly" }'
Response200 OK
{
  "data": {
    "billing_cycle": "yearly",
    "specs": { "cpu_cores": 2, "ram_mb": 4096, "storage_gb": 40, "traffic_gb": 0, "ipv4_count": 1, "ipv6_count": 1 },
    "lines": [
      { "item": "cpu_core", "quantity": 2, "billed_quantity": 2, "unit_price": { "amount": "11.00", "currency": "USD" }, "total": { "amount": "22.00", "currency": "USD" } },
      { "item": "ram_gb", "quantity": 4, "billed_quantity": 4, "unit_price": { "amount": "11.00", "currency": "USD" }, "total": { "amount": "44.00", "currency": "USD" } },
      { "item": "storage_gb", "quantity": 40, "billed_quantity": 40, "unit_price": { "amount": "0.275", "currency": "USD" }, "total": { "amount": "11.00", "currency": "USD" } },
      { "item": "traffic_tb", "quantity": 0, "billed_quantity": 0, "unit_price": null, "total": { "amount": "0.00", "currency": "USD" } },
      { "item": "ipv4", "quantity": 1, "billed_quantity": 1, "unit_price": { "amount": "11.00", "currency": "USD" }, "total": { "amount": "11.00", "currency": "USD" } },
      { "item": "ipv6", "quantity": 1, "billed_quantity": 0, "unit_price": { "amount": "11.00", "currency": "USD" }, "total": { "amount": "0.00", "currency": "USD" } }
    ],
    "amount": { "amount": "88.00", "currency": "USD" }
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

List operating systems

GET/operating-systems#

Kurulabilir OS versiyonlarının flat listesi. id = os_version_id.

curl -s "https://api.netlen.com.tr/v2/operating-systems" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

List locations

GET/locations#

Sunucu oluşturma için kullanılabilir lokasyonlar.

curl -s "https://api.netlen.com.tr/v2/locations" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

2 endpoint

Billing

Hesap bakiyesi ve balance ledger sorgulama. Bakiye yükleme + fatura yönetimi panelden yapılır (501 NOT_IMPLEMENTED). Bütün para değerleri money objesi, USD.

Get balance

GET/billing/balance#

Hesabın güncel bakiyesi.

curl -s "https://api.netlen.com.tr/v2/billing/balance" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "balance": { "amount": "42.50", "currency": "USD" },
    "currency": "USD"
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

List transactions

GET/billing/transactions#

Balance transaction'ları newest-first listeler.

Query parameters
pageintoptionaldefault: 1

Sayfa.

per_pageintoptionaldefault: 25

Max 100.

typestringoptional

deposit · withdraw · refund

curl -s "https://api.netlen.com.tr/v2/billing/transactions" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": [
    { "id": 5821, "type": "deposit",
      "amount": { "amount": "50.00", "currency": "USD" },
      "description": "Balance top-up (Stripe)",
      "status": "success",
      "created_at": "2026-07-13T14:40:12Z" }
  ],
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

3 endpoint

Account

Hesap profili, API anahtarları metadata'sı ve IP allowlist okuma. Yazma işlemleri panel-only (501 NOT_IMPLEMENTED). Secret'lar (key değeri, hash, token) döndürülmez.

Get profile

GET/account#

Kimlik doğrulanmış müşterinin profil bilgisi.

curl -s "https://api.netlen.com.tr/v2/account" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "id": "NET10231",
    "email": "ada@example.com",
    "name": "Ada Lovelace",
    "company": "Analytical Engines Ltd.",
    "phone": "+90 5551234567",
    "country": "TR",
    "status": "active",
    "balance": { "amount": "42.50", "currency": "USD" },
    "created_at": "2026-01-04T09:12:00Z"
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

List API keys

GET/account/api-keys#

API anahtarları metadata'sı (key değeri dönmez).

curl -s "https://api.netlen.com.tr/v2/account/api-keys" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

List IP allowlist

GET/account/ip-allowlist#

Çağıran API anahtarına ait IP allowlist.

curl -s "https://api.netlen.com.tr/v2/account/ip-allowlist" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

6 endpoint

Support Tickets

Destek talepleri: liste, detay, oluşturma, yanıt ekleme, kapatma. GET /departments ile aktif departmanlar. Her talep customer'a scope'lu — yalnızca kendi taleplerinizi görürsünüz.

List tickets

GET/tickets#

Talepleri newest-first sayfalar. Silinmişler dahil değil.

Query parameters
pageintoptionaldefault: 1

Sayfa.

per_pageintoptionaldefault: 25

Max 100.

statusenumoptional

open · answered · customer_reply · in_progress · pending · closed

curl -s "https://api.netlen.com.tr/v2/tickets" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Get ticket

GET/tickets/{id}#

Ticket detayı + full mesaj thread'i (internal notlar hariç). related_service alanı talebin bağlı olduğu hizmeti (type, service_id, name) döndürür; bağlı hizmet yoksa null, hizmet silinmişse name null.

Path parameters
idstringrequired

Ticket numarası (T000123).

curl -s "https://api.netlen.com.tr/v2/tickets/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Create ticket

POST/tickets#

Yeni destek talebi açar. İsteğe bağlı related_service ile talebi hesabınızdaki bir hizmete (hizmet ID'si ya da alan adı) bağlayabilirsiniz; yanıt ve GET /tickets/{id} bağlı hizmeti related_service nesnesiyle (type, service_id, name) döndürür, bağlı hizmet yoksa null. Hizmet bulunamazsa ya da alan adı birden çok hizmete denk gelirse 422 VALIDATION_FAILED döner.

Notlar

Alan adıyla bağlarken ad hesabınızda birden çok hizmete denk geliyorsa türü de gönderin: {"related_service": "example.com", "related_service_type": "web_hosting"}. related_service hataları 422 VALIDATION_FAILED ile error.errors[] içinde (field / code / message) döner: related_service · NOT_FOUND (hizmet hesabınızda yok; başka hesaba ait hizmet de aynı yanıtı alır), related_service · AMBIGUOUS (alan adı birden çok hizmete denk geliyor, related_service_type gönderin), related_service_type · INVALID (izin verilen türlerden biri değil), related_service · REQUIRED (tür gönderilmiş, hizmet yok). Bağlı hizmet yoksa yanıttaki related_service null olur. Sandbox anahtarlarında doğrulama aynı çalışır; 201 yanıtında related_service döner, kayıt yazılmaz. Mevcut alanlar değişmedi (geriye uyumlu).

Body parameters
subjectstringrequired

En az 1 harf içermeli.

messagestringrequired

En az 25 karakter ve 15 harf.

department_idintoptional

Aktif bir departman id'si.

priorityenumoptionaldefault: medium

low · medium · high · urgent

related_servicestringoptional

Talebin ilgili olduğu hizmet: hizmet ID'si (ör. BWPDNEH, IPS0012345, DS00001234) ya da alan adı (example.com). Sayısal satır id'si kabul edilmez. Yalnız hesabınızın aktif, beklemedeki ya da askıdaki hizmetleri bağlanabilir; alan adlarında iptal, dışarı transfer ve silinmiş olanlar dışındaki her durum kabul edilir.

related_service_typeenumoptional

Yalnız alan adı hesabınızda birden çok hizmete denk geliyorsa gerekir (ör. alan adı kaydı + web hosting + e-posta); related_service olmadan gönderilemez. server · vdc_vm · web_hosting · dedicated_server · colocation · ip_subnet · domain · reseller · email · mail_gateway · vpn · waf · internet

Yaygın hatalar
VALIDATION_FAILED
curl -sX POST "https://api.netlen.com.tr/v2/tickets" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "subject": "Cannot reach my server", "department_id": 1, "priority": "high", "message": "My server stopped responding to SSH and ping since 10:00 today.", "related_service": "BWPDNEH" }'
Response201 Created
{
  "data": {
    "id": "T000123",
    "subject": "Cannot reach my server",
    "status": "open",
    "priority": "high",
    "department": { "id": 1, "name": "Technical" },
    "related_service": { "type": "server", "service_id": "BWPDNEH", "name": "web01" },
    "created_at": "2026-09-23T10:00:00Z",
    "messages": [ /* ... */ ]
  },
  "meta": { "request_id": "req_9f2c1a3b" }
}

Reply to ticket

POST/tickets/{id}/replies#

Ticket'a customer yanıtı ekler. Status customer_reply olur.

Path parameters
idstringrequired

Ticket numarası.

Body parameters
messagestringrequired

En az 25 karakter ve 15 harf.

Yaygın hatalar
RESOURCE_NOT_FOUNDSTATE_CONFLICTVALIDATION_FAILED
curl -sX POST "https://api.netlen.com.tr/v2/tickets/:id/replies" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ /* body */ }'

Close ticket

POST/tickets/{id}/close#

Ticket'ı kapatır. Zaten kapalı ise 409 STATE_CONFLICT.

Path parameters
idstringrequired

Ticket numarası.

curl -sX POST "https://api.netlen.com.tr/v2/tickets/:id/close" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

List departments

GET/departments#

Aktif destek departmanları.

curl -s "https://api.netlen.com.tr/v2/departments" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

6 endpoint

Sub-users

Hesabınıza bağlı ek loginler. Liste, detay, update (profile + status), delete, permission read/replace. Create (invite) panelden yapılır (501 NOT_IMPLEMENTED). Password/token döndürülmez.

List sub-users

GET/sub-users#

Sub-user'ları sayfalı listeler.

Query parameters
pageintoptionaldefault: 1

Sayfa.

per_pageintoptionaldefault: 25

Max 100.

statusenumoptional

pending · active · inactive

curl -s "https://api.netlen.com.tr/v2/sub-users" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Get sub-user

GET/sub-users/{id}#

Sub-user detayı + permission keys.

Path parameters
idintrequired

Sub-user id.

curl -s "https://api.netlen.com.tr/v2/sub-users/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Update sub-user

PATCH/sub-users/{id}#

Profile fields ve/veya status güncellemesi. email/password bu endpoint'te yazılamaz.

Path parameters
idintrequired

Sub-user id.

Body parameters
first_namestringoptional

Boş olmayan.

last_namestringoptional

Boş olmayan.

phonestringoptional

Boş olmayan.

phone_country_codestringoptional

Örn. +1.

statusenumoptional

active · inactive

curl -sX PATCH "https://api.netlen.com.tr/v2/sub-users/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ /* body */ }'

Delete sub-user

DELETE/sub-users/{id}#

Sub-user'ı ve tüm permission atamalarını siler.

Path parameters
idintrequired

Sub-user id.

curl -sX DELETE "https://api.netlen.com.tr/v2/sub-users/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Get permissions

GET/sub-users/{id}/permissions#

Sub-user'ın permission key listesi.

Path parameters
idintrequired

Sub-user id.

curl -s "https://api.netlen.com.tr/v2/sub-users/:id/permissions" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Replace permissions

PUT/sub-users/{id}/permissions#

Permission setini tamamen değiştirir. [] göndererek tümünü kaldırabilirsiniz.

Path parameters
idintrequired

Sub-user id.

Body parameters
permissionsstring[]required

Permission key'leri.

curl -sX PUT "https://api.netlen.com.tr/v2/sub-users/:id/permissions" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "permissions": ["servers.view", "servers.manage", "invoices.view"] }'

3 endpoint

SSH Keys

Hesap-wide SSH public key'leri. Sunucu oluştururken seçilirse yeni VM'e kurulur.

The ssh_key object

Objenin alan listesi için endpoint response örneklerine bakın.

example.json
{
  "id": 12,
  "name": "laptop",
  "public_key": "ssh-ed25519 AAAA...",
  "public_key_preview": "ssh-ed25519 AAAA...",
  "created_at": "2026-07-13T14:40:12Z"
}

List SSH keys

GET/ssh-keys#

Hesabın tüm public key'lerini listeler.

curl -s "https://api.netlen.com.tr/v2/ssh-keys" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

Add SSH key

POST/ssh-keys#

Hesaba yeni public key ekler.

Body parameters
namestringrequired

Key etiketi.

public_keystringrequired

Public key (ssh-ed25519 ...).

curl -sX POST "https://api.netlen.com.tr/v2/ssh-keys" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "laptop", "public_key": "ssh-ed25519 AAAA..." }'

Remove SSH key

DELETE/ssh-keys/{id}#

Key'i panelden siler (daha önce kurulduğu sunuculardan silmez).

Path parameters
idintrequired

Key id.

curl -sX DELETE "https://api.netlen.com.tr/v2/ssh-keys/:id" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"

2 endpoint

Reseller

Bayi programı durumu ve indirim ladder'ı. Read-only — bayilik ve indirim yapılandırması admin tarafından yönetilir. Aktif server sayınıza göre indirim tier'ınız hesaplanır.

Get reseller status

GET/reseller#

Bayi statüsü, aktif indirim yüzdesi, aktif server sayısı ve mevcut tier.

curl -s "https://api.netlen.com.tr/v2/reseller" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "is_reseller": true,
    "discount_percentage": 7.5,
    "discount_type": "standard",
    "active_server_count": 12,
    "current_tier": {
      "min_servers": 11,
      "max_servers": 20,
      "discount_percentage": 7.5
    }
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}

Get tier ladder

GET/reseller/tiers#

Server sayısı bandına göre indirim ladder'ı. Müşterinin şu anki tier'ı is_current: true.

curl -s "https://api.netlen.com.tr/v2/reseller/tiers" \
  -H "Authorization: Bearer $NETLEN_API_TOKEN"
Response200 OK
{
  "data": {
    "is_reseller": true,
    "discount_type": "standard",
    "active_server_count": 12,
    "tiers": [
      { "min_servers": 1,  "max_servers": 5,    "discount_percentage": 2.5, "is_current": false },
      { "min_servers": 6,  "max_servers": 10,   "discount_percentage": 5,   "is_current": false },
      { "min_servers": 11, "max_servers": 20,   "discount_percentage": 7.5, "is_current": true  },
      { "min_servers": 21, "max_servers": null, "discount_percentage": 10,  "is_current": false }
    ]
  },
  "meta": { "request_id": "req_9f2c1a3b", "version": "2.0.3" }
}
Sorularınız için iletişim · API v1 (legacy)