- Scopes. A key carries
ip.lookup(the lookups) anddb.download(thedatabases.*routes). The account, organization andapiKeys.*routes need an OAuth scope (account.read,org.read,apikeys.read,apikeys.manage,apikeys.reveal) that an API key cannot hold: with a key they answer 403FORBIDDEN. Store an OAuth access token from VPNDetection’s authorization server as the key to use them. - Plans.
ip.batchneeds a paid plan; on the free plan a batch of one is answered and anything larger is a 402. A field the plan does not include is absent rather thanfalse, so test for presence. - Webhooks. In the console under Database > Delivery, add a webhook destination pointing at your Corsair webhook URL, tick the databases to announce, and give the plugin the destination’s signing secret (
whsec_...) aswebhookSecret(or store it as the account’s webhook signature). Deliveries are checked to the Standard Webhooks spec and refused when older than five minutes.
- 16 typed API operations
- 1 synced entity (
lookups) for fast.search()/.list() - 4 incoming webhook event types
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the VPNDetection API key before the first call: More: API Key
pnpm corsair setup --plugin=vpndetection --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
Check whether an IP is a VPNapiKeys.create
Query synced data
Synced entities supporttenant.vpndetection.db.<entity>.search() and .list(): lookups.
See Database for filters and operators.
Webhooks
This plugin registers 4 webhook event types. Configure the provider to POST to your Corsair HTTP handler, then usewebhookHooks on the plugin factory.
See Webhooks for every event path and payload shape, and Webhooks concept for routing.
What’s next
API reference
Every
vpndetection.api.* operation with input and output types.Database
Synced entities, search filters, and operators.
Webhooks
Event paths, payloads, and
webhookHooks examples.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.