Test mode
Webhook endpoints registered with ansk_test_* (test mode) API key receive events with livemode: false. Endpoints registered with an sk_live_* key receive livemode: true events. Use a separate endpoint per mode — your dev receiver should not see production traffic, and vice versa.
Local development with ngrok
AgentCard cannot POST tolocalhost — it has no route to your machine. Use a tunnel:
Inspecting deliveries
Every delivery attempt is recorded. Use the CLI to see recent attempts for an endpoint:success / failed / pending), attempt count, HTTP response code, and timestamps. Failed deliveries are retried up to 5 times — the row tracks each attempt.
Triggering events on demand
There is no dedicated “send a test event” endpoint yet — instead, perform the real operation in test mode:| To test… | Run |
|---|---|
card.created | agent-cards-admin cards create |
card.closed (manual) | agent-cards-admin cards close <card-id> |
cardholder.created | agent-cards-admin cardholders create |
cardholder.updated | PATCH /api/v1/cardholders/:id |
transaction.authorized | Use the card’s PAN at a test merchant in test mode |
Common failure modes
| Symptom | Cause | Fix |
|---|---|---|
failed deliveries with HTTP 400 | Signature mismatch — usually because the receiver reparses the JSON before signing | Use the raw request bytes (see Verify signatures) |
| All deliveries time out | Your receiver responds slower than 10s | Acknowledge with 2xx first, do work async |
| Endpoint auto-disabled | 7 consecutive days of failures | Fix the receiver, then PATCH /webhook_endpoints/:id with status: "active" to re-enable |
| Some events never arrive | Endpoint not subscribed to that type | Check enabled_events — use prefix wildcards like card.* for forward-compat |