🌿 Green VPS Reseller API
v1 · Base URL https://api.greenvds.ir/v1 · JSON over HTTPS
این API مخصوص نمایندگان Green VPS است. کلید API را از ربات، بخش «🤝 نمایندگی ← 🔑 API و اتصال» بسازید. هر کاری که در ربات انجام میدهید (خرید سرور، روشن/خاموش، نصب مجدد، حذف، تیکت) از اینجا هم ممکن است و تخفیف نمایندگی شما خودکار اعمال میشود.
Authentication
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
{"data": …}. Error: {"error": {"code": "…", "message": "…"}} with an HTTP status.
| Status | Codes |
|---|---|
| 400 | missing_fields, invalid_billing, invalid_action, idempotency_key_required, invalid_json |
| 401 / 403 | unauthorized, not_a_reseller, api_not_enabled, ip_not_allowed, read_only_key |
| 402 | insufficient_balance (top up the wallet in the bot) |
| 404 | datacenter_not_found, location_not_found, plan_not_found, image_not_found, server_not_found |
| 409 | plan_unavailable, order_in_progress, server_suspended, traffic_exhausted, reinstall_unavailable |
| 422 | idempotency_conflict |
| 429 | rate_limited, creation_limit, too_many_attempts (see Retry-After) |
| 502 / 503 | provider_failed (nothing charged), rate_unavailable, api_disabled |
Account
/v1/meWallet balance (toman and USD), reseller tier, discount and 30-day sales.
/v1/transactions?limit=50Latest wallet transactions (max 200).
Catalog
/v1/datacentersDatacenters you can order from, with the billing periods they offer.
/v1/datacenters/{datacenter}/locationsLocations in stock.
/v1/datacenters/{datacenter}/plans?location=…&billing=monthlyPlans with your price after your reseller discount (USD and toman) for one period. billing: hourly, weekly or monthly.
/v1/datacenters/{datacenter}/images?location=…Operating system images.
/v1/quotePrice of one order without buying.
{"datacenter":"hetzner","location":"hel1","plan":"cpx12","billing":"monthly"}Servers
/v1/serversOrder 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"}'/v1/serversYour servers (active, pending, suspended…). Filter with ?status=.
/v1/servers/{id}?live=1One server with IP, IPv6, root password and renewal price. live=1 also asks the datacenter for power state and traffic.
/v1/servers/{id}/powerStart, stop or reboot.
{"action":"reboot"}/v1/servers/{id}/reinstallReinstall with another image (erases the disk). Returns the new password when it changes.
{"image":"debian-13"}/v1/servers/{id}Delete the server now. Some datacenters charge a small deletion fee (returned as feeToman).
Support
/v1/ticketsYour tickets.
/v1/ticketsOpen a ticket.
{"subject":"Network issue","message":"…"}/v1/tickets/{id}A ticket with its messages.
/v1/tickets/{id}/messagesReply to a ticket.
{"message":"…"}Datacenters available through the API
Questions? Open a ticket in the bot or via POST /v1/tickets.