REST API — Webhooks
Receive real-time event notifications for wallet and spend activity.
ℹBeta
Webhooks are in public beta. The event schema is stable; delivery guarantees are at-least-once.
Registering a webhook
bashnomiqon.com
curl -X POST https://api.nomiqon.com/v1/webhooks -H "Authorization: Bearer sk_live_..." -d '{
"url": "https://yourapp.com/api/webhooks/nomiqon",
"events": [
"transaction.settled",
"transaction.rejected",
"wallet.low_balance",
"agent.policy_updated"
]
}'Event types
transaction.settledA spend was settled on Solana.transaction.rejectedA spend was rejected by the policy engine.wallet.low_balanceWallet dropped below 10% of the daily cap.wallet.depletedWallet balance reached zero.agent.policy_updatedAgent policy was changed.agent.pausedAgent was paused.agent.terminatedAgent was permanently terminated.Verifying signatures
typescriptnomiqon.com
import { Nomiqon } from "@nomiqon/sdk";
const nomiqon = new Nomiqon({ apiKey: process.env.NOMIQON_API_KEY! });
// In your webhook handler (Next.js Route Handler example)
export async function POST(req: Request) {
const rawBody = await req.text();
const sigHeader = req.headers.get("nomiqon-signature") ?? "";
let event;
try {
event = nomiqon.webhooks.constructEvent(
rawBody,
sigHeader,
process.env.NOMIQON_WEBHOOK_SECRET!
);
} catch {
return new Response("Invalid signature", { status: 400 });
}
switch (event.type) {
case "wallet.low_balance":
await triggerTopUp(event.data.agentId);
break;
case "transaction.rejected":
await alertOncall(event.data);
break;
}
return Response.json({ received: true });
}