Back to Blog
Integration Guides

How to Integrate Twilio with PandaDoc: Step-by-Step Guide

Wire Twilio into PandaDoc webhooks to send SMS alerts when documents are opened, signed, or require action from a recipient.

DA
Danial A
Senior Twilio Consultant, Telphi Consulting
June 22, 2026
7 min read
Twilio
Integration
Documents
eSign
How to Integrate Twilio with PandaDoc: Step-by-Step Guide

PandaDoc and Twilio integrate through PandaDoc's webhook system and the Twilio Messages API to send SMS alerts to recipients and the document sender when PandaDoc documents are sent, viewed, signed, or completed, keeping all parties informed through the fastest-read communication channel without depending on email open rates. This integration is used by sales teams, agencies, and professional services firms that use PandaDoc for proposals, contracts, and quotes and want to reduce the time from document sent to document signed by adding an SMS nudge that reaches signatories on their phones immediately when a document needs their attention. The connection uses PandaDoc webhooks configured in the PandaDoc API settings to POST document event data to your middleware, which dispatches targeted Twilio SMS to the relevant recipient or sender based on the event type.

What You Need Before You Start

Obtain a PandaDoc API key by logging into your PandaDoc account, navigating to Settings, then Integrations, then API, and clicking Generate API Key, which produces a Bearer token used for all PandaDoc REST API calls at https://api.pandadoc.com/public/v1/. Configure a PandaDoc webhook by navigating to Settings, then Integrations, then Webhooks in the PandaDoc admin, clicking Add Webhook, entering your middleware endpoint URL, selecting the event types document.state.changed and document.viewed to receive notifications when documents change state and when recipients open them, and optionally enabling a shared secret that PandaDoc includes in the X-PandaDoc-Signature header for payload verification. Store recipient phone numbers in PandaDoc by adding a custom field named recipient_phone to your PandaDoc document templates under the Fields section, pre-filling the value via the PandaDoc API when creating documents programmatically, or requiring recipients to fill in the field as a form element on the document before signing. From Twilio, provision an SMS-capable phone number under an A2P 10DLC campaign registered in the Twilio Console for transactional notifications and collect your Account SID and Auth Token.

Step-by-Step Integration Guide

In your middleware, verify the PandaDoc webhook signature by computing HMAC-SHA256 of the raw request body using the shared secret you set in the PandaDoc webhook configuration as the key, comparing the hex digest against the value in the X-PandaDoc-Signature header, and returning HTTP 400 for mismatched signatures to reject spoofed requests. Parse the PandaDoc webhook payload to extract the event type from the event field, the document ID from the data.id field, and the document name from the data.name field, then use the event type to branch your middleware logic into different SMS body templates for each event. For document.state.changed events where data.status equals document.sent, retrieve the recipient phone by calling the PandaDoc API at GET https://api.pandadoc.com/public/v1/documents/{documentId}/details with the Authorization header set to API-Key {yourApiKey} and extracting the recipients array, finding the element where role matches signer and reading the custom field value with the name recipient_phone. Dispatch a Twilio SMS to the recipient by calling POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json with Basic authentication, To set to the normalized recipient phone, From set to your Twilio number, and Body set to a message such as 'A document requires your signature: ' + data.name + '. Check your email to review and sign.', and return HTTP 200 to PandaDoc immediately.

Common Issues and How to Fix Them

PandaDoc webhook events for document.state.changed fire multiple times in sequence when a document transitions through intermediate states such as from draft to sent, from sent to viewed, and from viewed to waiting for payment, causing your middleware to dispatch multiple SMS to the recipient within seconds when all you want is a single notification on the document.sent state. Add a state filter in your middleware that only dispatches SMS for specific target states such as document.sent and document.completed, and skip dispatch for intermediate or internal states like document.draft and document.approval_workflow.step.waiting. The PandaDoc API call to retrieve document details after receiving a webhook event may return a 202 Accepted status rather than 200 OK when the document is still being processed by PandaDoc's backend at the time your middleware requests details, producing an incomplete details response that is missing the recipients array. Implement a retry with exponential backoff on the PandaDoc details API call, waiting 2 seconds, then 4 seconds, then 8 seconds between retries, and only dispatching the Twilio SMS after the API returns a 200 OK response with the full document details including the recipients array. PandaDoc webhooks do not include recipient phone numbers in the webhook payload itself and require a secondary API call to retrieve document details, which means your middleware makes two API calls per webhook event and the second call fails if your PandaDoc API key is expired or revoked. Add API key validation as a startup health check in your middleware that calls GET https://api.pandadoc.com/public/v1/current-user with the API key and alerts your operations team by email if the call returns 401, so expired API keys are detected proactively rather than causing silent SMS failures.

How to Get More from This Integration

Build a sender notification SMS by dispatching a Twilio SMS to the document sender when a recipient completes signing, extracting the sender's phone from your CRM or user database using the sender email address from the PandaDoc document details API response's created_by field, so the sales rep or account manager receives an immediate phone notification when a prospect signs a proposal or contract without having to monitor their email. Add a document viewed alert by processing document.viewed webhook events and dispatching a Twilio SMS to the document sender within 30 seconds of the recipient opening the document, enabling the sales rep to call the prospect while they are actively reading the proposal and have peak interest and engagement. Create a multi-step SMS follow-up sequence for unsigned documents by storing each document.sent event timestamp and recipient phone in your database, then running a scheduled job that checks for documents in the sent state for more than 48 hours, dispatching a first reminder SMS at 48 hours and a second reminder at 96 hours if still unsigned, and logging each reminder sent to prevent duplicate reminders from firing. Extend the integration with Twilio two-way SMS by building an inbound keyword handler that detects when a recipient replies SIGN or LINK to your Twilio number and responds with a unique PandaDoc signing link retrieved via the PandaDoc API at GET https://api.pandadoc.com/public/v1/documents/{documentId}/session with the recipient email as a parameter, enabling recipients to request a direct signing link via SMS reply without searching their email inbox.

Conclusion

PandaDoc and Twilio together reduce time-to-signature by adding instant SMS alerts to every stage of your document workflow, reaching signatories on the device they check most before they forget about the email notification. Reach out to Telphi Consulting to build and deploy the PandaDoc Twilio SMS integration for your document and proposal workflow.

Share this article:
0 views

Ready to Transform Your Business Communications?

Get a free consultation with our VoIP experts and discover how we can help you save costs, improve efficiency, and scale your business.

Comments (0)

Join the discussion and share your thoughts (AI-moderated for quality)

Protected by AI moderation

Be the first to comment

No comments yet. Share your thoughts below.