Testing
This guide covers how to test your AgentPhone integration during development, including local webhook testing and mock payloads.
Testing webhooks locally
To receive webhooks during development, you need to expose your local server to the internet. We recommend ngrok.
Using ngrok
Using localtunnel
Use the provided URL as your webhook URL.
Free ngrok accounts have session limits. The tunnel will disconnect and you’ll need to restart ngrok and update your webhook URL. For persistent tunnels, consider a paid ngrok plan or deploying to a cloud service.
Test webhook endpoint
Use the test endpoint to verify your webhook handler is working correctly. This sends a sample agent.message payload to your configured URL:
You can also test per-agent webhooks:
Mock webhook payloads
Use these sample payloads to test your webhook handler locally with curl or in your test suite.
SMS payload
Voice payload
Testing with curl
Send a mock payload to your local server:
Example test handlers
Python (Flask)
Node.js (Express)
Checking webhook deliveries
Monitor delivery status to debug issues:
The response shows delivery attempts, HTTP status codes, error messages, and retry timestamps. Use this to verify your endpoint is receiving and acknowledging webhooks correctly.
