Skip to content

Using API Keys

API keys let servers, scripts, or jobs receive webhook traffic over WebSocket without relying on the browser dashboard.

Create a key in the web app

  1. Sign in at hooknexus.com.
  2. Open SettingsAPI Keys (or the equivalent in the current UI).
  3. Click New Key (or similar).
  4. Enter a name if prompted.
  5. Copy the full key once — it is only shown at creation time. If you lose it, revoke the key and create another.

To revoke a key, use the same Settings screen — revoked keys stop working immediately and open WebSockets will disconnect.

Connect with WebSocket

wss://api.hooknexus.com/ws/{endpoint-id}?apikey={your-api-key}

API key auth currently uses the apikey query parameter on the URL, not an Authorization header.

This connection counts toward the endpoint’s shared WebSocket concurrency limit alongside dashboard and CLI listeners.

Full details and message formats are in the WebSocket API reference, and a fuller runnable sample is in the Node.js API key listener demo.

const WebSocket = require('ws');
const endpointId = process.env.ENDPOINT_ID;
const apiKey = process.env.HOOKNEXUS_API_KEY;
const ws = new WebSocket(
`wss://api.hooknexus.com/ws/${endpointId}?apikey=${encodeURIComponent(apiKey)}`
);
ws.on('message', (data) => {
const msg = JSON.parse(data.toString());
if (msg.type === 'new_request') {
console.log(msg.payload);
}
if (msg.type === 'replay_request') {
console.log(msg.payload?.request);
}
});

Typical limits (check the app)

PlanAPI keysWebSocket connections per endpoint
Free2 (shared across dashboard, CLI, etc.)
Plus13

Exact numbers are enforced for your account — see Pricing.

If your script only cares about live webhook traffic, ignore unknown message types and reconnect with backoff if the socket drops.

Security

  1. Environment variables — e.g. export HOOKNEXUS_API_KEY="...".
  2. One key per use case — easier to revoke if one script leaks.
  3. Server-side only — never put keys in frontend bundles.
  4. Rotate — revoke and recreate if you suspect exposure.