1. 🔄 Lifecycle
TunnelSats Public Wireguard API
  • Announcements
    • 👋 About our team
    • 💫 What is TunnelSats?
    • 🚀 Introducing the TunnelSats Public API v1
    • 🧩 How the TunnelSats StartOS Package Uses the Public API
    • How TunnelSats Leverages Public APIs for Confined VPN Management
    • 🤖 Autonomous Agent Payments (L402 & x402) & Level 5 Agent-Native Architecture
  • 📡 Discovery
    • List Available WireGuard Servers & Regions
      GET
    • L402 Agent Payment Gateway Discovery Metadata
      GET
  • ⚡ Purchase
    • Create a New WireGuard Subscription (Invoice Generation)
      POST
    • Check Invoice Status & Polling by Payment Hash
      GET
    • Claim WireGuard Configuration After Payment Settlement
      POST
    • Autonomous Agent HTTP 402 Gateway (L402 Purchase + Claim)
      POST
  • 🔄 Lifecycle
    • Get Subscription & Bandwidth Status by WireGuard Public Key
      POST
    • Sync Subscription (Real-Time Server Refresh)
      POST
    • Renew an Existing VPN Subscription (Anonymous)
      POST
    • Request Bandwidth Top-Up ($1 Usage Reset)
      POST
    • Check Region Switch Eligibility
      POST
    • Create or Reuse Region Switch Invoice
      POST
    • Claim Client-Held Region Switch Parameters
      POST
  • 🔑 Account
    • List Account Subscriptions (Authenticated)
      GET
    • Create Referral Code
      POST
    • Get Referral Code
      GET
    • Referral History
      GET
  • 🔧 Tools
    • Lightning Node Network Address Discovery
      POST
    • Universal Connectivity & Latency Probe
      POST
  • Cookbook
    • 🛠️ Automation & Code Examples
    • 🐚 Bash One-Liners
    • 🚑 Node Health & Upkeep
    • ⚡ Bandwidth Top-Up ($1 Usage Reset)
    • 🛡️ Security & Authentication
    • 🎁 Referral Program: Earn Bonus Months
    • 🛑 Error Codes & Troubleshooting
    • 🤖 Agent Payments: L402 & x402 Protocol
  • Schemas
    • Server
    • InvoiceOrder
    • SubscriptionStatus
    • NodeLookup
    • ConnectivityResult
    • ReferralHistory
    • ReferralCode
    • SubscriptionListItem
    • PublicKeyStatusResponse
    • BandwidthResetResponse
    • ApiError
    • ClaimResult
    • BandwidthResetPaymentStatus
    • RegionSwitchServer
    • RegionSwitchCheckResult
    • RenewalOrder
    • RegionSwitchInvoice
    • RegionSwitchClaimResult
    • RegionSwitchPaymentStatus
    • SyncResult
Tunnelsats Github
Tunnelsats Telegram
  1. 🔄 Lifecycle

Claim Client-Held Region Switch Parameters

POST
https://tunnelsats.com/api/public/v1/subscription/migrate/claim
Retrieve using paymentHash plus the immutable registered destination wgPublicKey. The pair is a retrieval capability; a public key alone cannot authorize creating a switch. May heal a missed webhook through verified settlement. Returns the client-held purchase-claim shape plus graceExpiresAt, never a private key or full config. Persist these parameters and assemble the config locally. Retries are idempotent and remain available after source-grace cleanup while this destination remains current. Superseded destinations and Web-mode full-config recovery are refused. Creation flags, maintenance, or missing creation-origin configuration do not disable paid recovery. Rate limit: 10 requests/min per IP (rolling). Request bodies are limited to 8192 bytes.

Request

Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Provisioned tunnel parameters; PSK is sensitive.
Headers

Bodyapplication/json

🟢202
🟠400
🟠402
🟠404
🟠409
🟠410
🟠413
🟠429
🔴500
🔴503
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://tunnelsats.com/api/public/v1/subscription/migrate/claim' \
--header 'Content-Type: application/json' \
--data '{
    "paymentHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "wgPublicKey": "3p7bfXt9wbTTW2HC7OQ1Nz+DQ8hbeGdNrfx+FG+IK08="
}'
Response Response Example
200 - Success Example
{
    "status": "already_processed",
    "subscriptionEnd": "2027-03-01T12:34:56.000Z",
    "server": {
        "endpoint": "ch1.tunnelsats.com:51820",
        "publicKey": "V4TFx8LMrIYdUKJeXVi7/H5CYHrWE1UlX6WTxD063wY=",
        "allowedIPs": "0.0.0.0/0, ::/0"
    },
    "peer": {
        "address": "10.9.0.20/32",
        "publicKey": "3p7bfXt9wbTTW2HC7OQ1Nz+DQ8hbeGdNrfx+FG+IK08=",
        "presharedKey": "OjbKgP5jZR9IQkAB1zf5/ZyENNDKOahdZy6UqDF/vvU="
    },
    "vpnPort": 30020,
    "keyId": "20",
    "graceExpiresAt": "2026-11-05T12:01:00.000Z",
    "fullConfig": null
}
Modified at 2026-11-06 19:55:30
Previous
Create or Reuse Region Switch Invoice
Next
List Account Subscriptions (Authenticated)
Built with