> For the complete documentation index, see [llms.txt](https://docs.lend.com.au/lend-knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lend.com.au/lend-knowledge-base/integrations-and-services/webhooks/setting-up-webhook-connections/testing-and-troubleshooting.md).

# Testing & Troubleshooting

Before you start using webhooks in your automations, it's critical to verify that data is actually reaching your endpoint. This page shows you how to test your webhook connections and troubleshoot common issues.

### Testing Your Webhook Connection

#### Running a Test

Once you've created a webhook connection with an endpoint URL, you can send a test webhook to verify everything is working:

{% stepper %}
{% step %}

### Go to Webhook Connections

Click on your profile → **Account** → **System Integrations** → **Webhook Connections**
{% endstep %}

{% step %}

### Find your webhook

Locate the webhook connection you want to test in the connections table
{% endstep %}

{% step %}

### Click Test Connection

Click the **Test Connection** button or settings icon for that webhook
{% endstep %}

{% step %}

### Review the test payload

You'll see a preview of the test data that will be sent (similar to your Payload Preview from setup)
{% endstep %}

{% step %}

### Confirm and send

Click **Send Test** to deliver the test webhook to your endpoint
{% endstep %}

{% step %}

### Check the result

Lend will show you whether the test succeeded or failed
{% endstep %}
{% endstepper %}

#### Interpreting Test Results

**Success (Green checkmark)**

Your endpoint received the webhook and sent back a `200 OK` response within the timeout period. Your endpoint is reachable and responding.

**Failure (Red X)**

Lend couldn't deliver the webhook. Possible reasons:

* **Endpoint URL is incorrect** - Check the URL is spelled correctly and accessible
* **HTTPS certificate issue** - Your HTTPS certificate may be invalid or expired
* **Authentication failed** - Your Basic Auth credentials or HMAC signing secret doesn't match
* **Endpoint is down** - Your server isn't responding
* **Firewall/network issue** - Network rules are blocking the connection
* **Timeout** - Your endpoint took too long to respond

#### Using Test Services to Debug

If tests keep failing, use [Webhook.site](https://webhook.site) to isolate the problem:

{% stepper %}
{% step %}

### Go to webhook.site

Open [webhook.site](https://webhook.site) in your browser
{% endstep %}

{% step %}

### Copy the URL

Webhook.site generates a unique URL automatically; copy it
{% endstep %}

{% step %}

### Temporarily use webhook.site URL

In your Lend webhook connection, temporarily change the **Endpoint URL** to your webhook.site URL
{% endstep %}

{% step %}

### Run a test from Lend

Click **Test Connection** in Lend's webhook settings
{% endstep %}

{% step %}

### Watch in webhook.site

Switch to the webhook.site tab and watch for the incoming request
{% endstep %}

{% step %}

### Inspect the request

Webhook.site shows you:

* The exact JSON payload
* All headers (including authentication headers)
* Response code
* Timing information

This tells you exactly what Lend is sending.
{% endstep %}

{% step %}

### Fix your endpoint

Based on what you see, fix your endpoint code to handle the data correctly
{% endstep %}

{% step %}

### Switch back to your real endpoint

Once working, change the Endpoint URL back to your production URL
{% endstep %}
{% endstepper %}

***

### Critical Knowledge: Webhooks Don't Fire Without a Lead Owner

#### Understanding the Lead Owner Requirement

This is one of the most common misunderstandings about webhooks and automations:

{% hint style="danger" %}
**Critical Requirement:** Webhooks in automations ONLY fire if the lead has a designated **Lead Owner** assigned. If a lead has no owner, automations—including webhooks—will not execute, and no data will be sent to your endpoint.

This is a fundamental requirement of how Lend's automation system works.
{% endhint %}

#### What This Means

When you create an automation that includes a webhook action:

1. **The automation is created** - The automation rule exists and is enabled
2. **An event occurs** (e.g., new lead, status change) - The trigger happens
3. **Automation checks for Lead Owner** - Does this lead have an owner assigned?
   * **Yes** → Automation fires, webhook is sent ✓
   * **No** → Automation is skipped, no webhook is sent ✗
4. **If webhook fired**, your endpoint receives the data

#### Real-World Example

You create an automation:

```
Trigger: New lead arrives
Condition: Amount > $100k
Action: Send webhook to Slack
```

**Scenario A: Lead has owner**

* New lead arrives with $150k amount
* Lead is assigned to "John Smith"
* ✓ Automation fires → Slack webhook is sent → Message posted to Slack

**Scenario B: Lead has no owner**

* New lead arrives with $150k amount
* No one is assigned as lead owner
* ✗ Automation is skipped → No webhook sent → No Slack message

#### Common Reasons Webhooks Don't Fire

If your webhook never seems to trigger:

1. **Check lead ownership** - Ensure leads are assigned to a lead owner
2. **Check lead source** - How are leads entering Lend?
   * **Manual entry** - Make sure someone assigns an owner when creating the lead
   * **API/form** - Ensure your lead source is setting the `lead_owner` field
   * **Lender submission** - The lead comes in with an owner pre-assigned
3. **Check automation trigger** - Verify the trigger event is actually happening
4. **Check automation conditions** - Verify conditions are being met (if you have any)

#### Assigning Lead Owners

To ensure automations fire, you need a process for assigning lead owners:

**Option 1: Manual Assignment**

When team members create or receive a lead, they assign an owner immediately.

**Option 2: Default Assignment**

Set a default lead owner at the user level:

1. Go to **Account** → **Users**
2. For each team member, set them as the default owner for new leads they create

**Option 3: Automation-Based Assignment**

Create an automation that assigns owners:

```
Trigger: New lead arrives
Action: Assign to [Team Member] or [Round-robin next team member]
```

**Option 4: API Assignment**

If leads come from an external source (your website, API), ensure the lead creation includes an owner:

```json
{
  "first_name": "Jane",
  "lead_ref": "APP-001",
  "lead_owner_id": "user-123",
  ...
}
```

#### Testing Your Setup

To verify your lead owner setup is working:

{% stepper %}
{% step %}

### Create a test lead

Manually create a test lead in Lend
{% endstep %}

{% step %}

### Assign an owner

Explicitly assign a lead owner to the test lead
{% endstep %}

{% step %}

### Watch the automation

Trigger the automation (e.g., change lead status) and watch for webhook execution
{% endstep %}

{% step %}

### Check your endpoint

Verify the webhook arrived at your endpoint (check your logs or webhook.site)
{% endstep %}

{% step %}

### Create unowned lead

Create a second test lead and intentionally do NOT assign an owner
{% endstep %}

{% step %}

### Trigger again

Perform the same action that should trigger the automation
{% endstep %}

{% step %}

### Confirm webhook didn't fire

Verify NO webhook was sent for the unowned lead
{% endstep %}
{% endstepper %}

This test demonstrates the requirement and helps you catch the issue early.

***

### Managing Webhook Connections

#### Viewing Connection Details

{% stepper %}
{% step %}

### Go to Webhook Connections

Click on your profile → **Account** → **System Integrations** → **Webhook Connections**
{% endstep %}

{% step %}

### Review the connections table

See all your webhook connections with:

* **Name** - The connection name you gave it
* **Endpoint URL** - Where Lend sends data
* **Status** - Enabled/Disabled
* **Recent deliveries** - Last sent timestamp
* **Success rate** - % of deliveries that succeeded
  {% endstep %}
  {% endstepper %}

#### Disabling a Webhook

If you need to temporarily stop a webhook (e.g., while fixing your endpoint):

{% stepper %}
{% step %}

### Go to Webhook Connections

Navigate to the connections list
{% endstep %}

{% step %}

### Find the webhook

Locate the webhook you want to disable
{% endstep %}

{% step %}

### Toggle Enabled OFF

Click the **Enabled** toggle to turn it off
{% endstep %}

{% step %}

### Automations won't fire this webhook

Any automations using this webhook will skip it (no errors logged)
{% endstep %}

{% step %}

### Re-enable when ready

Click the toggle again to re-enable
{% endstep %}
{% endstepper %}

#### Editing a Webhook

To change the endpoint URL, authentication, or fields:

{% stepper %}
{% step %}

### Go to Webhook Connections

Navigate to the connections list
{% endstep %}

{% step %}

### Click the webhook name

Open the connection details
{% endstep %}

{% step %}

### Click Edit

Make your changes (endpoint URL, authentication, fields, etc.)
{% endstep %}

{% step %}

### Test the changes

Use **Test Connection** to verify your changes work
{% endstep %}

{% step %}

### Save

Click **Save** to apply changes
{% endstep %}
{% endstepper %}

#### Deleting a Webhook

To permanently remove a webhook connection:

{% stepper %}
{% step %}

### Go to Webhook Connections

Navigate to the connections list
{% endstep %}

{% step %}

### Find the webhook

Locate the webhook to delete
{% endstep %}

{% step %}

### Click Delete

Click the delete button/icon
{% endstep %}

{% step %}

### Confirm deletion

Confirm you want to delete (this removes the connection from Lend)
{% endstep %}

{% step %}

### Update your automations

Any automations using this webhook will no longer execute that action (they'll skip it)
{% endstep %}
{% endstepper %}

***

### Common Troubleshooting

#### "Webhook Test Failed" Error

**Possible causes:**

1. **Endpoint URL is unreachable**
   * Verify the URL is correct and accessible
   * Try accessing it in your browser
   * Check firewall/VPN rules allow outbound connections
2. **HTTPS certificate issue**
   * Your certificate may be expired or invalid
   * Renew your SSL certificate
   * Ensure it covers your domain
3. **Authentication failed**
   * For Basic Auth: Check username/password match
   * For HMAC: Ensure signing secret is correctly stored
   * Use webhook.site to see what headers Lend is sending
4. **Endpoint is responding with an error**
   * Check your server logs
   * Verify your endpoint code is correct
   * Test locally before deploying to production

#### Webhook Fires But Data Isn't Processing

**Possible causes:**

1. **Your endpoint isn't parsing the JSON correctly**
   * Log the incoming request body
   * Verify the JSON format matches expectations
   * Use webhook.site to inspect the exact payload
2. **Your code has a bug**
   * Check for errors in the processing logic
   * Add error handling and logging
   * Test with sample data matching Lend's payload
3. **Your system (Zapier/Make) isn't reacting**
   * Verify the webhook is triggering the next step
   * Check Zapier/Make execution logs
   * Ensure subsequent actions are configured correctly

#### "Lead Owner" Related Issues

**Automation never fires for certain leads:**

1. Check if those leads have a Lead Owner assigned
2. If not, assign an owner and test again
3. Set up a default owner or assignment automation (see earlier section)

**Webhooks work sometimes but not always:**

1. Note which leads succeed and which fail
2. Check if failed leads are missing a Lead Owner
3. Implement a process to ensure all leads are assigned

#### High Failure Rate on Webhook Deliveries

If your success rate drops below 80%:

1. **Check your endpoint performance**
   * Is it slow? Add caching or optimization
   * Is it down? Set up monitoring and alerts
2. **Check for timeouts**
   * Lend has a 30-second timeout per webhook delivery
   * If your endpoint is slower, you'll see failures
   * Optimize your code or offload to background jobs
3. **Check your credentials**
   * Authentication issues cause failures
   * Verify Basic Auth password hasn't changed
   * Verify HMAC signing secret is correct
4. **Review your logs**
   * Check Lend's webhook execution logs
   * Check your endpoint logs
   * Compare timestamps to find issues

#### Webhook Retries

If a webhook delivery fails, Lend automatically retries:

* **Attempt 1** - Immediately when the automation runs
* **Attempt 2** - 5 minutes later
* **Attempt 3** - 30 minutes later
* **Attempt 4** - 2 hours later
* **Final** - After final retry, webhook is marked failed

If your endpoint is temporarily down (e.g., maintenance), you have up to 2 hours to bring it back online before webhooks are permanently marked as failed.

***

### Next Steps

**→ Using Webhooks in Automations** - Wire your tested webhook into automations
