Getting started for resellers
VPNBuilder runs the VPN for your brand: servers, VPN credentials, customer accounts and sign-in. This guide explains the two ways to connect your apps and website to it, and walks you through your first API calls.
What VPNBuilder does
VPNBuilder (the platform behind this API, codename mercury) is a multi-tenant VPN platform. Each consumer VPN business built on it is a brand. VPNBuilder owns the infrastructure: the VPN servers, the OpenVPN/WireGuard client profiles, the VPN credentials and (if you want) your customer accounts. You own the branding, your website, pricing, payments and support.
Everything is scoped to your brand: accounts, tokens, credentials, sessions, webhooks and settings. The same email address can hold independent accounts at two different brands, and one brand can never see another brand's data.
Two ways to integrate
| Mode | Who calls VPNBuilder | Key | API |
|---|---|---|---|
| Direct | Your apps (iOS, Android, macOS, Windows, Linux, TV) | App key pk_… (public, ships in the app) + a user token after sign-in |
App API (/v2) |
| Intermediate | Your own backend (website, billing system) | Reseller key sk_… (secret, server-side only) |
Reseller API (/reseller/v2) |
Direct: your app ──X-App-Key + Bearer token──▶ App API (/v2)
Intermediate: your app ──▶ your backend ──Bearer sk_…──▶ Reseller API (/reseller/v2)
You can (and usually will) mix both. A typical setup:
- Your apps talk to the App API directly: register, sign in, list servers, fetch the VPN profile, buy a plan in-app (RevenueCat).
- Your website talks to the Reseller API: it signs customers in with
POST /reseller/v2/accounts/verify(so you never store passwords), updates plans from your Stripe webhooks withPUT /reseller/v2/accounts/{id}/entitlement, lets customers set up routers with manual credentials, and approves TV sign-ins.
Both APIs see the same accounts: a customer who signs up on your website can sign in to your app with the same email and password.
Which one should I use?
- Building apps and happy for VPNBuilder to hold your customer accounts? Use the App API directly. You need no backend at all: accounts, password resets (emailed with your brand's sender), devices, purchases via RevenueCat and support reports are all handled for you.
- You already have a customer database or a web shop? Use the Reseller API from your backend to create accounts, verify passwords and set entitlements. Your apps can still use the App API for VPN profiles, or you can proxy everything through your backend.
- Never put the reseller key (
sk_…) in an app. It can read and change every account of your brand.
What you get from the platform operator
When your brand is created, the VPNBuilder operator gives you:
| Item | Example | Use |
|---|---|---|
| App key | pk_acme_3Jx9… |
X-App-Key header on every App API request. Public: it ships in your apps. |
| Reseller key | sk_acme_Q7vT… |
Authorization: Bearer on every Reseller API request. Secret; shown once. |
| Base URL | https://mercury.vpnbuilder.org |
Prefix of every path in these docs. |
Brand settings are configured by the operator for you (send them your
values): website/pricing/account/help/privacy/terms/TV links, support email,
latest and minimum app versions per platform and their update URLs, the in-app
announcement, the email sender name/address used for password-reset mails, your
RevenueCat webhook secret and entitlement id, the connection limit (default 5)
and whether it is enforced, and "manage subscription" URLs. Apps read most of
them from GET /v2/app/config.
Conventions
- JSON in and out. Send
Accept: application/jsonand, with a body,Content-Type: application/json. - Timestamps are ISO 8601 UTC (
2026-12-02T17:44:00Z). IDs are integers. - Errors use one envelope with real HTTP statuses:
{"error": {"code": "…", "message": "…", "fields": {…}}}. See Errors & rate limits.
First calls
App API (Direct)
Fetch the app configuration (only the app key is needed):
curl https://mercury.vpnbuilder.org/v2/app/config?platform=ios \
-H 'Accept: application/json' \
-H 'X-App-Key: pk_acme_3Jx9cTq0aVb1mN8rLw2yKp5sDf7gHj4z'
Register a customer and get a token:
curl -X POST https://mercury.vpnbuilder.org/v2/auth/register \
-H 'Accept: application/json' -H 'Content-Type: application/json' \
-H 'X-App-Key: pk_acme_3Jx9cTq0aVb1mN8rLw2yKp5sDf7gHj4z' \
-d '{"name": "Ada", "email": "ada@example.com", "password": "correct-horse-battery", "device_name": "Ada'\''s iPhone"}'
{
"token": "12|kX8bS0mQ2v7tYf4nR1cW9eJ6hL3pA5zD",
"user": {
"id": 42,
"name": "Ada",
"email": "ada@example.com",
"created_at": "2026-12-02T17:44:00Z",
"revenuecat_app_user_id": "vb_42",
"subscription": {"active": false, "type": null, "expires_at": null, "source": null, "manage_url": null},
"connection_limit": 5
}
}
Use the token for signed-in calls:
curl https://mercury.vpnbuilder.org/v2/servers \
-H 'Accept: application/json' \
-H 'X-App-Key: pk_acme_3Jx9cTq0aVb1mN8rLw2yKp5sDf7gHj4z' \
-H 'Authorization: Bearer 12|kX8bS0mQ2v7tYf4nR1cW9eJ6hL3pA5zD'
Next: Building an app.
Reseller API (Intermediate)
Look up a customer by email from your backend:
curl 'https://mercury.vpnbuilder.org/reseller/v2/accounts?email=ada@example.com' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer sk_acme_Q7vTn2LxP9sRk4Wb8yHc1Me6Ud3Fj5Ga0Zq7Np2Vt9Xs4Kr'
Give them a one-year plan after a Stripe payment:
curl -X PUT https://mercury.vpnbuilder.org/reseller/v2/accounts/42/entitlement \
-H 'Accept: application/json' -H 'Content-Type: application/json' \
-H 'Authorization: Bearer sk_acme_Q7vTn2LxP9sRk4Wb8yHc1Me6Ud3Fj5Ga0Zq7Np2Vt9Xs4Kr' \
-d '{"active": true, "type": "1 Year", "expires_at": "2027-12-02T00:00:00Z", "source": "stripe"}'