Testing Locally
Test your Voicebip integration locally without real phone calls or SMS charges.
Sandbox Mode
Use a pk_test_ API key to enter sandbox mode. In sandbox mode:
- All agent and number CRUD operations work identically to production
- Calls and messages simulate the full lifecycle (webhook events fire normally)
- Webhook signatures use real HMAC-SHA256 — your verification code works unchanged
- No real SIP/RTP calls are placed, no real SMPP messages are sent
- Billing is NGN 0 — no charges accrue in sandbox mode
Switch to production by replacing pk_test_ with pk_live_ in your Authorization header. No other code changes needed.
Test Numbers
Sandbox mode provisions numbers from reserved test pools:
These numbers are free to provision in sandbox and behave identically to production numbers, except no real calls or messages are routed.
Test Webhook Endpoint
Use POST /v1/webhooks/test to send a synthetic webhook event to your configured URL. This is the fastest way to verify your webhook handler works correctly.
The test endpoint delivers a realistic Nigerian mock payload with valid +234 E.164 numbers, conversation history, and a valid HMAC-SHA256 signature. You can use any event_type value: call.initiated, call.transcription, call.completed, or message.received.
Mock Webhook Payloads
Below are the exact payloads Voicebip sends when you use POST /v1/webhooks/test. These match the production payload format — only the phone numbers are from the sandbox pool.
call.initiated
Fired when a call begins ringing.
call.transcription
Fired as real-time transcript segments arrive during the conversation. Includes conversation_history with all turns so far.
call.completed
Fired when the call ends. Includes full duration, transcript, MNO used, and cost.
message.received
Fired when an inbound SMS arrives.
Webhook Signature Verification
Every webhook delivery includes two headers:
X-Voicebip-Signature: sha256={hex_digest}— HMAC-SHA256 of"{timestamp}.{body}"X-Voicebip-Timestamp: {unix_seconds}— Unix timestamp used in the signature
Always verify the signature and check the timestamp is within a 5-minute window to prevent replay attacks.
Python
Go
TypeScript
Local Development with ngrok
ngrok creates a public URL that tunnels to your local development server. This lets Voicebip deliver webhooks to your machine during development.
Install ngrok
Start the Tunnel
ngrok displays a public URL like https://a1b2c3d4.ngrok-free.app. This URL forwards all traffic to localhost:3000.
Set Your Webhook URL
Use the ngrok URL as your agent’s webhook endpoint:
Send a Test Event
You should see the webhook payload arrive in your local server’s console and in the ngrok web inspector at http://localhost:4040.
Free ngrok URLs change every time you restart the tunnel. Update your webhook URL accordingly, or use a paid ngrok plan for a stable subdomain.