Quickstart: Webhooks
This guide demonstrates how to set up and test Persona webhooks.
What you’ll build
You’ll create a simple local webhook server with one endpoint that receives webhook events. You’ll configure Persona to send events to this endpoint.
Security note
The server implementation below is meant for learning purposes only—not production usage.
For demonstration purposes, we will keep the server simple:
- The server will not implement authentication or access controls.
- The server will be exposed to the internet via a third-party tunneling service (ngrok or a similar tool).
When you test webhooks that contain real production data, your server should run in a secure environment you control with appropriate authentication, validation, and logging.
Prerequisites
You’ll need access to:
- A Persona account
- An ngrok account—the free plan is sufficient
- Feel free to use any similar tunneling tool. ngrok is just one tool commonly used during development.
- A local development environment for either NodeJS or Python
- This guide provides code for NodeJS and Python, but you can adapt the code to another language.
Before you start, you should:
- Sign into the Persona dashboard
- Add at least one inquiry template to your Persona Sandbox environment
- Persona offers a suite of solutions that include preconfigured inquiry templates. You can follow these instructions to add any solution to your Sandbox environment.
Step 1: Create a local webhook server
Create a new directory called webhook-demo/.
Add the sample code below to create a local server:
NodeJS
Python
- Create
webhook-demo/webhook-server.js:
- Create
webhook-demo/package.json:
- Install dependencies:
- Start the server:
Now, test the server:
You should receive “Webhook received successfully” from the server. In the server logs, you should see the request headers and body.
Step 2: Expose the webhook endpoint with ngrok
Follow ngrok’s documentation to install ngrok locally and configure it with your ngrok authtoken.
Then expose your webhook server to the internet:
Note your ngrok domain (e.g. http://abs123.ngrok-free.dev). You’ll need this in the next step.
Step 3: Set up webhook in Persona
In the Persona dashboard:
- Switch into your Sandbox environment
- Navigate to Webhooks > Webhooks
- Click Create webhook
- Submit the form with the following values:
URL:<your ngrok domain>/webhookEnabled events:inquiry.created,inquiry.started,inquiry.completed,inquiry.approved- For other fields, feel free to provide any value.
- Click Enable and confirm you want to enable the webhook.
At the top of the resulting page:
- Note the “Webhook secret”
- Click the “eye” icon to reveal the value.
- Click Copy and save the value somewhere secure. You will use this value in Step 7.
Step 4: Trigger test events
You selected inquiry-related events in your webhook. Now, create an inquiry and interact with it to trigger events.
In the Persona dashboard (still in your Sandbox environment):
- Navigate to Inquiries > All Inquiries.
- Click Create inquiry and fill out the form (any values are fine).
- Load the newly-created inquiry link in a browser.
- Click through the verification flow.
- Note: Do not provide any real personal information.
- Keep the “Pass verifications” toggle (visible at the bottom of the flow) enabled to simulate you passing all checks.
Step 5: View events in your server logs
Look at your server logs. You should see events for: inquiry.created, inquired.started, and inquiry.completed.
You may also see an event for inquiry.approved if your inquiry template has an associated Workflow that takes action on completed inquiries.
Step 6: Learn about webhook headers for retries and authenticity
In the previous step, you saw the webhook request headers printed in your server logs:
Look at the persona- prefixed headers. These headers provide information about:
- Retries: Persona retries webhooks if it doesn’t receive a successful response from your webhook endpoint within 5 seconds. Persona will attempt to deliver your webhook up to 7 additional times with an exponential backoff between attempts.
- Authenticity: Persona includes a signature created from a secret that only you and Persona share. This signature lets you verify that the request is from Persona.
You need to implement logic in your server to check the Persona signature. Let’s do that next.
Step 7: Improve the server: check that webhook requests are authentic
The value of the persona-signature header consists of a timestamp (t=<unix_timestamp>) plus a signature (v1=<signature>).
The signature signature is computed from your webhook secret (which you found in Step 3) and a dot-separated string composed of the unix timestamp joined with the request body.
Update your server code to verify the signature:
NodeJS
Python
- Update
webhook-demo/webhook-server.js:
- Set your webhook secret (from Step 3) as an environment variable:
Or paste it directly into the code for testing only.
- Restart the server:
Step 8: Trigger test events again and view results
Repeat Steps 4 and 5: Create another inquiry in Sandbox and complete it, then check your server logs for events.
This time, you should see the server log ”✅ Signature verified” for each event.
You can also send a fake webhook request, and check that the server logs ”❌ Invalid signature”:
Summary
In this tutorial, you:
- Created a local webhook server in Node.js or Python
- Configured webhooks in Persona’s dashboard
- Triggered webhook events by completing an inquiry
- Implemented signature verification in your server for security
Next steps
To learn more, check out the following resources:
- Webhook best practices - Tips for using webhooks in production
- Webhooks documentation - Complete webhook reference
- Inquiry Events reference - Full list of available inquiry events

