Webhook API

The Webhook API gives you direct access to your lead data via a JSON endpoint. Pull your leads into any system, app, or custom integration.

This feature requires a PRO plan.


How It Works

Viewers provides a JSON API endpoint that returns your lead data. Make a GET request to your unique URL, and you’ll receive a JSON response with all your leads and their enrichment data.

Use it however you want - feed it into a custom CRM, build your own dashboards, sync with internal tools, or integrate with any platform that can make HTTP requests.


Getting Your API Endpoint

  1. Log in to your Viewers dashboard
  2. Go to Automations
  3. Find the Webhook API section
  4. Copy your unique JSON endpoint URL

Your URL includes your API key, so keep it private. Anyone with this URL can access your lead data.


Making a Request

Send a GET request to your endpoint URL:

GET https://app.viewers.com/api/leads/YOUR-API-KEY

No additional headers or authentication required - your API key is embedded in the URL.


Response Format

The endpoint returns a JSON object with your leads:

json

{
  "success": true,
  "count": 8,
  "limit": 100,
  "website": {
    "domain": "yoursite.com"
  },
  "leads": [
    {
      "name": "Girish Redekar",
      "email": "girish@sprinto.com",
      "email_valid": "true",
      "email_type": "business",
      "module": "feedback",
      "question": "How does this work?",
      "device_type": "desktop",
      "browser": "Chrome",
      "os": "macOS",
      "country_code": "us",
      "company": {
        "name": "Sprinto",
        "logo": "/img/company-logos/company_105.jpg",
        "website": "sprinto.com",
        "phone": "+1 833 497 7663",
        "revenue": null,
        "employees": "251-1K",
        "social": ["https://linkedin.com/in/girishredekar"]
      },
      "coworker_emails": [
        "sales@sprinto.com",
        "support@sprinto.com",
        "info@sprinto.com"
      ],
      "page_url": "https://yoursite.com/pricing",
      "referrer": "direct",
      "created_at": "2025-11-25 02:43:37",
      "created_at_timestamp": 1764038617
    }
  ]
}

Field Reference

Response Metadata

FieldDescription
successWhether the request succeeded
countNumber of leads returned
limitMaximum leads per request
website.domainYour website domain

Lead Fields

Contact Information

FieldDescriptionExample
nameVisitor’s nameGirish Redekar
emailEmail addressgirish@sprinto.com
email_validVerification statustrue, false, or unknown
email_typeEmail typebusiness or personal

Lead Context

FieldDescriptionExample
moduleWhich module captured the leadchat, feedback, custom, newsletter, share, contactus, discount
questionMessage or response from visitorHow does this work?
page_urlPage where lead was capturedhttps://yoursite.com/pricing
referrerTraffic sourcedirect, google, or a referring URL
created_atTimestamp (formatted)2025-11-25 02:43:37
created_at_timestampUnix timestamp1764038617

Device Information

FieldDescriptionExample
device_typeDevice categorydesktop or mobile
browserBrowser nameChrome, Safari, Firefox
osOperating systemmacOS, Windows, iPhone
country_codeCountry codeus, uk, ca

Enrichment Data

FieldDescriptionExample
company.nameBusiness nameSprinto
company.websiteCompany websitesprinto.com
company.phoneCompany phone+1 833 497 7663
company.employeesEmployee range251-1K, 51-250, 11-50
company.revenueRevenue estimateWhen available
company.logoCompany logo path/img/company-logos/company_105.jpg
company.socialSocial profile URLsArray of LinkedIn URLs
coworker_emailsOther contacts at companyArray of email addresses

Example: cURL

bash

curl "https://app.viewers.com/api/leads/YOUR-API-KEY"

Example: JavaScript

javascript

fetch('https://app.viewers.com/api/leads/YOUR-API-KEY')
  .then(response => response.json())
  .then(data => {
    console.log(`Retrieved ${data.count} leads`);
    data.leads.forEach(lead => {
      console.log(`${lead.name} - ${lead.email}`);
    });
  });

Example: Python

python

import requests

response = requests.get('https://app.viewers.com/api/leads/YOUR-API-KEY')
data = response.json()

print(f"Retrieved {data['count']} leads")
for lead in data['leads']:
    print(f"{lead['name']} - {lead['email']}")

Example: PHP

php

$response = file_get_contents('https://app.viewers.com/api/leads/YOUR-API-KEY');
$data = json_decode($response, true);

echo "Retrieved " . $data['count'] . " leads\n";
foreach ($data['leads'] as $lead) {
    echo $lead['name'] . " - " . $lead['email'] . "\n";
}

Null Values

Not every lead will have every field populated:

  • Personal emails: Leads using Gmail, Yahoo, or other personal email addresses won’t have company data
  • New/small businesses: Some companies may not have public data available
  • Optional fields: Fields like revenue or social may be null even for business emails

Always check for null values before using enrichment data in your code.


Rate Limits

There are no hard rate limits at the moment, but keep your requests reasonable. Polling every 5–15 minutes is plenty for most use cases. We may throttle or block abusive requests and IPs.


Security

Your API key is embedded in your endpoint URL. Treat it like a password:

  • Don’t share it publicly
  • Don’t commit it to public code repositories
  • Don’t expose it in client-side JavaScript on public websites

If you believe your API key has been compromised, contact us to generate a new one.


Frequently Asked Questions

What format is the response? JSON. Set your Content-Type to application/json if your client requires it.

Is there pagination? The endpoint returns up to the limit shown in the response. If you have more leads than the limit, contact us about pagination options.

Can I filter by date or module? Not currently. The endpoint returns all leads. Filter the response in your own code.

How often should I poll? Every 5–15 minutes is reasonable. More frequent polling isn’t necessary and may be throttled.

Is HTTPS required? Yes. All API requests must use HTTPS.


Need Help?

If you have questions about the Webhook API or need help with your integration, contact us.