> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avoca.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Speed to Lead

> Convert leads instantly with automated outreach the moment they arrive

## Overview

Avoca's Speed to Lead platform ensures you never miss a hot lead. Our AI-powered system queues new leads for outreach the instant they arrive and dials within minutes — subject to your configured calling hours, retry rules, and throttles — dramatically increasing your conversion rates by reaching prospects when their interest is highest.

<Note>
  See how the audience builder routes fresh leads into Speed to Lead campaigns.
</Note>

<video controls className="w-full aspect-video rounded-xl mb-6">
  <source src="https://mintcdn.com/avoca/0eOobP6-j0LeCscs/videos/Audiences.mp4?fit=max&auto=format&n=0eOobP6-j0LeCscs&q=85&s=4c3f5621686e9653846d56bb37148b06" type="video/mp4" data-path="videos/Audiences.mp4" />

  Your browser does not support the video element.
</video>

## Dynamic Speed to Lead in Avoca

How Avoca dynamically turns any inbound lead (emails, partner feeds, forms, ads, or manual adds) into a live, branded conversation within minutes, then keeps nurturing if the first touch does not connect.

## Flow at a glance

1. Capture leads from your shared lead inbox and connected sources (forms, ads, partner feeds, or CSV/manual adds).
2. Parse the message with Avoca's lead extractor to pull name, phone, email, address, job summary, and source; dedupe against recent leads.
3. Route the lead to the right team list and queue it for immediate outreach.
4. Auto-schedule an outbound call using your configured caller ID, greeting, and assistant persona.
5. The AI caller dials within minutes, follows your script and brand, and respects your retry rules and quiet hours.
6. Outcomes are recorded: answered vs. voicemail, transcript, summary, recordings, and bookings.
7. Follow-up texts/emails and multi-step workflows continue until the lead is reached or booked.

## Lead capture

* **Lead inbox**: Avoca watches your designated inbox address for new lead emails, extracts the contact details, and identifies the source based on sender/body cues.
* **Connected sources**: Online forms, ad platforms, and partner feeds can push leads directly; Avoca normalizes and formats phones/addresses automatically.
* **Deduplication**: Leads are checked against recent records (primarily phone/email) to avoid double-calling.
* **Manual adds**: Teams can key in a lead from the admin panel to force an immediate speed-to-lead call.

## Contact speed

* **Brand-ready call setup**: Configure caller ID, brand name, assistant name/persona, and the opening script once; reuse across all incoming leads.
* **Immediate dialing**: When a valid phone arrives, Avoca schedules and launches the outbound call within your set hours and throttles.
* **Smart retries**: Optional spacing and retry limits to avoid over-dialing; holiday/quiet-hour controls keep outreach compliant.

## Outcomes and follow-up

* **Call intelligence**: Transcripts, summaries, and disposition (answered, voicemail, requested callback, booking) are captured automatically.
* **Booking-ready**: If booking is enabled, the agent can capture commitment details and pass them to your downstream system.
* **Voicemail and callbacks**: Voicemail detection flags unanswered calls and can prompt a follow-up text or rescheduled call.
* **Text/email follow-up**: Missed calls can trigger polite follow-up messages with the lead's context filled in (name, address, notes, source).

## Workflows and multi-touch

* **15-20 touchpoint journeys**: Build or use templates that mix calls, SMS, and optional emails over days or weeks, so no lead stalls after the first dial.
* **Sequences that mix calls and texts**: Leads can be enrolled in a workflow that chains calls with follow-up texts until contact or booking.
* **Progress-aware**: Each touch updates the workflow so future steps only run when needed (for example, skip SMS if the call was answered and booked).

## Visibility and analytics

* **Pickup and booking**: Track answer rate, bookings, and conversion from first touch to scheduled job.
* **Speed**: Measure time-to-first-call and time-to-first-response.
* **Sources**: Break down performance by lead source and campaign tags (including UTM data where available).
* **Quality**: Review transcripts and recordings to coach or update scripts.

## Configuration highlights

* Caller ID and assistant persona
* Greeting, script, and variables to personalize outreach
* Quiet hours, holidays, and retry spacing
* Follow-up message templates for missed calls
* Booking preferences (if you want Avoca to collect appointment intent)

## Key Features

<CardGroup cols={2}>
  <Card title="Instant Webhook Triggers" icon="bolt">
    Connect any form to trigger immediate AI-powered calls
  </Card>

  <Card title="Real-time Appointment Booking" icon="calendar">
    Schedule appointments during the first call
  </Card>
</CardGroup>

## Webhook Integration

Avoca provides a webhook that instantly triggers our AI to contact new leads. There are two ways to connect:

* **Standard intake endpoint** — `POST https://app.avoca.ai/api/outbound/speed-to-lead/ingest`, authenticated with your Avoca API key (`Authorization: Bearer avoca_…` or `X-API-Key`). Field names are resolved through your team's configured mappings, so most form/CRM payloads work as-is. See the [Speed-to-Lead Intake Webhook reference](/api-reference/webhooks/lead-intake).
* **Team-specific webhook URL** — for sources that can't send custom headers, Avoca can provision a dedicated URL that already maps to your team.

The examples below use a placeholder URL:

```
https://your-webhook-endpoint.com/speed-to-lead/abc123
```

<Info>
  Your specific webhook URL or API key is provided during onboarding by the Avoca team. At minimum, send a customer name and `phone_number` — plus any optional context like email, address, service type, and lead source.
</Info>

## Integration Guides

### Simple HTML Form Example

Here's a basic HTML form that sends data directly to the Avoca webhook:

```html theme={null}
<form
  action="https://your-webhook-endpoint.com/speed-to-lead/abc123"
  method="POST"
>
  <input type="text" name="customer_name" placeholder="Your Name" required />
  <input type="tel" name="phone_number" placeholder="Phone Number" required />
  <button type="submit">Submit</button>
</form>
```

This simple form will POST the data directly to your webhook endpoint when submitted.

### WordPress Sites

Follow these steps to add the Avoca webhook to your WordPress forms:

<Tabs>
  <Tab title="Contact Form 7">
    <Steps>
      <Step title="Install Webhook Plugin">
        Install and activate the "Contact Form 7 - Webhook" plugin from the WordPress repository
      </Step>

      <Step title="Configure Webhook">
        Go to your form settings and find the "Webhook" tab. Enter your Avoca webhook URL:

        ```
        https://your-webhook-endpoint.com/speed-to-lead/abc123
        ```
      </Step>

      <Step title="Map Form Fields">
        Map your form fields to the webhook payload:

        ```json theme={null}
        {
          "customer_name": "[your-name]",
          "phone_number": "[your-phone]",
          "email": "[your-email]",
          "message": "[your-message]",
          "source": "wordpress-cf7"
        }
        ```
      </Step>

      <Step title="Test Integration">
        Submit a test form and verify the lead appears in your Avoca dashboard
      </Step>
    </Steps>
  </Tab>

  <Tab title="WPForms">
    <Steps>
      <Step title="Open Form Settings">
        Edit your form and go to **Settings → Notifications**
      </Step>

      <Step title="Add Webhook">
        Click "Add New Notification" and select "Webhook" as the type
      </Step>

      <Step title="Configure URL">
        Enter your Avoca webhook URL and set method to POST:

        ```
        URL: https://your-webhook-endpoint.com/speed-to-lead/abc123
        Method: POST
        Format: JSON
        ```
      </Step>

      <Step title="Set Field Mapping">
        Map your fields to match Avoca's expected format
      </Step>
    </Steps>
  </Tab>

  <Tab title="Gravity Forms">
    <Steps>
      <Step title="Create Your Gravity Form">
        Go to **Forms → New Form** in your WordPress admin sidebar.

        **Required fields:**

        * **Single Line Text** → Label: "Customer Name" → Field ID (e.g., 1)
        * **Phone** → Label: "Phone Number" → Field ID (e.g., 2)

        **Common extras:**

        * **Email** → Label: "Email Address" → Field ID (e.g., 3)
        * **Single Line Text** → Label: "Street Address" → Field ID (e.g., 4)
        * **Single Line Text** → Label: "City" → Field ID (e.g., 5)
        * **Single Line Text** → Label: "State" → Field ID (e.g., 6)
        * **Single Line Text** → Label: "ZIP Code" → Field ID (e.g., 7)
        * **Paragraph Text** → Label: "Notes/Comments" → Field ID (e.g., 8)
        * **Dropdown** → Label: "Service Type" → Field ID (e.g., 9)

        **Hidden fields for metadata (optional but recommended):**

        * Hidden → Label: "Page Title" → Default Value: `{embed_page_title}` → Field ID (e.g., 10)
        * Hidden → Label: "Page URL" → Default Value: `{embed_url}` → Field ID (e.g., 11)
        * Hidden → Label: "UTM Source" → Use Populate Anything or query string capture → Field ID (e.g., 12)
        * Hidden → Label: "UTM Medium" → Field ID (e.g., 13)
        * Hidden → Label: "UTM Campaign" → Field ID (e.g., 14)
        * Hidden → Label: "Push Until Later" (accepts `true`/`false`) → Field ID (e.g., 15)

        Click **Save Form** and note all field IDs—you'll reference them when building the payload.
      </Step>

      <Step title="Install Code Snippets Plugin">
        Since the Webhooks Add-On requires an Elite plan, use this free code-based approach:

        1. Go to **Plugins → Add New**
        2. Search for **"Code Snippets"**
        3. Install and Activate
      </Step>

      <Step title="Add Webhook Code">
        Go to **Snippets → Add New** and paste this code:

        ```php theme={null}
        add_action('gform_after_submission', function($entry, $form) {
          $webhook_url = 'https://your-webhook-endpoint.com/speed-to-lead/abc123';

          $address_parts = array_filter([
            rgar($entry, '4'),
            rgar($entry, '5'),
            rgar($entry, '6'),
            rgar($entry, '7'),
          ]);

          $custom_fields = array_filter([
            'service_type' => rgar($entry, '9'),
            'utm_source'   => rgar($entry, '12'),
            'utm_medium'   => rgar($entry, '13'),
            'utm_campaign' => rgar($entry, '14'),
          ]);

          $payload = array_filter([
            // Required fields (keep IDs in sync with your form)
            'customer_name'   => trim(rgar($entry, '1')),
            'phone_number'    => trim(rgar($entry, '2')),

            // Lead contact details
            'email'           => rgar($entry, '3'),
            'address'         => rgar($entry, '4'),
            'city'            => rgar($entry, '5'),
            'state'           => rgar($entry, '6'),
            'zip'             => rgar($entry, '7'),
            'customer_address'=> $address_parts ? implode(', ', $address_parts) : null,
            'notes'           => rgar($entry, '8'),
            'message'         => rgar($entry, '8'),

            // Lead source metadata
            'service_type'    => rgar($entry, '9'),
            'page_title'      => rgar($entry, '10'),
            'page_url'        => rgar($entry, '11'),
            'source'          => 'gravity-forms',
            'utm_source'      => rgar($entry, '12'),
            'utm_medium'      => rgar($entry, '13'),
            'utm_campaign'    => rgar($entry, '14'),

            // Scheduling controls
            'push_until_later'=> rgar($entry, '15'),

            // Nested custom fields are optional and support additional data
            'custom_fields'   => $custom_fields ? $custom_fields : null,
          ], function($value) {
            return $value !== null && $value !== '';
          });

          wp_remote_post($webhook_url, [
            'method'  => 'POST',
            'headers' => ['Content-Type' => 'application/json'],
            'body'    => wp_json_encode($payload),
          ]);
        }, 10, 2);
        ```

        **Important**: Replace the field IDs ('1', '2', etc.) with your actual field IDs. Leave any unused optional fields commented out or remove them entirely. The webhook automatically formats US phone numbers to `+1XXXXXXXXXX`, so capture at least 10 digits.

        Set to **"Run snippet everywhere"** and click **Save Changes and Activate**.
      </Step>

      <Step title="Embed Form on Page">
        Edit any WordPress page and add the form using either:

        * **Gravity Forms block** (Gutenberg editor)
        * **Shortcode**: `[gravityform id="1" title="false" description="false"]`

        Replace `id="1"` with your actual form ID (shown under Forms → All Forms)
      </Step>

      <Step title="Test Your Integration">
        1. Visit the page with your form
        2. Fill in test data (use your phone number)
        3. Submit the form
        4. Verify the webhook fires and check your Avoca dashboard—calls queue instantly between 7 AM and 9 PM in the assistant's timezone, otherwise they'll schedule for the next window
      </Step>
    </Steps>

    <Info>
      **Alternative to Code Snippets**: You can add the PHP code directly to your theme's `functions.php` file if you have access. The Code Snippets plugin is recommended as it's safer and persists through theme updates.

      **Need campaign reporting?** Pass UTM parameters either as top-level fields (`utm_source`, `utm_medium`, `utm_campaign`) or inside `custom_fields`. Everything you include is stored on the raw webhook payload for analytics.
    </Info>
  </Tab>
</Tabs>

### Zapier Automation

Use Zapier to send leads from any supported app directly into Avoca's webhook.

<Steps>
  <Step title="Create a New Zap">
    In Zapier, click **Create Zap** and pick the app that collects your leads (e.g., Webflow, Typeform, Google Sheets) as the trigger. Walk through the connection prompts and pull in a recent sample lead so the fields are available later.
  </Step>

  <Step title="Add Webhooks by Zapier Action">
    Click **+ Add action**, search for **Webhooks by Zapier**, and choose the **POST** event. This action delivers the lead data to Avoca.
  </Step>

  <Step title="Configure Request">
    Set up the POST action with these settings:

    ```
    URL: https://your-webhook-endpoint.com/speed-to-lead/abc123
    Payload Type: json
    Data (key → value from trigger):
      customer_name → select the lead's full name
      phone_number  → select the lead's phone number (required)
      email         → select the lead's email (optional)
      address       → select street address (optional)
      city          → select city value (optional)
      state         → select state value (optional)
      zip           → select ZIP/postal code (optional)
      customer_address → map a single combined address if your app provides it
      notes         → select any notes or message field (optional)
      message       → map any additional description field (optional)
      service_type  → select the requested service (optional)
      page_title    → map the source page title, if available
      page_url      → map the source page URL, if available
      source        → enter `zapier` or map from your trigger
      utm_source    → map captured campaign source (optional)
      utm_medium    → map captured campaign medium (optional)
      utm_campaign  → map captured campaign name (optional)
      push_until_later → set `true` to defer outside business hours (optional)
      custom_fields__service_type → map service type (duplicate OK)
      custom_fields__utm_source   → map UTM source
      custom_fields__utm_medium   → map UTM medium
      custom_fields__utm_campaign → map UTM campaign
    Headers:
      Content-Type: application/json
    ```

    Only `customer_name` and `phone_number` are required—remove unused keys or add additional `custom_fields__{key}` entries as needed. Zapier automatically turns the double-underscore syntax into a nested `custom_fields` object.
  </Step>

  <Step title="Optional: Clean Phone Numbers">
    If your trigger sends numbers with formatting (parentheses, dashes, etc.), insert a **Formatter → Numbers → Format Phone Number** step before the webhook. Map the formatted output to `phone_number` so Avoca receives a clean 10 or 11 digit value.
  </Step>

  <Step title="Test and Publish">
    Send a test from Zapier. Confirm the Zap step returns a 201 status, then check the Avoca dashboard for the new lead. Once validated, click **Publish** to activate the Zap.
  </Step>
</Steps>

<Info>
  The webhook queues calls immediately when it's between 7 AM and 9 PM in the assistant's timezone (Eastern by default). If you send `push_until_later=true`, the call will wait for the next window even during business hours. Campaign metadata (UTM parameters or any custom keys) can live at the top level or inside `custom_fields`; the raw payload is stored for reporting either way.
</Info>

### Webflow Sites

Integrating Avoca's Speed to Lead webhook with Webflow forms:

<Steps>
  <Step title="Access Form Settings">
    In the Webflow Designer, select your form element and open the settings panel
  </Step>

  <Step title="Configure Form Action">
    In the form settings, set the **Action** field to your Avoca webhook URL:

    ```
    https://your-webhook-endpoint.com/speed-to-lead/abc123
    ```
  </Step>

  <Step title="Set Method to POST">
    Ensure the **Method** is set to `POST`
  </Step>

  <Step title="Add Hidden Fields">
    Add hidden input fields for metadata:

    ```html theme={null}
    <input type="hidden" name="source" value="webflow">
    <input type="hidden" name="form_name" value="contact-form">
    ```
  </Step>

  <Step title="Configure Field Names">
    Ensure your form input names match Avoca's expected fields:

    * `customer_name` - Full name (required)
    * `phone_number` - Phone number (required)
    * `email` - Email address (optional)
    * `message` - Any additional details (optional)
  </Step>

  <Step title="Add Success/Error States">
    Create success and error states in Webflow for better user experience
  </Step>

  <Step title="Publish and Test">
    Publish your site and submit a test lead to verify the integration
  </Step>
</Steps>

<Warning>
  **Webflow Limitation**: Native Webflow forms don't support direct webhook integration. For advanced features, consider using:

  * **Zapier or Make**: Connect Webflow forms to Avoca via automation platforms
  * **Custom Code**: Use Webflow's custom code feature to handle form submission via JavaScript
</Warning>

### Custom JavaScript Solution for Webflow

For more control over the webhook integration:

```javascript theme={null}
// Add this to your Webflow site's custom code (before </body> tag)
document.addEventListener('DOMContentLoaded', function() {
  const form = document.getElementById('your-form-id');
  
  form.addEventListener('submit', async function(e) {
    e.preventDefault();
    
    const formData = new FormData(form);
    const data = Object.fromEntries(formData);
    
    try {
      const response = await fetch('https://your-webhook-endpoint.com/speed-to-lead/abc123', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({
          customer_name: data.customer_name,
          phone_number: data.phone_number,
          email: data.email,
          message: data.message,
          source: 'webflow-custom'
        })
      });
      
      if (response.ok) {
        // Show success message
        document.querySelector('.success-message').style.display = 'block';
        form.reset();
      } else {
        // Show error message
        document.querySelector('.error-message').style.display = 'block';
      }
    } catch (error) {
      console.error('Error:', error);
      document.querySelector('.error-message').style.display = 'block';
    }
  });
});
```

## Webhook Payload Format

Your webhook accepts both JSON and form-urlencoded data with the following fields:

```json theme={null}
{
  "customer_name": "John Doe",
  "phone_number": "+1234567890",
  "email": "john@example.com",
  "customer_address": "123 Main St, Springfield, IL 62701",
  "address": "123 Main St",
  "city": "Springfield",
  "state": "IL",
  "zip": "62701",
  "notes": "Urgent repair needed",
  "message": "Emergency leak on the second floor",
  "service_type": "plumbing",
  "page_title": "Emergency Plumbing Landing Page",
  "page_url": "https://example.com/emergency",
  "source": "website-form",
  "utm_source": "google",
  "utm_medium": "cpc",
  "utm_campaign": "emergency-plumbing",
  "push_until_later": false,
  "custom_fields": {
    "preferred_contact_time": "afternoon",
    "utm_source": "google"
  }
}
```

### Required Fields

* `customer_name` - Full name of the lead
* `phone_number` - The lead's phone number (10 or 11 digits, will be formatted to +1XXXXXXXXXX)

### Optional Fields

* `email` - Email address
* `address`, `city`, `state`, `zip` - Individual address pieces
* `customer_address` - Full address as a single field (alternative to individual address fields)
* `notes` / `message` - Any additional context or questions
* `service_type` - Type of service requested
* `page_title` / `page_url` - Landing page information for attribution
* `source` - Lead source label (defaults to `API` if not provided)
* `utm_source`, `utm_medium`, `utm_campaign` - Campaign attribution (top-level)
* `push_until_later` - Set `true` to delay the call until the next 7 AM window
* `custom_fields` - Object for any additional keyed data (e.g., `utm_*`, preferences)
* Additional properties are stored verbatim in `raw_webhook` for downstream use

<Info>
  **Phone Number Formatting**: The webhook automatically formats US phone numbers to +1XXXXXXXXXX format. Both 10-digit (XXXXXXXXXX) and 11-digit (1XXXXXXXXXX) formats are accepted.
</Info>

## Testing Your Integration

<Steps>
  <Step title="Submit Test Lead">
    Fill out your form with test data (use your own phone number)
  </Step>

  <Step title="Check Avoca Dashboard">
    Log into Avoca and navigate to **Leads → Recent** to see your test lead
  </Step>

  <Step title="Verify Call Placement">
    You should receive a call within minutes of form submission (during your configured calling hours)
  </Step>

  <Step title="Review Call Recording">
    Listen to the AI conversation in your dashboard to ensure proper qualification
  </Step>
</Steps>

## Best Practices

<AccordionGroup>
  <Accordion title="Optimize Form Fields">
    Keep forms short with only essential fields. Every additional field reduces conversion by 7%. Let our AI gather additional information during the call.
  </Accordion>

  <Accordion title="Set Clear Expectations">
    Add text near your form: "We'll call you within minutes!" This prepares leads for the immediate response.
  </Accordion>

  <Accordion title="Mobile Optimization">
    Ensure phone number fields are tel input types for better mobile experience:

    ```html theme={null}
    <input type="tel" name="phone_number" placeholder="Phone Number" required>
    ```
  </Accordion>

  <Accordion title="Lead Routing Rules">
    Configure routing rules in Avoca to send different types of leads to specific team members based on service type, location, or urgency.
  </Accordion>
</AccordionGroup>

## Analytics & Reporting

Track your Speed to Lead performance in the Avoca dashboard:

* **Response Time**: Average time from form submission to call placement
* **Connection Rate**: Percentage of leads successfully reached
* **Qualification Rate**: Percentage of leads that meet your criteria
* **Conversion Rate**: Percentage of leads that book appointments

## Troubleshooting

<Warning>
  If leads aren't triggering calls, check these common issues:
</Warning>

1. **Webhook URL**: Ensure you're using your specific account webhook URL
2. **Phone Format**: Phone numbers must include country code (+1 for US)
3. **Field Names**: Form field names must match exactly (case-sensitive)
4. **SSL Certificate**: Your website must have HTTPS enabled
5. **CORS Policy**: Some forms may require CORS headers configuration

Need help? Contact our support team at [support@avoca.ai](mailto:support@avoca.ai) or through the in-app chat.
