Sending SMS Messages With Twilio and a Direct Post Buyer
This guide walks through how to set up a Direct Post within your Lead Prosper campaign to send an SMS message using Twilio. Once configured you will be able to use the Twilio API to send SMS messages using a Buyer in your Lead Prosper Campaign.
Before configuring Lead Prosper, you’ll first need to complete a few setup steps in Twilio.
Twilio Setup
1) Create a Twilio Account
- Visit Twilio.com and create an account.
- Complete the signup and verification process.
The account setup process is straightforward and only takes a few minutes.
2) Purchase a Twilio Phone Number
To send SMS messages, you will need a Twilio phone number.
- Log into the Twilio Console
- In the left navigation menu go to Phone Numbers → Manage → Buy a Number

- Search for an available phone number
- Click Buy to purchase the number

This number will be used as the From phone number when sending SMS messages.
3) Validate Caller ID
If your Twilio account is on a free trial, you must verify recipient phone numbers before sending SMS messages.
Trial accounts can only send messages to verified phone numbers.
To test messaging, you will need to:
- Add a Caller ID number
- Complete the verification process

4) Register for A2P 10DLC Messaging (Recommended)
If you plan to send SMS messages to US phone numbers using a 10-digit number, Twilio requires A2P 10DLC registration.
You can learn more here:
Twilio SMS API Documentation
https://www.twilio.com/docs/messaging/api/message-resource#create-a-message-resource
A2P 10DLC Registration Guide
https://help.twilio.com/articles/1260801864489-How-do-I-register-to-use-A2P-10DLC-messaging
5) Retrieve Your Twilio Account Credentials
Lead Prosper will need your Twilio API credentials.
- Go to your Twilio Console Dashboard
- Scroll down to Account Info
- Copy the following values:
- Account SID
- Auth Token
You will use these credentials when configuring Lead Prosper.

Lead Prosper Set Up
Twilio can be integrated into Lead Prosper in two different ways:
- Direct Post Buyer – Sends SMS messages when a lead is posted to a buyer
- Campaign Trigger – Sends SMS messages based on campaign events (for example when a lead is accepted)
Both configurations use the same Twilio API endpoint.
In this guide we'll be going through the set up for a Direct Post Buyer.
1) Create a New Buyer
- Navigate to Buyers
- Click Create New Buyer
- Set the Buyer Type to Direct Post
Twilio Buyer Configuration
Configure the buyer with the following settings.
| Setting | Value |
|---|---|
| Post Type | POST |
| Posting URL | https://api.twilio.com/2010-04-01/Accounts/{{ACCOUNT_SID}}/Messages.json |
Replace {{ACCOUNT_SID}} with your Twilio Account SID.
2) Add Custom Header
Add the following custom header:
| Key | Value |
|---|---|
| Authorization | Basic {{TOKEN}} |
To get the value for {{TOKEN}} you need to take your Twilio Account_SID and the Auth_Token values you got in the first part of the tutorial and use them as Usename and Password to get your Basic token value. Use a website like https://www.debugbear.com/basic-auth-header-generator and set it up with: Username = Account_SID
Pasword = Auth_Token
From there you will be presented with the full header that will look something like "Authorization: Basic QjkzZjc1YTBzZDlmMDlzYWRmOGQ4ODBlMDBkMTljYTQ3OmRjZG9pYXM5ZjBhdzNvaWFpZG9pMzQzMmU3NzdiYWYwMGJk" - copy the value after "Basic" and swap that in place of {{TOKEN}}

3) Configure the Buyer Payload
The Twilio messaging API requires three parameters:
- To
- From
- Body
-
To (Recipient Phone Number)
This is the phone number that will receive the SMS message.
The number must be formatted using E.164 format:
+12125551234
This format includes Country code + 10 digit phone number, no spaces or special characters.
Pro Tip - Use a Computed Field in Lead Prosper to automatically convert incoming phone numbers into the correct format.

-
From (Twilio Sending Number)
This is the Twilio phone number that will send the message.
Example: +19195551234
This value can typically be hardcoded in the payload since it will always be the same Twilio number.
-
Body (SMS Message Content)
The Body field contains the message that will be sent.
Example:
Body=Name: {{first_name}} {{last_name}}, Phone: {{phone}}, Email: {{email}}
You can include Campaign fields, Computed fields, System fields, and hardcoded values.

SMS Formatting Tips
- Add Line Breaks
To add a new line in the SMS message, use %0a
Example: Body=Name: {{first_name}} {{last_name}}%0aPhone: {{phone}}%0aEmail: {{email}}
- Avoid Ampersands (&)
Ampersands can break the payload formatting.
Instead of: Name & Phone
User: Name and Phone
4) Configure Response Mapping
Response mappings tell Lead Prosper when Twilio has accepted the message.
Accepted Response
Configure the accepted response mapping as follows:
| Setting | Value |
|---|---|
| Condition | key equal with |
| Key | status |
| Value | queued |
When Twilio returns queued , the message has been accepted for delivery.
Duplicate Response
Configure the duplicate response mapping as follows:
| Setting | Value |
|---|---|
| Condition | response contains |
| Key | default |
| Value | duplicate |

5) Save and Test
- Save the buyer configuration
- Send a test lead
- Confirm that the response is Accepted
You should also see the message appear in your Twilio Messaging Logs.
Once your Twilio account is set up and you’ve purchased a phone number, the rest of the process is straightforward. Simply retrieve your Account SID and Auth Token from the Twilio dashboard and use them to configure the Twilio API connection in Lead Prosper. From there, you can begin sending SMS messages either through a Direct Post Buyer or a Campaign Trigger, depending on how you want the messages to be initiated. Both methods rely on the same Twilio API endpoint and payload structure, making it easy to implement SMS messaging across different workflows in your campaigns.