API documents

Version 1.0.0 · Base address: https://api.mikropanel.ir/v1

فارسی

Guide

Start

Create a key in the panel: Settings → API access. Your account owner must switch API access on for you first. Keep the key on your own server. Never put it inside a mobile or web app: anyone holding it can sell and delete your services.

Request
curl https://api.mikropanel.ir/v1/me -H "Authorization: Bearer mp_live_..."

Sell a service in 5 calls

  • GET /v1/me/balance — your traffic credit, peer quota and plan credits.
  • GET /v1/routers — where you can create (can_create, l2tp_available).
  • GET /v1/plans — your credit plans.
  • POST /v1/peers — create it, with your order id as external_ref.
  • GET /v1/peers/{id}/config or /qr — hand it to your customer.
Request
curl -X POST https://api.mikropanel.ir/v1/peers \
  -H "Authorization: Bearer mp_live_..." -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-10231-create" \
  -d '{"name":"order10231","router_id":3,"traffic_bytes":32212254720,"days":30,"external_ref":"10231"}'

Units and time

  • Traffic is always whole bytes (1 GB here = 1073741824 bytes). null limit means unlimited.
  • Times are ISO 8601 with the server offset (+03:30). Send times with an offset.
  • Lists return data and next_cursor; pass it as cursor to get the next page.
  • To follow changes use GET /v1/peers?updated_since=.... Traffic counters are refreshed by the panel about once a minute (usage_updated_at).

Retries (Idempotency-Key)

Creating, renewing, adding traffic and adding L2TP need the header Idempotency-Key. Make one per operation (for example from your order id) and save it before calling.

  • Network error or timeout: send the same request with the same key. You get the first result, nothing is done twice (the answer has the header Idempotent-Replayed: true).
  • request_in_progress: wait and retry with the same key.
  • outcome_unknown: look the peer up (for example ?external_ref=) before using a new key.
  • A refused request (for example insufficient_credit) frees the key.

Limits

Without fixed IP addresses a key works from anywhere with the lower limits. If your server has a fixed address, add it in Settings → API access: then only those addresses can use your keys, and the limits are higher. Tiers as reads per minute | changes per minute | changes in flight | changes per day. Changes of one account are applied one after another: "in flight" is how many may be sent at the same time, the extra ones waiting up to 15 seconds for their turn (then server_busy; retry with the same Idempotency-Key).

  • Any address: 600 | 60 | 1 | 5000
  • Fixed addresses: 1200 | 120 | 3 | 20000

Your account owner may set other values; GET /v1/me shows yours. Every answer carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; on 429 or 503 wait for Retry-After seconds. 20 wrong keys in a minute block an address for the rest of that minute.

Errors

Every error is {"error": {"code", "message", "message_fa", "details", "request_id"}}. Decide by code, never by the message. Give request_id to support. After operation_failed, check the resource before trying again.

Agent types

  • Limited agents pay from a traffic wallet (one, or one per router), cannot choose unlimited traffic or time (a credit plan your account owner gave you may be unlimited) and renew at most 90 days at a time. Deleting a peer returns the unused traffic.
  • Deleting a client (L2TP) switches its WireGuard peer off and leaves it without limits. Delete that peer to get the unused traffic back, or renew it with new traffic and duration. DELETE /v1/peers/<built-in function id> on a peer with L2TP does both steps in one call.
  • Unlimited agents have no traffic wallet; they may send unlimited_traffic and unlimited_time.
  • Plan-only accounts must use plan_id. Peer limits, per router too, apply to everyone. No agent sets a speed per peer.

Examples and tools

  • A ready client in Python: GET /v1/examples/mikropanel.py (standard library only).
  • A ready client in PHP: GET /v1/examples/mikropanel.php (curl).
  • Postman collection of every endpoint: GET /v1/postman.json. Set the api_key variable.

Changes

  • 1.0.0: first release. Account, routers, plans, peers, L2TP clients and usage.

Endpoints

Every answer shown here was produced by the API itself on test data. Keys and passwords are placeholders.

Account

GETWho this key is, what it may do and its limits/v1/me

Key access: read read

Request
curl "https://api.mikropanel.ir/v1/me" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "account": {
    "id": 10,
    "username": "reseller1",
    "type": "agent",
    "mode": "limited",
    "creation_mode": "hybrid",
    "traffic_scope": "total",
    "peer_scope": "total",
    "shared_speed_limit_mbps": null,
    "expires_at": null
  },
  "features": {
    "wireguard": true,
    "l2tp": true,
    "custom_limits": true,
    "credit_plans": true,
    "unlimited_peers": false,
    "max_renew_days": 90
  },
  "key": {
    "id": 9,
    "name": "test key",
    "scopes": [
      "read",
      "peers:config",
      "peers:write"
    ],
    "expires_at": null
  },
  "limits": {
    "tier": "any_ip",
    "reads_per_minute": 600,
    "writes_per_minute": 60,
    "concurrent_writes": 1,
    "writes_per_day": 5000
  },
  "network": {
    "your_ip": "203.0.113.7",
    "allowed_ips": []
  },
  "server_time": "2026-11-30T01:45:04+03:30"
}
GETTraffic credit, peer quota and plan credits/v1/me/balance

Key access: read read

Request
curl "https://api.mikropanel.ir/v1/me/balance" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "traffic": {
    "unlimited": false,
    "scope": "total",
    "balance_bytes": 470640777560
  },
  "peers": {
    "limit": 50,
    "used": 4,
    "available": 46
  },
  "routers": [
    {
      "router_id": 1,
      "name": "Frankfurt-1",
      "traffic_balance_bytes": null,
      "peer_limit": null,
      "live_peers": 4,
      "peers": 4,
      "traffic_used_bytes": 11811160064
    },
    {
      "router_id": 2,
      "name": "router-r2",
      "traffic_balance_bytes": null,
      "peer_limit": null,
      "live_peers": 0,
      "peers": 0,
      "traffic_used_bytes": 0
    }
  ],
  "creation_mode": "hybrid",
  "plan_credits": [
    {
      "plan_id": 2,
      "name": "20 GB - 30 days - L2TP",
      "remaining_credits": 5,
      "unlimited_credits": false,
      "credits_expire_at": null
    },
    {
      "plan_id": 1,
      "name": "10 GB - 30 days",
      "remaining_credits": 4,
      "unlimited_credits": false,
      "credits_expire_at": null
    }
  ]
}
GETPeer counts and traffic sold/v1/me/stats

Key access: read read

Request
curl "https://api.mikropanel.ir/v1/me/stats" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "peers": {
    "total": 4,
    "active": 2,
    "online": 0
  },
  "traffic_sold_bytes": {
    "total": 42949672960,
    "today": 42949672960,
    "last_7_days": 42949672960,
    "last_30_days": 42949672960
  }
}

Routers

GETRouters assigned to you, with limits and availability/v1/routers

Key access: read read

Request
curl "https://api.mikropanel.ir/v1/routers" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "data": [
    {
      "id": 1,
      "name": "Frankfurt-1",
      "active": true,
      "last_test_status": "pending",
      "public_endpoint": "r1.vpn.example.com",
      "can_create": true,
      "unavailable_reason": null,
      "l2tp_available": true,
      "peers": 4,
      "live_peers": 4,
      "peer_limit": null,
      "traffic_used_bytes": 11811160064,
      "traffic_balance_bytes": null
    },
    {
      "id": 2,
      "name": "router-r2",
      "active": true,
      "last_test_status": "pending",
      "public_endpoint": "192.0.2.20",
      "can_create": true,
      "unavailable_reason": null,
      "l2tp_available": false,
      "peers": 0,
      "live_peers": 0,
      "peer_limit": null,
      "traffic_used_bytes": 0,
      "traffic_balance_bytes": null
    }
  ]
}
GETOne assigned router/v1/routers/{router_id}

Key access: read read

Request
curl "https://api.mikropanel.ir/v1/routers/1" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "router": {
    "id": 1,
    "name": "Frankfurt-1",
    "active": true,
    "last_test_status": "pending",
    "public_endpoint": "r1.vpn.example.com",
    "can_create": true,
    "unavailable_reason": null,
    "l2tp_available": true,
    "peers": 4,
    "live_peers": 4,
    "peer_limit": null,
    "traffic_used_bytes": 11811160064,
    "traffic_balance_bytes": null
  }
}

Plans

GETYour credit plans with remaining credits/v1/plans

Key access: read read

Request
curl "https://api.mikropanel.ir/v1/plans" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "creation_mode": "hybrid",
  "data": [
    {
      "id": 2,
      "name": "20 GB - 30 days - L2TP",
      "description": "",
      "traffic_limit_bytes": 21474836480,
      "unlimited_traffic": false,
      "days": 30,
      "unlimited_time": false,
      "speed_down_mbps": null,
      "speed_up_mbps": null,
      "starts_immediately_by_default": true,
      "protocols": [
        "wireguard",
        "l2tp"
      ],
      "router_id": null,
      "remaining_credits": 5,
      "unlimited_credits": false,
      "credits_expire_at": null,
      "can_create": true,
      "can_renew": true
    },
    {
      "id": 1,
      "name": "10 GB - 30 days",
      "description": "",
      "traffic_limit_bytes": 10737418240,
      "unlimited_traffic": false,
      "days": 30,
      "unlimited_time": false,
      "speed_down_mbps": null,
      "speed_up_mbps": null,
      "starts_immediately_by_default": true,
      "protocols": [
        "wireguard"
      ],
      "router_id": null,
      "remaining_credits": 4,
      "unlimited_credits": false,
      "credits_expire_at": null,
      "can_create": true,
      "can_renew": true
    }
  ]
}
GETOne credit plan/v1/plans/{plan_id}

Key access: read read

Request
curl "https://api.mikropanel.ir/v1/plans/2" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "plan": {
    "id": 2,
    "name": "20 GB - 30 days - L2TP",
    "description": "",
    "traffic_limit_bytes": 21474836480,
    "unlimited_traffic": false,
    "days": 30,
    "unlimited_time": false,
    "speed_down_mbps": null,
    "speed_up_mbps": null,
    "starts_immediately_by_default": true,
    "protocols": [
      "wireguard",
      "l2tp"
    ],
    "router_id": null,
    "remaining_credits": 5,
    "unlimited_credits": false,
    "credits_expire_at": null,
    "can_create": true,
    "can_renew": true
  }
}

Peers

GETList your peers, newest first/v1/peers

Key access: read read

Query parameters

NameTypeMeaning
limitintItems per page (default 50).
cursorintnext_cursor of the previous page.
statusstrOnly this status.Values: suspended | active | limit_reached | disabled_by_owner | not_started | pending_deletion
router_idintOnly this router.
namestrName contains this text.
external_refstrExactly this external_ref.
customer_telegram_idintExactly this Telegram id.
updated_sincedatetimeSettings or status changed at or after this time (traffic counters alone do not count).
Request
curl "https://api.mikropanel.ir/v1/peers?limit=2" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "data": [
    {
      "id": 3,
      "name": "order10233",
      "description": "",
      "external_ref": null,
      "customer_telegram_id": null,
      "router_id": 1,
      "router_name": "Frankfurt-1",
      "client_ip": "172.0.0.4/32",
      "status": "active",
      "status_reason": null,
      "online": false,
      "last_handshake_at": null,
      "traffic_limit_bytes": 21474836480,
      "traffic_used_bytes": 0,
      "traffic_remaining_bytes": 21474836480,
      "unlimited_traffic": false,
      "shown_as_unlimited": false,
      "days": 30,
      "expires_at": "2026-12-30T01:45:03+03:30",
      "unlimited_time": false,
      "start_on_first_connect": false,
      "waiting_for_first_connection": false,
      "activated_at": null,
      "plan_id": null,
      "plan_name": null,
      "protocols": [
        "wireguard",
        "l2tp"
      ],
      "client_id": 1,
      "group_id": null,
      "group_name": null,
      "missing_on_router": false,
      "created_at": "2026-11-30T01:45:02+03:30",
      "updated_at": "2026-11-30T01:45:02+03:30",
      "usage_updated_at": null
    },
    {
      "id": 2,
      "name": "order10232",
      "description": "",
      "external_ref": null,
      "customer_telegram_id": null,
      "router_id": 1,
      "router_name": "Frankfurt-1",
      "client_ip": "172.0.0.3/32",
      "status": "active",
      "status_reason": null,
      "online": false,
      "last_handshake_at": null,
      "traffic_limit_bytes": 10737418240,
      "traffic_used_bytes": 0,
      "traffic_remaining_bytes": 10737418240,
      "unlimited_traffic": false,
      "shown_as_unlimited": false,
      "days": 30,
      "expires_at": "2026-12-30T01:45:02+03:30",
      "unlimited_time": false,
      "start_on_first_connect": false,
      "waiting_for_first_connection": false,
      "activated_at": null,
      "plan_id": 1,
      "plan_name": "10 GB - 30 days",
      "protocols": [
        "wireguard"
      ],
      "client_id": null,
      "group_id": null,
      "group_name": null,
      "missing_on_router": false,
      "created_at": "2026-11-30T01:45:02+03:30",
      "updated_at": "2026-11-30T01:45:02+03:30",
      "usage_updated_at": null
    }
  ],
  "next_cursor": 2
}
POSTCreate a peer (WireGuard, optionally with L2TP)/v1/peers

Give plan_id, or your own traffic and duration. Unlimited traffic or time must be asked for explicitly and only unlimited agents may do it. With protocols ["wireguard","l2tp"] both are made, or neither. The answer includes the config only when the key has the peers:config scope.

Key access: create and change peers:write · needs the Idempotency-Key header

JSON body

NameTypeMeaning
namerequiredstr3-30 characters: letters, digits, - and _. Unique per router.
router_idintNeeded when you have several routers and the plan does not fix one.
plan_idintUse a credit plan: it decides every limit.
start_nowboolWith a plan: start the clock now instead of at the first connection.
traffic_bytesintTraffic limit in bytes.
unlimited_trafficboolNo traffic limit (unlimited agents only).
daysintDuration in days.
unlimited_timeboolNo expiry (unlimited agents only).
expires_atdatetimeExact expiry instead of (or besides) days.
start_on_first_connectboolCount the days from the first connection.
show_as_unlimitedboolLimited agents: show the customer "unlimited" (the limit still applies).
protocolsstrlist["wireguard"] (default) or ["wireguard","l2tp"]. A plan decides this itself.
descriptionstrYour note.
external_refstrYour own id for this peer (order id). Unique among your peers.
customer_telegram_idintTelegram id of your customer.
Request
curl -X POST "https://api.mikropanel.ir/v1/peers" \
  -H "Authorization: Bearer mp_live_YOUR_KEY" \
  -H "Idempotency-Key: order-10231-create" \
  -H "Content-Type: application/json" \
  -d '{"name": "order10231", "router_id": 1, "traffic_bytes": 32212254720, "days": 30, "external_ref": "10231"}'
Response 201
{
  "peer": {
    "id": 1,
    "name": "order10231",
    "description": "",
    "external_ref": "10231",
    "customer_telegram_id": null,
    "router_id": 1,
    "router_name": "Frankfurt-1",
    "client_ip": "172.0.0.2/32",
    "status": "active",
    "status_reason": null,
    "online": false,
    "last_handshake_at": null,
    "traffic_limit_bytes": 32212254720,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 32212254720,
    "unlimited_traffic": false,
    "shown_as_unlimited": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:02+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "plan_id": null,
    "plan_name": null,
    "protocols": [
      "wireguard"
    ],
    "client_id": null,
    "group_id": null,
    "group_name": null,
    "missing_on_router": false,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:02+03:30",
    "usage_updated_at": null,
    "gift_code": null,
    "public_page_url": "https://mpeer.ir/52774d0b-bc03-459d-bc5c-45a32e506cda"
  },
  "config": {
    "filename": "order10231.conf",
    "config": "[Interface]\nPrivateKey = CLIENT_PRIVATE_KEY\nAddress = 172.0.0.2/32\nDNS = 1.1.1.1, 8.8.8.8\n\n[Peer]\nPublicKey = kO1Vw0Qq0dS7o8Yv9m1m0m6i7l4uY5o2m3q4r5s6t7U=\nEndpoint = r1.vpn.example.com:61234\nAllowedIPs = 0.0.0.0/0"
  }
}
DELETEDelete a peer/v1/peers/{peer_id}

A limited agent gets the unused traffic back as the panel does. A peer with L2TP is deleted together with its client.

Key access: create and change peers:write

Request
curl -X DELETE "https://api.mikropanel.ir/v1/peers/1" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "deleted": true,
  "peer_id": 1,
  "client_deleted": null,
  "refunded_bytes": 37580963840
}
GETOne peer with its gift code and public page link/v1/peers/{peer_id}

Key access: read read

Request
curl "https://api.mikropanel.ir/v1/peers/1" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "peer": {
    "id": 1,
    "name": "order10231",
    "description": "",
    "external_ref": "10231",
    "customer_telegram_id": null,
    "router_id": 1,
    "router_name": "Frankfurt-1",
    "client_ip": "172.0.0.2/32",
    "status": "active",
    "status_reason": null,
    "online": false,
    "last_handshake_at": null,
    "traffic_limit_bytes": 32212254720,
    "traffic_used_bytes": 1805625000,
    "traffic_remaining_bytes": 30406629720,
    "unlimited_traffic": false,
    "shown_as_unlimited": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:02+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "plan_id": null,
    "plan_name": null,
    "protocols": [
      "wireguard"
    ],
    "client_id": null,
    "group_id": null,
    "group_name": null,
    "missing_on_router": false,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:02+03:30",
    "usage_updated_at": null,
    "gift_code": null,
    "public_page_url": "https://mpeer.ir/52774d0b-bc03-459d-bc5c-45a32e506cda"
  }
}
PATCHChange name, description or your own references/v1/peers/{peer_id}

Key access: create and change peers:write

JSON body

NameTypeMeaning
namestrNew name (also renamed on the router).
descriptionstrNew note; "" clears it.
external_refstrYour own id; "" clears it.
customer_telegram_idintTelegram id of your customer; 0 clears it.
Request
curl -X PATCH "https://api.mikropanel.ir/v1/peers/1" \
  -H "Authorization: Bearer mp_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"description": "phone", "customer_telegram_id": 123456789}'
Response 200
{
  "peer": {
    "id": 1,
    "name": "order10231",
    "description": "phone",
    "external_ref": "10231",
    "customer_telegram_id": 123456789,
    "router_id": 1,
    "router_name": "Frankfurt-1",
    "client_ip": "172.0.0.2/32",
    "status": "active",
    "status_reason": null,
    "online": false,
    "last_handshake_at": null,
    "traffic_limit_bytes": 32212254720,
    "traffic_used_bytes": 1805625000,
    "traffic_remaining_bytes": 30406629720,
    "unlimited_traffic": false,
    "shown_as_unlimited": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:02+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "plan_id": null,
    "plan_name": null,
    "protocols": [
      "wireguard"
    ],
    "client_id": null,
    "group_id": null,
    "group_name": null,
    "missing_on_router": false,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:03+03:30",
    "usage_updated_at": null,
    "gift_code": null,
    "public_page_url": "https://mpeer.ir/52774d0b-bc03-459d-bc5c-45a32e506cda"
  }
}
GETWireGuard configuration/v1/peers/{peer_id}/config

Key access: see configurations and passwords peers:config

Query parameters

NameTypeMeaning
formatstrjson (default) or file.Values: json | file
use_domainboolUse the router's current domain as endpoint (default true).
Request
curl "https://api.mikropanel.ir/v1/peers/1/config" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "filename": "order10231.conf",
  "config": "[Interface]\nPrivateKey = CLIENT_PRIVATE_KEY\nAddress = 172.0.0.2/32\nDNS = 1.1.1.1, 8.8.8.8\n\n[Peer]\nPublicKey = kO1Vw0Qq0dS7o8Yv9m1m0m6i7l4uY5o2m3q4r5s6t7U=\nEndpoint = r1.vpn.example.com:61234\nAllowedIPs = 0.0.0.0/0"
}
GETQR code of the configuration (PNG)/v1/peers/{peer_id}/qr

Key access: see configurations and passwords peers:config

Query parameters

NameTypeMeaning
use_domainboolUse the router's current domain as endpoint (default true).
Request
curl "https://api.mikropanel.ir/v1/peers/1/qr" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
A PNG image (binary body).
POSTRenew a peer with a plan or your own limits/v1/peers/{peer_id}/renew

mode "set" (default) replaces the limits, "add" adds to them. Limited agents: at most 90 days; lowering the traffic returns nothing at once, the unused amount comes back on delete or reset. A peer that also has L2TP is renewed as a whole (set only, new traffic and duration, usage restarts). The answer includes the config only when the key has the peers:config scope.

Key access: create and change peers:write · needs the Idempotency-Key header

JSON body

NameTypeMeaning
plan_idintUse a credit plan: it decides every limit.
start_nowboolWith a plan: start the clock now instead of at the first connection.
traffic_bytesintTraffic limit in bytes.
unlimited_trafficboolNo traffic limit (unlimited agents only).
daysintDuration in days.
unlimited_timeboolNo expiry (unlimited agents only).
expires_atdatetimeExact new expiry.
modestrset or add.Values: set | add
reset_usageboolStart counting usage from zero (set mode; say the new traffic too).
start_on_first_connectboolOnly for a peer with L2TP renewed with your own limits.
Request
curl -X POST "https://api.mikropanel.ir/v1/peers/1/renew" \
  -H "Authorization: Bearer mp_live_YOUR_KEY" \
  -H "Idempotency-Key: order-10250-renew" \
  -H "Content-Type: application/json" \
  -d '{"traffic_bytes": 32212254720, "days": 30, "reset_usage": true}'
Response 200
{
  "peer": {
    "id": 1,
    "name": "order10231",
    "description": "phone",
    "external_ref": "10231",
    "customer_telegram_id": 123456789,
    "router_id": 1,
    "router_name": "Frankfurt-1",
    "client_ip": "172.0.0.2/32",
    "status": "active",
    "status_reason": null,
    "online": false,
    "last_handshake_at": null,
    "traffic_limit_bytes": 32212254720,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 32212254720,
    "unlimited_traffic": false,
    "shown_as_unlimited": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:03+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "plan_id": null,
    "plan_name": null,
    "protocols": [
      "wireguard"
    ],
    "client_id": null,
    "group_id": null,
    "group_name": null,
    "missing_on_router": false,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:03+03:30",
    "usage_updated_at": null,
    "gift_code": null,
    "public_page_url": "https://mpeer.ir/52774d0b-bc03-459d-bc5c-45a32e506cda"
  },
  "config": {
    "filename": "order10231.conf",
    "config": "[Interface]\nPrivateKey = CLIENT_PRIVATE_KEY\nAddress = 172.0.0.2/32\nDNS = 1.1.1.1, 8.8.8.8\n\n[Peer]\nPublicKey = kO1Vw0Qq0dS7o8Yv9m1m0m6i7l4uY5o2m3q4r5s6t7U=\nEndpoint = r1.vpn.example.com:61234\nAllowedIPs = 0.0.0.0/0"
  },
  "router_updated": true
}
POSTSuspend a peer/v1/peers/{peer_id}/suspend

Key access: create and change peers:write

Request
curl -X POST "https://api.mikropanel.ir/v1/peers/1/suspend" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "peer": {
    "id": 1,
    "name": "order10231",
    "description": "phone",
    "external_ref": "10231",
    "customer_telegram_id": 123456789,
    "router_id": 1,
    "router_name": "Frankfurt-1",
    "client_ip": "172.0.0.2/32",
    "status": "suspended",
    "status_reason": "manual_suspension",
    "online": false,
    "last_handshake_at": null,
    "traffic_limit_bytes": 37580963840,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 37580963840,
    "unlimited_traffic": false,
    "shown_as_unlimited": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:03+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "plan_id": null,
    "plan_name": null,
    "protocols": [
      "wireguard"
    ],
    "client_id": null,
    "group_id": null,
    "group_name": null,
    "missing_on_router": false,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:03+03:30",
    "usage_updated_at": null,
    "gift_code": null,
    "public_page_url": "https://mpeer.ir/52774d0b-bc03-459d-bc5c-45a32e506cda"
  },
  "router_updated": true
}
POSTLift a suspension/v1/peers/{peer_id}/unsuspend

Refused with renew_required when the traffic or time is used up.

Key access: create and change peers:write

Request
curl -X POST "https://api.mikropanel.ir/v1/peers/1/unsuspend" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "peer": {
    "id": 1,
    "name": "order10231",
    "description": "phone",
    "external_ref": "10231",
    "customer_telegram_id": 123456789,
    "router_id": 1,
    "router_name": "Frankfurt-1",
    "client_ip": "172.0.0.2/32",
    "status": "active",
    "status_reason": null,
    "online": false,
    "last_handshake_at": null,
    "traffic_limit_bytes": 37580963840,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 37580963840,
    "unlimited_traffic": false,
    "shown_as_unlimited": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:03+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "plan_id": null,
    "plan_name": null,
    "protocols": [
      "wireguard"
    ],
    "client_id": null,
    "group_id": null,
    "group_name": null,
    "missing_on_router": false,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:03+03:30",
    "usage_updated_at": null,
    "gift_code": null,
    "public_page_url": "https://mpeer.ir/52774d0b-bc03-459d-bc5c-45a32e506cda"
  },
  "router_updated": true
}

L2TP clients

GETList your clients, newest first/v1/clients

Key access: read read

Query parameters

NameTypeMeaning
limitintItems per page (default 50).
cursorintnext_cursor of the previous page.
statusstrOnly this status.Values: inactive | active | limit_reached | suspended | not_started
router_idintOnly this router.
namestrName contains this text.
updated_sincedatetimeChanged at or after this time.
Request
curl "https://api.mikropanel.ir/v1/clients?limit=2" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "data": [
    {
      "id": 1,
      "name": "order10233",
      "description": "",
      "router_id": 1,
      "status": "active",
      "status_reason": null,
      "protocols": [
        "wireguard",
        "l2tp"
      ],
      "peer_ids": [
        3
      ],
      "plan_id": null,
      "traffic_limit_bytes": 21474836480,
      "traffic_used_bytes": 0,
      "traffic_remaining_bytes": 21474836480,
      "unlimited_traffic": false,
      "days": 30,
      "expires_at": "2026-12-30T01:45:03+03:30",
      "unlimited_time": false,
      "start_on_first_connect": false,
      "waiting_for_first_connection": false,
      "activated_at": null,
      "created_at": "2026-11-30T01:45:02+03:30",
      "updated_at": "2026-11-30T01:45:02+03:30"
    }
  ],
  "next_cursor": null
}
POSTTurn one of your peers into a client/v1/clients/from-peer

The client takes over the peer's limit, expiry and usage; L2TP is added. A peer made from a plan can only get the protocols of that plan.

Key access: create and change peers:write · needs the Idempotency-Key header

JSON body

NameTypeMeaning
peer_idrequiredintYour standalone peer.
protocolsstrlistDefault ["wireguard","l2tp"].
Request
curl -X POST "https://api.mikropanel.ir/v1/clients/from-peer" \
  -H "Authorization: Bearer mp_live_YOUR_KEY" \
  -H "Idempotency-Key: order-10262-client" \
  -H "Content-Type: application/json" \
  -d '{"peer_id": 4, "protocols": ["wireguard"]}'
Response 201
{
  "client": {
    "id": 2,
    "name": "order10234",
    "description": "",
    "router_id": 1,
    "status": "active",
    "status_reason": null,
    "protocols": [
      "wireguard"
    ],
    "peer_ids": [
      4
    ],
    "plan_id": null,
    "traffic_limit_bytes": 5368709120,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 5368709120,
    "unlimited_traffic": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:04+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "created_at": "2026-11-30T01:45:04+03:30",
    "updated_at": "2026-11-30T01:45:04+03:30",
    "accounts": [
      {
        "protocol": "wireguard",
        "account_id": 4,
        "name": "order10234",
        "traffic_used_bytes": 0,
        "online": null,
        "router_state": null
      }
    ]
  },
  "l2tp": null
}
DELETEDelete a client/v1/clients/{client_id}

The L2TP account is removed. The WireGuard peer stays, switched off; delete it with DELETE /peers/{id} (a limited agent is refunded then).

Key access: create and change peers:write

Request
curl -X DELETE "https://api.mikropanel.ir/v1/clients/2" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "deleted": true,
  "client_id": 2,
  "traffic_used_bytes": 0,
  "released_peer_ids": [
    4
  ]
}
GETOne client with its accounts/v1/clients/{client_id}

Key access: read read

Request
curl "https://api.mikropanel.ir/v1/clients/1" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "client": {
    "id": 1,
    "name": "order10233",
    "description": "",
    "router_id": 1,
    "status": "active",
    "status_reason": null,
    "protocols": [
      "wireguard",
      "l2tp"
    ],
    "peer_ids": [
      3
    ],
    "plan_id": null,
    "traffic_limit_bytes": 21474836480,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 21474836480,
    "unlimited_traffic": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:03+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:02+03:30",
    "accounts": [
      {
        "protocol": "wireguard",
        "account_id": 3,
        "name": "order10233",
        "traffic_used_bytes": 0,
        "online": null,
        "router_state": null
      },
      {
        "protocol": "l2tp",
        "account_id": 1,
        "name": "order10233",
        "traffic_used_bytes": 0,
        "online": false,
        "router_state": "absent"
      }
    ]
  }
}
POSTRaise a client's traffic limit/v1/clients/{client_id}/add-traffic

A limited agent pays the added traffic from its wallet.

Key access: create and change peers:write · needs the Idempotency-Key header

JSON body

NameTypeMeaning
traffic_bytesrequiredintBytes to add.
Request
curl -X POST "https://api.mikropanel.ir/v1/clients/1/add-traffic" \
  -H "Authorization: Bearer mp_live_YOUR_KEY" \
  -H "Idempotency-Key: order-10260-traffic" \
  -H "Content-Type: application/json" \
  -d '{"traffic_bytes": 5368709120}'
Response 200
{
  "client": {
    "id": 1,
    "name": "order10233",
    "description": "",
    "router_id": 1,
    "status": "active",
    "status_reason": null,
    "protocols": [
      "wireguard",
      "l2tp"
    ],
    "peer_ids": [
      3
    ],
    "plan_id": null,
    "traffic_limit_bytes": 26843545600,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 26843545600,
    "unlimited_traffic": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:03+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:03+03:30",
    "accounts": [
      {
        "protocol": "wireguard",
        "account_id": 3,
        "name": "order10233",
        "traffic_used_bytes": 0,
        "online": null,
        "router_state": null
      },
      {
        "protocol": "l2tp",
        "account_id": 1,
        "name": "order10233",
        "traffic_used_bytes": 0,
        "online": false,
        "router_state": "absent"
      }
    ]
  }
}
GETL2TP login of a client/v1/clients/{client_id}/credentials

Key access: see configurations and passwords peers:config

Request
curl "https://api.mikropanel.ir/v1/clients/1/credentials" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "l2tp": {
    "server": "l2tp.vpn.example.com",
    "username": "order10233",
    "password": "L2TP_PASSWORD",
    "ipsec_secret": "IPSEC_SECRET",
    "ipsec_mode": "required",
    "remote_address": "10.90.0.2"
  }
}
POSTDisable a client (all protocols)/v1/clients/{client_id}/disable

Key access: create and change peers:write

Request
curl -X POST "https://api.mikropanel.ir/v1/clients/1/disable" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "client": {
    "id": 1,
    "name": "order10233",
    "description": "",
    "router_id": 1,
    "status": "suspended",
    "status_reason": "disabled_by_agent",
    "protocols": [
      "wireguard",
      "l2tp"
    ],
    "peer_ids": [
      3
    ],
    "plan_id": null,
    "traffic_limit_bytes": 21474836480,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 21474836480,
    "unlimited_traffic": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:04+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:03+03:30",
    "accounts": [
      {
        "protocol": "wireguard",
        "account_id": 3,
        "name": "order10233",
        "traffic_used_bytes": 0,
        "online": null,
        "router_state": null
      },
      {
        "protocol": "l2tp",
        "account_id": 1,
        "name": "order10233",
        "traffic_used_bytes": 0,
        "online": false,
        "router_state": "absent"
      }
    ]
  }
}
POSTEnable a client/v1/clients/{client_id}/enable

Refused with renew_required when the traffic or time is used up.

Key access: create and change peers:write

Request
curl -X POST "https://api.mikropanel.ir/v1/clients/1/enable" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "client": {
    "id": 1,
    "name": "order10233",
    "description": "",
    "router_id": 1,
    "status": "active",
    "status_reason": null,
    "protocols": [
      "wireguard",
      "l2tp"
    ],
    "peer_ids": [
      3
    ],
    "plan_id": null,
    "traffic_limit_bytes": 21474836480,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 21474836480,
    "unlimited_traffic": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:04+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:03+03:30",
    "accounts": [
      {
        "protocol": "wireguard",
        "account_id": 3,
        "name": "order10233",
        "traffic_used_bytes": 0,
        "online": null,
        "router_state": null
      },
      {
        "protocol": "l2tp",
        "account_id": 1,
        "name": "order10233",
        "traffic_used_bytes": 0,
        "online": false,
        "router_state": "absent"
      }
    ]
  }
}
POSTAdd L2TP to a client/v1/clients/{client_id}/l2tp

Key access: create and change peers:write · needs the Idempotency-Key header

Request
curl -X POST "https://api.mikropanel.ir/v1/clients/2/l2tp" \
  -H "Authorization: Bearer mp_live_YOUR_KEY" \
  -H "Idempotency-Key: order-10263-l2tp"
Response 201
{
  "client": {
    "id": 2,
    "name": "order10234",
    "description": "",
    "router_id": 1,
    "status": "active",
    "status_reason": null,
    "protocols": [
      "wireguard",
      "l2tp"
    ],
    "peer_ids": [
      4
    ],
    "plan_id": null,
    "traffic_limit_bytes": 5368709120,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 5368709120,
    "unlimited_traffic": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:04+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "created_at": "2026-11-30T01:45:04+03:30",
    "updated_at": "2026-11-30T01:45:04+03:30",
    "accounts": [
      {
        "protocol": "wireguard",
        "account_id": 4,
        "name": "order10234",
        "traffic_used_bytes": 0,
        "online": null,
        "router_state": null
      },
      {
        "protocol": "l2tp",
        "account_id": 2,
        "name": "order10234",
        "traffic_used_bytes": 0,
        "online": false,
        "router_state": "absent"
      }
    ]
  },
  "l2tp": {
    "server": "l2tp.vpn.example.com",
    "username": "order10234",
    "password": "L2TP_PASSWORD",
    "ipsec_secret": "IPSEC_SECRET",
    "ipsec_mode": "required",
    "remote_address": "10.90.0.3"
  }
}
POSTStart a new period for a client/v1/clients/{client_id}/renew

Give plan_id, or both traffic (or unlimited_traffic) and days (or unlimited_time). Usage restarts. Limited agents: at most 90 days.

Key access: create and change peers:write · needs the Idempotency-Key header

JSON body

NameTypeMeaning
plan_idintUse a credit plan: it decides every limit.
start_nowboolWith a plan: start the clock now instead of at the first connection.
traffic_bytesintTraffic limit in bytes.
unlimited_trafficboolNo traffic limit (unlimited agents only).
daysintDuration in days.
unlimited_timeboolNo expiry (unlimited agents only).
start_on_first_connectboolCount the days from the first connection.
Request
curl -X POST "https://api.mikropanel.ir/v1/clients/1/renew" \
  -H "Authorization: Bearer mp_live_YOUR_KEY" \
  -H "Idempotency-Key: order-10261-renew" \
  -H "Content-Type: application/json" \
  -d '{"traffic_bytes": 21474836480, "days": 30}'
Response 200
{
  "client": {
    "id": 1,
    "name": "order10233",
    "description": "",
    "router_id": 1,
    "status": "active",
    "status_reason": null,
    "protocols": [
      "wireguard",
      "l2tp"
    ],
    "peer_ids": [
      3
    ],
    "plan_id": null,
    "traffic_limit_bytes": 21474836480,
    "traffic_used_bytes": 0,
    "traffic_remaining_bytes": 21474836480,
    "unlimited_traffic": false,
    "days": 30,
    "expires_at": "2026-12-30T01:45:04+03:30",
    "unlimited_time": false,
    "start_on_first_connect": false,
    "waiting_for_first_connection": false,
    "activated_at": null,
    "created_at": "2026-11-30T01:45:02+03:30",
    "updated_at": "2026-11-30T01:45:03+03:30",
    "accounts": [
      {
        "protocol": "wireguard",
        "account_id": 3,
        "name": "order10233",
        "traffic_used_bytes": 0,
        "online": null,
        "router_state": null
      },
      {
        "protocol": "l2tp",
        "account_id": 1,
        "name": "order10233",
        "traffic_used_bytes": 0,
        "online": false,
        "router_state": "absent"
      }
    ]
  }
}
GETRouters where you can sell L2TP/v1/l2tp-servers

Key access: read read

Request
curl "https://api.mikropanel.ir/v1/l2tp-servers" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "data": [
    {
      "router_id": 1,
      "name": "Frankfurt-1",
      "server": "l2tp.vpn.example.com"
    }
  ]
}

Usage

GETDaily or hourly traffic of one peer/v1/peers/{peer_id}/usage

A day range covers at most 366 days. L2TP traffic has totals only (see the client).

Key access: read read

Query parameters

NameTypeMeaning
intervalstrday (default) or hour.Values: day | hour
fromdateinterval=day: first day (default 29 days before "to").
todateinterval=day: last day (default today).
datedateinterval=hour: the day (default today).
Request
curl "https://api.mikropanel.ir/v1/peers/1/usage?from=2026-11-28&to=2026-11-30" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "peer_id": 1,
  "interval": "day",
  "from": "2026-11-28",
  "to": "2026-11-30",
  "total": {
    "rx_bytes": 1605000000,
    "tx_bytes": 200625000,
    "total_bytes": 1805625000
  },
  "points": [
    {
      "date": "2026-11-28",
      "rx_bytes": 410000000,
      "tx_bytes": 51250000,
      "total_bytes": 461250000
    },
    {
      "date": "2026-11-29",
      "rx_bytes": 980000000,
      "tx_bytes": 122500000,
      "total_bytes": 1102500000
    },
    {
      "date": "2026-11-30",
      "rx_bytes": 215000000,
      "tx_bytes": 26875000,
      "total_bytes": 241875000
    }
  ]
}
GETDaily or hourly traffic of all your peers/v1/usage

Key access: read read

Query parameters

NameTypeMeaning
intervalstrday (default) or hour.Values: day | hour
fromdateinterval=day: first day (default 29 days before "to").
todateinterval=day: last day (default today).
datedateinterval=hour: the day (default today).
Request
curl "https://api.mikropanel.ir/v1/usage?from=2026-11-28&to=2026-11-30" \
  -H "Authorization: Bearer mp_live_YOUR_KEY"
Response 200
{
  "interval": "day",
  "from": "2026-11-28",
  "to": "2026-11-30",
  "total": {
    "rx_bytes": 1605000000,
    "tx_bytes": 200625000,
    "total_bytes": 1805625000
  },
  "points": [
    {
      "date": "2026-11-28",
      "rx_bytes": 410000000,
      "tx_bytes": 51250000,
      "total_bytes": 461250000
    },
    {
      "date": "2026-11-29",
      "rx_bytes": 980000000,
      "tx_bytes": 122500000,
      "total_bytes": 1102500000
    },
    {
      "date": "2026-11-30",
      "rx_bytes": 215000000,
      "tx_bytes": 26875000,
      "total_bytes": 241875000
    }
  ]
}

Service

GETThis reference (HTML)/v1/docs

No key needed

Request
curl "https://api.mikropanel.ir/v1/docs"
Response 200
An HTML page.
GETExample client in PHP/v1/examples/mikropanel.php

No key needed

Request
curl "https://api.mikropanel.ir/v1/examples/mikropanel.php"
Response 200
A PHP source file.
GETExample client in Python/v1/examples/mikropanel.py

No key needed

Request
curl "https://api.mikropanel.ir/v1/examples/mikropanel.py"
Response 200
A Python source file.
GETIs the API up and can it reach its database/v1/health

No key needed

Request
curl "https://api.mikropanel.ir/v1/health"
Response 200
{
  "status": "ok",
  "database": true,
  "version": "1.0.0"
}
GETOpenAPI 3.1 description/v1/openapi.json

No key needed

Request
curl "https://api.mikropanel.ir/v1/openapi.json"
Response 200
A JSON file (OpenAPI 3.1).
GETPostman collection of every endpoint/v1/postman.json

No key needed

Request
curl "https://api.mikropanel.ir/v1/postman.json"
Response 200
A JSON file (Postman collection).

Subscription (customer apps)

Your customer app reads the configuration and the traffic and time left from these addresses. No API key: the code or UUID is the secret, because the answer holds the private key. A web page on another domain cannot call them.

Addresses
GET https://mpeer.ir/giftcode/{code}
GET https://mpeer.ir/config/{uuid}
Request
curl "https://mpeer.ir/giftcode/K7M2PQ9X"
Response 200
{
  "client_config": "[Interface]\nPrivateKey = CLIENT_PRIVATE_KEY\nAddress = 172.0.0.4/32\nDNS = 1.1.1.1, 8.8.8.8\n\n[Peer]\nPublicKey = kO1Vw0Qq0dS7o8Yv9m1m0m6i7l4uY5o2m3q4r5s6t7U=\nEndpoint = r1.vpn.example.com:61234\nAllowedIPs = 0.0.0.0/0",
  "peer_name": "order10233",
  "subscription": {
    "days_remaining": 30,
    "days_total": 30,
    "expires_at": "2026-12-30T01:45:04+03:30",
    "seconds_remaining": 2591997,
    "shared_between_devices": false,
    "status": "active",
    "traffic_limit_bytes": 21474836480,
    "traffic_remaining_bytes": 18253611008,
    "traffic_used_bytes": 3221225472,
    "unlimited_time": false,
    "unlimited_traffic": false,
    "usable": true,
    "usage_updated_at": null,
    "waiting_for_first_connection": false
  },
  "success": true,
  "uuid": "4077a464-06ff-4f84-8bd7-de0982b83585"
}

Fields of subscription

NameTypeMeaning
statusstringState of the subscription; see the table of values.
usablebooleanThe customer can connect.
unlimited_trafficbooleanThere is no traffic limit to show.
traffic_limit_bytesinteger | nullTraffic limit; null when unlimited.
traffic_used_bytesintegerUsed in the current period (download and upload).
traffic_remaining_bytesinteger | nullTraffic left, never below 0; null when unlimited.
unlimited_timebooleanIt never expires.
days_totalinteger | nullLength of the subscription in days.
days_remaininginteger | nullDays left, rounded up (5 hours left is 1); 0 means expired. The panel's public client page rounds down.
seconds_remaininginteger | nullFor a countdown on the last day.
expires_atstring | nullISO 8601 with offset; null when unlimited or not started.
waiting_for_first_connectionbooleanThe days start at the first connection.
shared_between_devicesbooleanThe figures belong to one quota shared by several devices.
usage_updated_atstring | nullWhen the traffic was last read from the server.

Values of status

statususableMeaning
activetrueWorking.
not_startedtrueReady; time starts at the first connection.
expiredfalseThe time is over.
out_of_trafficfalseThe traffic is used up.
suspendedfalseSwitched off by the seller.
inactivefalseSwitched off for a used-up limit that has not been cleared.

Errors

HTTPMeaning
400The code is not 4 to 12 letters or digits.
404No client has this code or UUID (deleted, or the code was replaced), or it has no configuration.
429Code address only: 30 different unknown codes in 10 minutes. Correct codes are refused too until Retry-After passes.
500Panel error. Retry later.

Ask every few minutes; traffic is refreshed about once a minute. A server that asks for many customers should use the UUID address, which has no lookup limit. subscription can be null: the configuration is still valid.

Error codes

CodeHTTPMeaning
account_inactive403The account is suspended or expired.
add_to_unlimited409There is no limit to add to: this is already unlimited.
agent_needs_wireguard403Agents make L2TP services on a WireGuard peer.
already_member409The peer already belongs to a client.
api_disabled403API access is not enabled for this account.
bad_content_type415Send the body as application/json.
bad_json400The request body is not valid JSON.
bad_protocols422protocols must name wireguard and/or l2tp.
bad_value422A field has an invalid value.
billing_unsupported409This plan cannot be used for this operation.
body_too_large413The request body is too large.
client_renew_unsupported409A service with L2TP only supports a full renewal.
clients_disabled404L2TP clients are not enabled on this panel.
clients_not_allowed403L2TP clients are not enabled for this account.
config_unavailable404No configuration is stored for this peer.
conflicting_fields422These fields cannot be used together.
credits_expired409Your credit for this plan has expired.
daily_limit_reached429The daily limit of changes is used up.
database_unavailable503The database is not available.
duration_required422Give days, expires_at or unlimited_time.
encryption_unavailable503Secret storage is not available on this server.
expiry_in_past422The expiry date must be in the future.
external_ref_taken409Another of your peers already has this external_ref.
group_not_supported409This peer is part of a multi-device group. Manage it in the dashboard for now.
https_required403Use HTTPS.
idempotency_key_required422Send an Idempotency-Key header (8 to 128 characters).
idempotency_key_reused422This Idempotency-Key was used for a different request.
in_client409This peer belongs to a client; manage it through /clients.
in_group409The peer is part of a multi-device group.
insufficient_credit409Not enough traffic credit.
insufficient_credits409Not enough credits for this plan.
insufficient_scope403This key does not have the needed scope.
internal_error500Unexpected server error. Quote the request id to support.
invalid_api_key401The API key is not valid, expired or revoked.
invalid_name422The name must be 3 to 30 characters: a-z, A-Z, 0-9, "-" and "_".
invalid_plan422The plan id is not valid.
ip_not_allowed403This IP address is not in the allowed list of the account.
l2tp_failed502L2TP could not be added.
l2tp_not_allowed403L2TP is not allowed on this router for your account.
l2tp_unavailable409L2TP is not available on this router.
member_not_found404Peer not found.
method_not_allowed405This method is not allowed here.
missing_api_key401Send your key as "Authorization: Bearer <key>".
missing_field422A required field is missing.
name_taken409This name is already used on this router.
no_agent_profile403The account has no agent profile.
no_credits409You have no credit for this plan.
no_free_ip409No free address is left on this router.
no_l2tp404This client has no L2TP account.
no_router_assigned409No router is assigned to this account.
no_server409This client has no router.
not_agent403The API is for agent accounts.
not_found404Not found.
nothing_to_renew422The renewal changes nothing.
operation_failed502The operation failed. Check the resource before retrying; quote the request id to support.
out_of_range422A value is outside the allowed range.
outcome_unknown409The first request with this key did not finish cleanly. Check the resource (for example by external_ref) before sending a new key.
peer_limit_reached409Your peer limit is used up.
peer_locked409This peer is locked by the account owner or by a package limit.
peer_manager_unavailable503Peer management is not available right now.
peer_not_attachable409This peer cannot become a client in its current state.
plan_conversion_needs_limits422Renewing a plan peer with custom limits needs both traffic and duration.
plan_credit_only403This account works with credit plans only.
plan_group_unsupported409A multi-device client cannot be renewed with a plan.
plan_mode_disabled403Credit plans are not enabled for this account.
plan_not_found404Plan not found or inactive.
plan_protocols409The plan and the protocols do not match.
plan_router_mismatch409This plan cannot be used on this router.
protocol_present409The client already has L2TP.
rate_limited429Too many requests. Wait and retry.
renew_days_limit403A limited agent can renew for at most 90 days.
renew_required409This peer reached its limit or expiry. Renew it first.
request_in_progress409The first request with this key is still running.
router_busy503Another change is running on this router. Retry in a few seconds.
router_full409This router has no free capacity.
router_not_assigned403This router is not assigned to you.
router_not_found404Router not found.
router_not_ready409WireGuard is not set up on this router.
router_peer_cap_reached409Your peer limit on this router is used up.
router_peer_cap_unset409No peer limit is set for you on this router yet.
router_required422Say which router (router_id).
router_unreachable502The router could not be reached.
server_busy503The server is busy. Retry in a few seconds.
speed_not_allowed422Agents cannot set a speed per peer; the shared agent speed applies.
too_many_auth_failures429Too many failed keys from this address.
too_many_concurrent_writes429Too many changes running at the same time.
traffic_required422Give traffic_bytes or unlimited_traffic.
unknown_field422The request has fields this endpoint does not accept.
unlimited409This client has no traffic limit, so there is nothing to add to.
unlimited_not_allowed403A limited agent cannot give unlimited traffic or time.