HTTP End Point Template
How to Set Up an HTTP Destination for a Webhook Test in AudienceSync
This guide walks you through the exact steps to set up and test an HTTP destination using Webhook.site with AudienceSync.
✅ Step 1: Prepare a Webhook Testing URL
- Go to https://webhook.site
- Copy the unique URL provided (e.g.,
https://webhook.site/xxxx-xxxx-xxxx
)
- This will be your temporary HTTP destination to catch and inspect POST requests.
✅ Step 2: Create a New HTTP Destination in AudienceSync
- Navigate to
Destinations → Add Destination → HTTP
- Fill out the fields:
- Destination URL: Paste the Webhook.site URL
- HTTP Method:
POST
- Headers:
- Click "Add Header"
- For each header, map the Key and Value:
Content-Type
→application/json
- (Optional)
Authorization
→Bearer test123token456
🔐 You must explicitly map each header field in the destination setup screen. This ensures that the headers are included correctly in every outgoing request to the webhook or API endpoint.
In AudienceSync's destination setup screen, you'll see a section labeled "Headers". Here, you must manually define each header by specifying a key-value pair. These headers are sent along with the HTTP request and are often required by APIs for proper request handling, authentication, or even routing.
🔧 Examples of Header Mappings (Including User Data Fields)
Sometimes you'll see custom headers that begin with x-
, like x-user-name
. The x-
prefix is a conventional way to indicate that a header is non-standard or proprietary — in other words, it's not part of the official HTTP specification like Content-Type
or Authorization
.
You do not need to use the x-
prefix unless the destination API specifically requires it. It's just a naming convention. If you're sending metadata like a user's name, email, or phone number, and the receiving endpoint expects plain field names, you can name the headers without the x-
prefix — such as name
, email
, or phone_number
.
Below are examples of both styles:
Header Key | Header Value | Purpose |
Content-Type | application/json | Tells the server the format of the request body |
Authorization | Bearer your_token_here | Required for Bearer token authentication |
name | John Doe | Custom metadata: user's name passed in header |
email | john@example.com | Custom metadata: user's email passed in header |
phone_number | +15551234567 | Custom metadata: user's phone number passed in header |
x-user-email | john@example.com | Custom metadata: user's email passed in header |
x-user-phone | +15551234567 | Custom metadata: user's phone number passed in header |
⚠️ Note: AudienceSync may not support dynamic templating ({{ event.data.* }}) inside headers. Use static values unless explicitly documented otherwise.
💡 Notes:
- Do not use quotes around keys or values unless the receiving API specifically requires them.
- If you're unsure what headers are needed, consult the documentation for the API you’re integrating with.
- Headers are key for authentication (e.g., Bearer tokens), content negotiation (
Accept
), or routing metadata (like user ID, email, etc.).
Correctly setting these headers is critical for successful integration, especially when dealing with platforms like HubSpot, Slack, or custom APIs expecting contextual user data. for successful integration, especially when dealing with platforms like HubSpot, Slack, or any service requiring authentication or specific content formats.. This ensures headers are correctly included in the request to the webhook or API endpoint.
✅ Step 3: Configure Field Mapping
In the sync setup:
- Stream Name: Select the name of the destination stream (e.g.,
http
)
- Sync Mode: Choose
incremental
orfull_refresh
- Cursor Field: Optional — use if syncing incrementally based on a timestamp
Map Custom Fields to HTTP:
Audience Field | HTTP Field |
EMAIL | email |
FIRST_NAME | first_name |
COMPANY | company |
These define the keys that will appear in your outgoing JSON payload.
✅ Step 4: Define the Body Template
In the body template section, use this structure:
{
"email": "{{ event.data.email }}",
"first_name": "{{ event.data.first_name }}",
"company": "{{ event.data.company }}",
"timestamp": "{{ event.timestamp }}"
}
You can adjust field names to match your column names from the audience query.
✅ Step 5: Run the Test
- Complete the destination and sync setup.
- Go to the destination and click "Test Destination".
- Watch the Webhook.site page for the incoming request.
You should see:
- A JSON payload with mapped fields
- Headers including
Content-Type
andAuthorization
if added
ℹ️ Tips for Success
- Always use
snake_case
for outgoing HTTP field names
- Double-check that mapped fields in your sync match what you're using in the body template
- You must map headers explicitly in the destination setup for them to be sent
- For testing Bearer tokens, any dummy token is acceptable on Webhook.site
You're now ready to send real data or integrate with production APIs like HubSpot by adjusting the destination URL and body format.
📌 Reminder: This Is a Template
This guide is designed as a flexible template for testing and integrating HTTP destinations in AudienceSync. If you're connecting to a real API:
- ✅ Replace the Webhook.site URL with the real API endpoint (e.g.,
https://api.hubapi.com/crm/v3/objects/contacts
)
- ✅ Adjust the headers (e.g., correct
Authorization
token, custom headers, etc.)
- ✅ Update the body template to match the required schema for that API
- ✅ Review the destination API documentation to ensure you send exactly what it expects
Every API has different expectations, so be sure to reference the relevant docs and adjust your setup accordingly.
Last updated on August 6, 2021