🌿 Green VPS Reseller API

v1 · Base URL https://api.greenvds.ir/v1 · JSON over HTTPS

این API مخصوص نمایندگان Green VPS است. کلید API را از ربات، بخش «🤝 نمایندگی ← 🔑 API و اتصال» بسازید. هر کاری که در ربات انجام می‌دهید (خرید سرور، روشن/خاموش، نصب مجدد، حذف، تیکت) از اینجا هم ممکن است و تخفیف نمایندگی شما خودکار اعمال می‌شود.

Authentication

Send your key in every request: Authorization: Bearer gvk_… (or X-API-Key). Keys are shown once when created, stored only as a hash, and can be limited to IP addresses and to read-only access. Revoke a leaked key instantly in the bot.
curl https://api.greenvds.ir/v1/me -H "Authorization: Bearer gvk_XXXXXXXXXX_..."

Responses & errors

Success: {"data": …}. Error: {"error": {"code": "…", "message": "…"}} with an HTTP status.
StatusCodes
400missing_fields, invalid_billing, invalid_action, idempotency_key_required, invalid_json
401 / 403unauthorized, not_a_reseller, api_not_enabled, ip_not_allowed, read_only_key
402insufficient_balance (top up the wallet in the bot)
404datacenter_not_found, location_not_found, plan_not_found, image_not_found, server_not_found
409plan_unavailable, order_in_progress, server_suspended, traffic_exhausted, reinstall_unavailable
422idempotency_conflict
429rate_limited, creation_limit, too_many_attempts (see Retry-After)
502 / 503provider_failed (nothing charged), rate_unavailable, api_disabled
Limits: 60 requests/minute per key (bursts of 20), 6 orders/minute.

Account

GET/v1/me

Wallet balance (toman and USD), reseller tier, discount and 30-day sales.

GET/v1/transactions?limit=50

Latest wallet transactions (max 200).

Catalog

GET/v1/datacenters

Datacenters you can order from, with the billing periods they offer.

GET/v1/datacenters/{datacenter}/locations

Locations in stock.

GET/v1/datacenters/{datacenter}/plans?location=…&billing=monthly

Plans with your price after your reseller discount (USD and toman) for one period. billing: hourly, weekly or monthly.

GET/v1/datacenters/{datacenter}/images?location=…

Operating system images.

POST/v1/quote

Price of one order without buying.

{"datacenter":"hetzner","location":"hel1","plan":"cpx12","billing":"monthly"}

Servers

POST/v1/servers

Order a server. Charges your wallet at your discount. Requires an Idempotency-Key header: retrying with the same key never orders twice. Returns 201 with the server (IP and password when the datacenter delivers instantly; otherwise poll GET /v1/servers/{id}).

curl -X POST https://api.greenvds.ir/v1/servers \
  -H "Authorization: Bearer gvk_…" -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-2026-0001" \
  -d '{"datacenter":"hetzner","location":"hel1","plan":"cpx12","image":"ubuntu-24.04","billing":"monthly"}'
GET/v1/servers

Your servers (active, pending, suspended…). Filter with ?status=.

GET/v1/servers/{id}?live=1

One server with IP, IPv6, root password and renewal price. live=1 also asks the datacenter for power state and traffic.

POST/v1/servers/{id}/power

Start, stop or reboot.

{"action":"reboot"}
POST/v1/servers/{id}/reinstall

Reinstall with another image (erases the disk). Returns the new password when it changes.

{"image":"debian-13"}
DELETE/v1/servers/{id}

Delete the server now. Some datacenters charge a small deletion fee (returned as feeToman).

Servers renew automatically from your wallet at your reseller discount; with too little balance they are suspended, then deleted after the grace period, exactly like in the bot.

Support

GET/v1/tickets

Your tickets.

POST/v1/tickets

Open a ticket.

{"subject":"Network issue","message":"…"}
GET/v1/tickets/{id}

A ticket with its messages.

POST/v1/tickets/{id}/messages

Reply to a ticket.

{"message":"…"}

Datacenters available through the API

Hetzner, Linode, LightNode, GreenNode, NordNode, CGI and Dataforest. Iran and 3HCloud are ordered in the bot.

Questions? Open a ticket in the bot or via POST /v1/tickets.