Start free trial Sign in

IconicVPN App API v1.0.0

REST API for IconicVPN’s own apps: accounts, locations, devices and WireGuard connection settings.

Base URL
https://iconicvpn.com/api/app/v1
Format
JSON requests and responses (Content-Type: application/json), UTF-8, timestamps in ISO 8601 UTC
OpenAPI 3
/api/app/v1/openapi.json: generate Swift, Kotlin or TypeScript clients from this
Transport
HTTPS only, through Cloudflare. Pin nothing; use the system trust store.

Authentication

Apps sign in once with the customer's email and password and then stay signed in with tokens. Each app install gets its own session, which the customer can see and revoke.

  1. Sign in with POST /auth/login (or create an account with POST /auth/signup). Send a client object describing the app and device.
  2. Store the refresh token in the platform's secure storage (iOS Keychain, Android Keystore, Windows Credential Manager, macOS Keychain). Keep the access token in memory.
  3. Send Authorization: Bearer <access_token> on every authenticated request. Access tokens last 1 hour.
  4. When a request returns 401 invalid_token, or shortly before expires_in, call POST /auth/refresh. It returns a new pair; the old refresh token stops working immediately, so save the new one before using it. Refresh tokens expire after 90 days without use.
  5. If refresh returns 401 invalid_refresh_token, show the sign-in screen. This happens when the session was revoked, the password changed, or the account closed.

Only one refresh may be in flight per session: serialise refreshes in the app, otherwise the second request uses an already-rotated token and signs the app out.

curl -X POST https://iconicvpn.com/api/app/v1/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"email":"[email protected]","password":"…","client":{"name":"IconicVPN for iOS","platform":"ios","app_version":"1.0.0","device_model":"iPhone 15"}}'

Google & Apple sign-in

“Continue with Google / Apple” runs in the user's browser, against IconicVPN, never inside the app: the app doesn't hold any Google or Apple secrets. It follows OAuth 2.0 for native apps (RFC 8252) with a loopback redirect and PKCE (RFC 7636). The result is the same token pair as a password sign-in.

  1. Call GET /auth/providers and show only the buttons that are true (treat a 404 as none).
  2. Start listening on http://127.0.0.1:<any free port>/<path>. Generate a random state and a PKCE code_verifier (43–128 characters); the code_challenge is its base64url SHA-256.
  3. Open GET /auth/oauth/{google|apple}/start?redirect_uri=…&state=…&code_challenge=…&code_challenge_method=S256 in the system browser. The user signs in with Google or Apple; IconicVPN finds their account (a verified email that matches an existing account signs into it) or creates one with the free trial.
  4. The browser comes back to your redirect_uri with code and state, or with error and error_description. Check state, then show the user a “you can close this tab” page.
  5. Within 60 seconds, POST /auth/oauth/token with the code, the code_verifier, the same redirect_uri and your client. Store the tokens exactly as after /auth/login. account_created: true means this was a new sign-up.

Codes work once. Mobile apps can use the same endpoints with a loopback redirect, or open them in ASWebAuthenticationSession / Custom Tabs.

open "https://iconicvpn.com/api/app/v1/auth/oauth/google/start?redirect_uri=http%3A%2F%2F127.0.0.1%3A53817%2Fcallback&state=…&code_challenge=…&code_challenge_method=S256"
# browser returns to http://127.0.0.1:53817/callback?code=…&state=…
curl -X POST https://iconicvpn.com/api/app/v1/auth/oauth/token \
  -H 'Content-Type: application/json' \
  -d '{"code":"…","code_verifier":"…","redirect_uri":"http://127.0.0.1:53817/callback","client":{"name":"IconicVPN for Windows","platform":"windows"}}'

Google sign-in on Android (ID token)

Android apps can skip the browser: Credential Manager gives the app a Google ID token whose audience is IconicVPN's Google Web client ID, and the app sends it to IconicVPN. The token is checked against Google's keys (signature, issuer, audience, expiry) and must carry a verified email.

  1. POST /auth/google with id_token and client. If the Google account is linked to a customer, or a customer has the same email (it is linked now), you get the same token pair as /auth/login.
  2. On 404 account_not_found there is no account yet. Show a “choose your plan” screen: the free trial, and the paid plans from GET /plans (bought on the website's /pricing/ page).
  3. For the free trial, POST /auth/google/signup with the same body. It creates the customer from the token's name and email, starts the trial and returns 201 with a token pair. 409 email_taken means the account exists: use /auth/google.

401 invalid_token usually means the token expired (they last about an hour): ask the user to pick their Google account again.

curl -X POST https://iconicvpn.com/api/app/v1/auth/google \
  -H 'Content-Type: application/json' \
  -d '{"id_token":"eyJhbGciOiJSUzI1NiIs…","client":{"name":"IconicVPN for Android","platform":"android","app_version":"0.1.0","device_model":"Google Pixel 7"}}'

App updates

Apps find out about new versions from GET /updates/{platform} (windows, android, ios or macos). It needs no token and may be cached for 5 minutes. Check shortly after start and then a couple of times a day, not on every launch of a screen.

  • Compare latest_version with your own version part by part as numbers (0.10.0 is newer than 0.9.2; a missing fourth part counts as 0). If it's newer, offer download_url (open it in the browser) with release_notes.
  • If your version is below minimum_version, the update is required: say so and don't let the notice be dismissed.
  • 404 not_found means nothing is published for the platform: treat it as up to date. Ignore network errors unless the user asked to check.
curl https://iconicvpn.com/api/app/v1/updates/windows

Device keys

Each app install should register itself as one device (a WireGuard peer). Device counts are limited by the customer's plan; check GET /me → devices and can_add_devices.

  • Recommended: keys on the device. Generate a Curve25519 key pair with the platform's WireGuard library, keep the private key in secure storage, and send only public_key to POST /devices. The private key never leaves the device, and /connect returns interface.private_key: null.
  • Alternative: server-generated keys. Omit public_key. IconicVPN generates and stores the keys (encrypted), and /connect returns the private key plus a ready-made config file.

Store the returned device id. If the app is reinstalled and the private key is lost, register a new device and delete the old one.

Connecting & failover

  1. Show GET /locations in the location picker (or offer "Fastest" by sending no location).
  2. On connect, call POST /devices/{id}/connect with the chosen location_id. Call it every time the user connects rather than caching the result: this is where failover happens.
  3. Bring up WireGuard with interface (address, DNS, private key) and peer (server public key, preshared key, endpoint, allowed IPs, keepalive).
  4. If no handshake completes within ~10 seconds, try the servers in alternatives in order, then call /connect again.

How a server is chosen: servers in a location are ordered by priority. Any server whose average bandwidth over the last few minutes is above its limit is marked busy and skipped in favour of the next one; it's used again once traffic drops below the recovery level. If every server in a location is busy, the least-busy one is still returned, so connections keep working. Offline servers are never returned.

Newly registered devices reach servers within about 30 seconds. If the very first handshake fails right after POST /devices, wait a few seconds and retry.

Errors & limits

Errors use HTTP status codes with a JSON body: {"error": "device_limit_reached", "message": "…"}. Branch on error, which is stable. Show message to the user if you have nothing better.

StatusMeaning
400validation_error and similar: the request was malformed
401invalid_token (refresh and retry), invalid_credentials, invalid_refresh_token (sign in again)
403account_blocked (e.g. email not confirmed, account suspended), signup_closed, wrong_password
404not_found
409Conflicts such as device_limit_reached, no_active_subscription, email_taken, location_offline
422Sign-up field errors, with a fields object
429rate_limited: back off (respect Retry-After) and retry
5xxTemporary server problem: retry with exponential backoff

Rate limits are per IP address: sign-in 10 per 15 minutes, sign-up 5 per hour, refresh 60 per hour, device registration 20 per hour, connect 120 per hour. Responses are never cacheable.

Meta

Service information and app updates. No authentication.

GET /api/app/v1/status public

Service status

Public. Use to check connectivity and whether sign-up is open before showing a sign-up screen.

Responses

  • 200
    api_versionstring
    server_timestring (date-time)
    signup_openboolean
    trial_daysinteger | null

GET /api/app/v1/updates/{platform} public

Latest app version for a platform

Public, cacheable for 5 minutes. Compare `latest_version` with the installed version (numerically, part by part) and offer `download_url` when it is newer. Below `minimum_version` the app must be updated to keep working. 404 `not_found` when no release is published for the platform: treat it as up to date.

Parameters

NameInTypeDescription
platformpathstring: windows / android / ios / macos

Responses

  • 200
    platformstring: windows / android / ios / macos
    latest_versionstringDotted numbers: major.minor.patch, optionally a fourth part
    minimum_versionstring | nullInstalled versions below this must update
    download_urlstringOpen in the user’s browser
    release_notesstring | nullPlain text, a sentence or two
    published_atstring (date-time)
  • 400 Error
  • 404 Error

GET /api/app/v1/plans public

Plans on sale

Public. The paid plans shown on the website’s pricing page, in the same order, for a “choose your plan” screen. To buy one, a signed-in app calls POST /billing/checkout-link and opens the link in the browser. Empty when none are on sale.

Responses

Authentication

Sign up, sign in (email and password, Google or Apple) and keep the app signed in with rotating refresh tokens.

POST /api/app/v1/auth/signup public

Create an account (starts the free trial)

Creates the customer with a free trial, signs this app in and emails a confirmation link. With `client.platform` `ios` the account gets no free trial from the server: it has no subscription (GET /me `blocker`: “Choose a plan to start your free trial.”) until an App Store purchase arrives, whose own free trial applies. Returns 403 `signup_closed` if sign-ups are off, 409 `email_taken` if the email has an account, 422 `validation_error` with `fields` for bad input.

Request body

FieldTypeDescription
name *string
email *string
password *string
clientClientInfo
start_trialboolean`false` from the Google Play build: the account starts with no subscription (GET /me `blocker`: “Choose a plan to start your free trial.”), because the free trial comes with the Google Play subscription

Responses

POST /api/app/v1/auth/login public

Sign in with email and password

Creates a new app session. Call once per install and keep the refresh token; don’t log in on every launch. Accounts moved from the old system have no password yet: the reply is 401 `password_not_set` and the customer is emailed a link to choose one. An account whose password was set by IconicVPN staff gets 403 `password_change_required` until the customer chooses their own on the website. Show the `message` to the customer in both cases.

Request body

FieldTypeDescription
email *string
password *string
clientClientInfo

Responses

POST /api/app/v1/auth/refresh public

Exchange a refresh token for a new token pair

Refresh tokens are single-use: the response contains a new refresh token and the old one stops working. Returns 401 `invalid_refresh_token` if it was revoked, expired or already used. The app should then send the user to the sign-in screen.

Request body

FieldTypeDescription
refresh_token *string
clientClientInfo

Responses

POST /api/app/v1/auth/forgot-password public

Email a password reset link

Always returns 202, whether or not the email has an account. The link opens the web portal.

Request body

FieldTypeDescription
email *string

Responses

  • 202
    okboolean
  • 429 Error

GET /api/app/v1/auth/providers public

Sign-in providers available

Public. Which “Continue with …” buttons to show. A provider is `true` only when it is fully configured on this server. Treat a 404 (older server) as all `false`.

Responses

  • 200
    googleboolean
    appleboolean

GET /api/app/v1/auth/oauth/{provider}/start public

Start Google or Apple sign-in (open in the browser)

Open this URL in the user’s browser, not with the app’s HTTP client. The app listens on a loopback port first; after the user signs in, the browser is sent to `redirect_uri` with `code` and `state` (or `error`, `error_description` and `state`). Swap the code with POST /auth/oauth/token within 60 seconds.

An invalid `redirect_uri` or `state` shows an error page and never redirects. Other problems redirect back with `error`: `invalid_request`, `provider_unavailable`, `access_denied` (the user cancelled), `email_not_verified`, `account_closed`, `signup_closed`, `provider_error`. A sign-in that isn’t finished within 10 minutes expires.

The iOS app adds `platform=ios`: an account this sign-in creates then gets no free trial from the server (no subscription until an App Store purchase, whose own free trial applies). Other apps leave it out.

Parameters

NameInTypeDescription
redirect_uriquerystringLoopback URL the app listens on: `http://127.0.0.1:<port>/<path>`, `http://[::1]:<port>/<path>` or `http://localhost:<port>/<path>`
statequerystringRandom value from the app, returned unchanged. Check it on the way back.
code_challengequerystringBase64url (no padding) SHA-256 of the app’s code_verifier
code_challenge_methodquerystring: S256
platform?querystringOptional. `ios` from the iOS app: a new account gets no server free trial (it starts with the App Store purchase).
providerpathstring: google / apple

Responses

  • 302
  • 400

GET /api/app/v1/auth/oauth/google/callback public

Google sign-in return (called by Google)

Register this URL in the Google OAuth client’s “Authorised redirect URIs”. Apps never call it.

Responses

  • 302

POST /api/app/v1/auth/oauth/apple/callback public

Apple sign-in return (form post from Apple)

Register this URL as a “Return URL” on the Apple Services ID. Apps never call it.

Responses

  • 302

POST /api/app/v1/auth/oauth/token public

Swap a Google/Apple sign-in code for tokens

Send the `code` the browser brought back to the app, the PKCE `code_verifier` and the same `redirect_uri` used with /start. Codes work once, within 60 seconds. Returns the same token pair as /auth/login plus `account_created` (true when this sign-in created the account; it started the server’s free trial unless /start had `platform=ios`). 400 `invalid_grant` when the code is unknown, expired, used, or the verifier or redirect URI don’t match.

Request body

FieldTypeDescription
code *string
code_verifier *stringThe secret whose SHA-256 was sent as code_challenge
redirect_uri *string e.g. "http://127.0.0.1:53817/callback"
clientClientInfo

Responses

POST /api/app/v1/auth/google public

Sign in with a Google ID token

For apps that get a Google ID token themselves (Android Credential Manager). Signs in the customer linked to this Google account, or the customer with the same (Google-verified) email, linking the Google account to them. Returns the same token pair as /auth/login.

Doesn’t create accounts: 404 `account_not_found` means there is no customer for this Google account or its email. Offer the free trial (POST /auth/google/signup) or the plans on the website. Other errors: 401 `invalid_token` (bad signature, wrong `aud`/`iss`, or expired; ask the user to pick their Google account again), 403 `email_not_verified`, 403 `account_closed`, 503 `provider_unavailable`.

Request body

FieldTypeDescription
id_token *stringGoogle ID token (JWT) whose audience is IconicVPN’s Google Web client ID
clientClientInfo

Responses

POST /api/app/v1/auth/google/signup public

Create an account from a Google ID token (starts the free trial)

The Google version of POST /auth/signup: verifies the token as POST /auth/google does, creates the customer with the name and email from the token (already verified, no password: they can set one with “Forgot password”), starts the free trial (none with `start_trial: false` or `client.platform` `ios`: see POST /auth/signup), links the Google account and signs this app in. Errors: 401 `invalid_token`, 403 `email_not_verified`, 403 `signup_closed` (sign-ups are off), 409 `email_taken` (an account already exists for this email or Google account; sign in with POST /auth/google instead).

Request body

FieldTypeDescription
id_token *stringGoogle ID token (JWT) whose audience is IconicVPN’s Google Web client ID
clientClientInfo
start_trialboolean`false` from the Google Play build: the account starts with no subscription, because the free trial comes with the Google Play subscription

Responses

POST /api/app/v1/auth/logout bearer token

Sign this app out

Revokes the current session’s tokens.

Responses

  • 204 no content
  • 401 Error

Account

The signed-in customer, their subscription and app sessions.

GET /api/app/v1/me bearer token

Account, subscription and device allowance

Responses

PATCH /api/app/v1/me bearer token

Update profile

Request body

FieldTypeDescription
name *string

Responses

POST /api/app/v1/me/password bearer token

Change password

Signs out every other app session. This session stays signed in.

Request body

FieldTypeDescription
current_password *string
new_password *string

Responses

POST /api/app/v1/me/resend-verification bearer token

Resend the email confirmation link

Responses

POST /api/app/v1/me/portal-link bearer token

One-tap sign-in link to the client area

Returns a link that signs the customer into the website client area, for a “Manage services” or “Delete account” button. `page` picks where it opens: `my_vpn` (the default), `account`, or `delete_account` (the Account page’s Delete account section, which satisfies the stores’ in-app account deletion rule from a single button). Open it in the browser straight away: it works once and expires after 10 minutes (an expired link shows the login page, which then goes to the same page). Asking for a new link cancels the previous one.

Request body

FieldTypeDescription
pagestring: my_vpn / account / delete_account / billing / renew

Responses

  • 200
    urlstring (uri)
    expires_ininteger
  • 401 Error
  • 429 Error

POST /api/app/v1/me/delete bearer token

Delete the account permanently

For the in-app “Delete account” option that the App Store and Google Play require. Ask the customer to confirm, then send `confirm: "DELETE"`. Deletes the account, its devices (they stop connecting within a minute), app sessions and sign-in details, and emails a confirmation. A paid subscription with the billing system is cancelled first; if that fails nothing is deleted and the response is 409 `billing_cancel_failed`. App Store and Google Play subscriptions can’t be cancelled by IconicVPN: before deleting, tell the customer to cancel theirs in the store (the confirmation email says so too). Billing records stay in the billing system for 6 years as the law requires. After 204 the app should discard its tokens and return to the sign-in screen. The public page https://iconicvpn.com/delete-account does the same for people who can’t sign in.

Request body

FieldTypeDescription
confirm *string e.g. "DELETE"

Responses

GET /api/app/v1/sessions bearer token

List signed-in app sessions

Responses

DELETE /api/app/v1/sessions/{id} bearer token

Sign out an app session

Use to sign out a lost device. Revoking the current session works like /auth/logout.

Parameters

NameInTypeDescription
idpathinteger

Responses

Servers

Locations and servers available on the customer’s plan, with live load.

GET /api/app/v1/locations bearer token

Locations available on the customer’s plan

Show these in the location picker. Available locations come first.

Responses

GET /api/app/v1/servers bearer token

Individual servers with live load

For advanced pickers. Most apps only need /locations plus /connect.

Parameters

NameInTypeDescription
location_id?querystring

Responses

Devices

WireGuard devices (peers) on the account. Each app install should register one device.

GET /api/app/v1/devices bearer token

List devices

Responses

POST /api/app/v1/devices bearer token

Register this device

Recommended: generate a Curve25519 key pair on the device, keep the private key in secure storage, and send only `public_key`. Omit `public_key` to have IconicVPN generate the keys (they are then returned by /connect). Errors: 403 `account_blocked`, 409 `device_limit_reached` / `no_active_subscription` / `public_key_in_use`, 400 `invalid_name` / `invalid_public_key`.

Request body

FieldTypeDescription
name *string e.g. "My iPhone"
public_keystringBase64 WireGuard public key generated on the device

Responses

GET /api/app/v1/devices/{id} bearer token

Get a device

Parameters

NameInTypeDescription
idpathinteger

Responses

DELETE /api/app/v1/devices/{id} bearer token

Remove a device

The device is disconnected from every server within about 30 seconds and its slot is freed.

Parameters

NameInTypeDescription
idpathinteger

Responses

Connect

Tunnel settings for the best server, with bandwidth-aware failover.

POST /api/app/v1/devices/{id}/connect bearer token

Get tunnel settings for the best server

Call every time the user connects, so failover applies. Choose by `location_id` (recommended), by `server_id`, or send neither for the best location overall.

Within a location, servers are tried in priority order and any server over its bandwidth limit is skipped in favour of the next. `alternatives` lists other servers in the location to try if the handshake fails.

A device can be added to a server up to ~30 seconds after it was created (servers sync every 30s). If the first handshake fails right after registering, retry briefly.

Errors: 403 `account_blocked`, 404 `not_found`, 409 `location_not_available` / `server_not_available` / `location_offline` / `no_servers`.

Parameters

NameInTypeDescription
idpathinteger

Request body

FieldTypeDescription
location_idstring e.g. "gb-london"
server_idinteger

Responses

Billing

Buying a plan, plan billing, invoices, payments, cancellation and account history.

GET /api/app/v1/billing bearer token

Current plan billing

Payment method, renewal (or end) date, amount, and whether a cancellation is pending. `manage_url` is a one-tap sign-in link to Plan & billing in the client area.

Responses

POST /api/app/v1/billing/checkout-link bearer token

Link to buy (or renew) a plan

Returns a one-tap sign-in link to the website checkout for `plan_id` (a plan from GET /plans), where the customer picks how to pay (card, PayPal, Apple Pay, Google Pay or crypto). Open it in the browser straight away: it works once and expires after 10 minutes. With `renew: true` (prepaid crypto plans) it opens the renewal page instead and `plan_id` is ignored. 409 `already_subscribed` when the customer already has a paid plan; 404 `not_found` for a plan that isn’t on sale. After paying, GET /me shows the new subscription (usually within seconds; crypto can take longer).

Request body

FieldTypeDescription
plan_idinteger
renewboolean

Responses

GET /api/app/v1/billing/invoices bearer token

Invoices for the VPN service, newest first

Responses

GET /api/app/v1/billing/invoices/{id}/pdf bearer token

Download an invoice as PDF

Redirects (302) to a short-lived PDF download, for invoices with `pdf_available` (Paddle payments). 404 `pdf_unavailable` for the others: show `view_url` instead.

Parameters

NameInTypeDescription
idpathinteger

Responses

GET /api/app/v1/billing/payments bearer token

Payments and refunds, newest first

Responses

POST /api/app/v1/billing/cancellation bearer token

Cancel at the end of the billing period

Stops the plan renewing; the VPN keeps working until the end of the paid period (`next_due`). For crypto plans it stops the renewal reminders. 409 `not_cancellable` when there’s no active paid plan or it’s already cancelled; 503 `billing_unavailable` if the payment provider can’t be reached.

Request body

FieldTypeDescription
reasonstring

Responses

POST /api/app/v1/billing/resume bearer token

Withdraw a pending cancellation

The plan carries on and renews as normal (crypto: the reminders come back). 409 `not_resumable` when there’s no pending cancellation; 503 `billing_unavailable` if the payment provider can’t be reached.

Responses

POST /api/app/v1/billing/apple/transactions bearer token

Report an App Store purchase (iOS)

After a successful StoreKit 2 purchase (made with `appAccountToken` = `store_account_token` from GET /me), send its transaction id; also for “Restore purchases” (send each current entitlement’s `originalID`). The panel reads the transaction from Apple and links it to this account. Errors: 409 `purchase_belongs_to_another_account`, 404 `purchase_not_found`, 422 `product_not_sold` (no plan has that App Store product), 503 `store_not_configured`, 502 `store_unavailable` (retry later; finish the StoreKit transaction only after a 200).

Request body

FieldTypeDescription
transaction_id *string e.g. "2000000712345678"

Responses

  • 200
    activatedbooleanThe purchase gives access now (false for an expired purchase being restored, or a pending one)
    pendingbooleanGoogle Play: the payment isn’t complete yet (e.g. a cash payment). Check again later or wait for the plan to appear in GET /me.
    billingBillingOverview
  • 400 Error
  • 401 Error
  • 404 Error
  • 409 Error
  • 422 Error
  • 429 Error
  • 502 Error
  • 503 Error

POST /api/app/v1/billing/google/purchases bearer token

Report a Google Play purchase (Android)

After Play Billing reports a purchased subscription (bought with `setObfuscatedAccountId(store_account_token)`), send its purchase token; also for restoring purchases. The panel reads it from Google, links it to this account and acknowledges it (the app doesn’t need to; unacknowledged purchases are refunded by Google after 3 days). Same errors as the App Store endpoint.

Request body

FieldTypeDescription
purchase_token *string

Responses

  • 200
    activatedbooleanThe purchase gives access now (false for an expired purchase being restored, or a pending one)
    pendingbooleanGoogle Play: the payment isn’t complete yet (e.g. a cash payment). Check again later or wait for the plan to appear in GET /me.
    billingBillingOverview
  • 400 Error
  • 401 Error
  • 404 Error
  • 409 Error
  • 422 Error
  • 429 Error
  • 502 Error
  • 503 Error

POST /api/app/v1/me/google-play/purchases bearer token

Start the plan for a Google Play subscription (Android, Play build)

After Play Billing reports a purchased subscription, and whenever the plan screen opens or the customer taps Restore purchase. Idempotent: send the same purchase as often as needed.

The panel reads the purchase from Google, checks it’s an active (or grace-period, or cancelled but not yet expired) subscription for `product_id`, and that it belongs to this account: its `obfuscatedAccountId` must be `sha256_hex("iconicvpn-customer:" + customer id)` (or this account’s `store_account_token`). A purchase without one (bought in an older app) is accepted if no other account has it. It then starts or updates the subscription (`trial` during Google’s free trial, otherwise `active`; `expires_at` is Google’s expiry time) and acknowledges the purchase. Returns the Account, as GET /me.

Errors: 400 `invalid_purchase` (wrong package, unknown or inactive purchase, or not for `product_id`), 409 `purchase_in_use` (it belongs to another account), 422 `unknown_product` (no plan sells that product and base plan), 503 `store_not_configured`, 502 `store_unavailable` (retry later).

Request body

FieldTypeDescription
package_name *string e.g. "com.vpn.iconicvpn"
product_id *string e.g. "iconicvpn_monthly"
purchase_token *string

Responses

GET /api/app/v1/history bearer token

Account history, newest first

Plan and status changes, devices added and removed, security events, invoices, payments and refunds.

Responses

Data types

Error

Every error response has this shape. `error` is a stable machine-readable code; `message` is human-readable and may change.

FieldTypeDescription
error *string e.g. "device_limit_reached"
message *string e.g. "Device limit reached (5 of 5). Remove a device first or upgrade the plan."
fieldsobjectPer-field problems (validation errors on sign-up only)

ClientInfo

Describes the app install. Shown to the customer in their list of signed-in apps.

FieldTypeDescription
namestring e.g. "IconicVPN for iOS"
platformstring`ios` from the iOS app. Accounts created with `ios` get no free trial from the server: the App Store subscription’s free trial applies instead. e.g. "ios"
app_versionstring e.g. "1.0.3"
device_modelstring e.g. "iPhone 15"

TokenPair

FieldTypeDescription
token_type *string: Bearer
access_token *stringSend as `Authorization: Bearer <access_token>`. Starts with `iva_`.
expires_in *integerSeconds until the access token expires e.g. 3600
refresh_token *stringUse once with POST /auth/refresh to get a new pair. Starts with `ivr_`. Store securely (Keychain/Keystore).
refresh_expires_in *integerSeconds until the refresh token expires if unused
session_id *integerThis app session, as listed by GET /sessions

OAuthTokenPair

Returned by POST /auth/oauth/token: a TokenPair plus `account_created`.

FieldTypeDescription
token_type *string: Bearer
access_token *stringSend as `Authorization: Bearer <access_token>`. Starts with `iva_`.
expires_in *integerSeconds until the access token expires e.g. 3600
refresh_token *stringUse once with POST /auth/refresh to get a new pair. Starts with `ivr_`. Store securely (Keychain/Keystore).
refresh_expires_in *integerSeconds until the refresh token expires if unused
session_id *integerThis app session, as listed by GET /sessions
account_created *booleanTrue when this Google/Apple sign-in created the account (with the server’s free trial, unless /start had `platform=ios`)

PlanOffer

A plan on sale on the website (the pricing page). To buy it, get a link from POST /billing/checkout-link and open it in the browser.

FieldTypeDescription
id *integer
name *string e.g. "Yearly"
device_limit *integer e.g. 5
price_cents *integerPrice per billing interval e.g. 4999
currency *string e.g. "GBP"
billing_interval *string: month / quarter / year / biennial
highlightstring | nullShort selling point, e.g. “Best value” e.g. "Best value"
apple_product_idstring | nullApp Store subscription product id that sells this plan (iOS in-app purchase); null if not sold in the iOS app e.g. "com.iconicvpn.monthly"
google_product_idstring | nullGoogle Play subscription product id that sells this plan (Android in-app purchase); null if not sold in the Android app e.g. "iconicvpn_monthly"

Customer

FieldTypeDescription
id *integer
name *string
email *string (email)
status *string: lead / active / suspended / closed
email_verified *boolean

Subscription

FieldTypeDescription
idinteger
statusstring: trial / active / past_due / suspended / cancelled / expired`past_due`: a renewal payment hasn’t gone through yet (still connects for 7 days after the renewal date). `suspended`: still unpaid after that, devices can’t connect.
livebooleanTrue for trial, active and past_due: devices can connect
started_atstring (date-time)
expires_atstring (date-time) | nullEnd of the paid period (or trial): a card plan renews on this date, a cancelled or crypto plan ends on it
billed_externallybooleanTrue when the plan was bought online and is billed through a payment method (`payment_method`). False for free trials and plans set up by our team.
payment_methodstring | nullNull for free trials and plans set up by our team. Otherwise how the plan is paid (paddle, square, trust or nowpayments): Paddle, Square or Trust Payments (cards, renew automatically) or NOWPayments (crypto, prepaid: renewed by hand) e.g. "paddle"
cancel_at_period_endbooleanCancelled: ends at expires_at instead of renewing
billing_urlstring | nullThe client area’s Plan & billing page (needs the customer signed in; use POST /me/portal-link with page=billing)
auto_renewboolean
planobject
plan.idinteger
plan.namestring
plan.device_limitinteger
plan.price_centsinteger
plan.currencystring e.g. "GBP"
plan.billing_intervalstring: month / quarter / year / biennial

Account

FieldTypeDescription
customerCustomer
subscriptionSubscription | object: | nullThe current (or most recent) subscription; null if there has never been one
devicesobject
devices.usedinteger
devices.limitinteger0 when there is no live subscription
can_add_devicesboolean
blockerstring | nullWhy devices can’t be added or connected right now, if anything. An account that has never had a subscription (e.g. created in the iOS app, before its App Store purchase) gets “Choose a plan to start your free trial.”
verification_requiredbooleanWhether an unverified email blocks devices on this service
store_account_tokenstring (uuid)Pass with every in-app purchase: as `appAccountToken` (StoreKit 2, iOS) or `setObfuscatedAccountId` (Play Billing, Android). It ties the store purchase to this account, so it can’t be claimed by another one. Not secret, but there’s no need to show it.

Session

FieldTypeDescription
idinteger
currentbooleanTrue for the session making this request
client_namestring | null
platformstring | null
app_versionstring | null
device_modelstring | null
created_atstring (date-time)
last_used_atstring (date-time)
last_ipstring | null

Location

FieldTypeDescription
idstringStable location id, e.g. `gb-london`. Pass to /connect. e.g. "gb-london"
namestring e.g. "London, GB"
citystring e.g. "London"
country_codestring | null e.g. "GB"
serversintegerServers in this location available to the customer
availablebooleanAt least one server here is online
busybooleanEvery online server here is over its bandwidth limit (connections still work, but may be slower)
recommended_server_idinteger | nullThe server /connect would pick right now

Server

FieldTypeDescription
idinteger
namestring e.g. "uk-lon-01"
location_idstring e.g. "gb-london"
location_namestring e.g. "London, GB"
country_codestring | null
onlineboolean
busybooleanOver its bandwidth limit; /connect prefers other servers in the location
load_percentinteger | nullConnected clients as a % of capacity
bandwidth_mbpsnumber | nullRecent average throughput (busier direction)
recommendedbooleanThe server /connect would pick in this location right now

Device

FieldTypeDescription
idinteger
namestring e.g. "My iPhone"
addressstringTunnel IPv4 address assigned to this device e.g. "10.8.0.12"
public_keystringThe device’s WireGuard public key
key_locationstring: device / server`device`: the app generated the key pair and keeps the private key. `server`: the key was generated by IconicVPN and /connect returns it.
created_viastring: admin / portal / app
created_atstring (date-time)

Connection

Everything needed to bring up the WireGuard tunnel to the chosen server.

FieldTypeDescription
serverServer
alternativesarray of ServerOther online servers in the same location, best first. Try these if the handshake with `server` fails.
interfaceobject
interface.addressstringCIDR for the tunnel interface e.g. "10.8.0.12/32"
interface.dnsarray of string e.g. ["1.1.1.1","1.0.0.1"]
interface.private_keystring | nullOnly for key_location=server devices. Null when the app holds the key.
peerobject
peer.public_keystringThe server’s WireGuard public key
peer.preshared_keystringPer-device preshared key (adds post-quantum resistance)
peer.endpointstring e.g. "81.31.231.115:51820"
peer.allowed_ipsarray of string e.g. ["0.0.0.0/0","::/0"]
peer.persistent_keepaliveinteger e.g. 25
configstring | nullA complete wg-quick config file, only when the server holds the private key
site_routesarray of stringInternal site networks reachable through this server (site-to-site tunnels the customer’s plan allows). For a split tunnel that only reaches the sites, use these as allowed IPs instead of 0.0.0.0/0 and skip DNS. Empty when none. e.g. ["10.8.0.40/32","192.168.10.0/24"]

BillingOverview

The current plan’s billing.

FieldTypeDescription
billed_externallybooleanBought online and billed through a payment method. False for free trials and plans set up by our team.
payment_methodstring | nullpaddle, square, trust or nowpayments; null when not paid through a payment method e.g. "paddle"
payment_method_labelstring | null e.g. "Paddle"
prepaidbooleanCrypto: each payment buys one period and nothing renews automatically. Use POST /billing/checkout-link with renew=true before `next_due` to add another period.
payment_failedbooleanThe last renewal payment didn’t go through
can_resumebooleanPOST /billing/resume withdraws a pending cancellation
store_managedbooleanBought as an in-app purchase: change, cancel and refunds happen in the App Store or Google Play, not here (can_cancel is false). Open store_manage_url.
store_manage_urlstring | nullThe store’s subscription management page, for store_managed plans
plan_namestring | null
statusstring | nullSubscription status, as in Subscription.status
billing_cyclestring | null e.g. "Yearly"
amount_centsinteger | nullRecurring charge per billing cycle
currencystring | null e.g. "GBP"
next_duestring (date) | nullNext payment date (or the end date when a cancellation is pending)
cancellation_pendingboolean
unpaid_invoicesinteger
unpaid_centsinteger
manage_urlstring | nullOpen in a browser for the "Manage services" button: a one-tap sign-in link to the customer’s My VPN page in the client area (single use, valid 10 minutes; once it has expired it shows the login page, which then goes to My VPN). Plan changes, billing and cancellation are all reachable from there. For a fresh link at the moment of the tap, use POST /me/portal-link.
can_cancelbooleanPOST /billing/cancellation is available
synced_atstring (date-time) | nullAlways null now that billing is in the panel (kept for older apps)

Invoice

FieldTypeDescription
idinteger
numberstring | nullInvoice number, e.g. IV-1042
referencestringThe payment provider’s id for the charge
statusstringpaid or refunded (older imported invoices may show other statuses) e.g. "paid"
issued_onstring (date) | null
due_onstring (date) | null
paid_atstring (date-time) | null
total_centsinteger
tax_centsinteger | null
currencystring | null
itemsarray of object
items[].descriptionstring
items[].amount_centsinteger | null
items[].qtynumber
payablebooleanUnpaid: open `pay_url` in a browser to pay it
pay_urlstring | null
pdf_availablebooleanGET /billing/invoices/{id}/pdf redirects to a PDF (Paddle payments)
view_urlstringThe printable invoice in the client area (needs the customer signed in)

Payment

FieldTypeDescription
idinteger
amount_centsintegerNegative for refunds
currencystring | null
paid_atstring (date-time) | null
methodstring | nullPayment gateway
referencestring | null
invoice_idinteger | null

HistoryEvent

FieldTypeDescription
atstring (date-time)
kindstring: account / plan / device / security / invoice / payment / refund
textstring e.g. "Plan changed from Monthly to 2 years"
amount_centsinteger | null
currencystring | null
invoice_idinteger | null

* required field