Developer Guide

Read Leads, Conversations and Analytics

Pull new leads and conversations into your CRM, a spreadsheet or an automation, and put your assistant's numbers on your own dashboard.

Before you start

  • A key with the data:read scope. Without it these endpoints answer 403. The key reads leads with their contact details, so keep it on a server or in your automation tool, never in a web page.
  • The leads and conversations endpoints belong to a plan feature. When the plan does not include it, they answer 403 with "error": "feature_disabled". The analytics endpoints need only the scope.
  • Times are UTC. Timestamps in these responses can come without a Z suffix; read them as UTC.

Poll for new leads and conversations

These are plain polling endpoints. Any tool that can send a GET with a header can use them: the webhook or HTTP steps of Zapier, Make and n8n, or a script on a schedule. This is not a Zapier app: you connect through the generic step. If you would rather be called than poll, use webhooks.

GET /v1/zapier/leads
GET /v1/zapier/conversations

Both take since, an ISO 8601 UTC time such as 2026-12-04T08:00:00Z, and return the rows created at or after it, newest first, at most 50 per call. Without since you get the last hour.

Polling without gaps or duplicates: keep the ids you have already processed and drop repeats, because a row created exactly at since comes back on the next call. Poll often enough that fewer than 50 new rows arrive between two calls: older rows beyond the 50 are not returned.

cURL
curl "https://api.slatech.ai/v1/zapier/leads?since=2026-12-04T08:00:00Z" \
  -H "X-Api-Key: $SLATECH_DATA_KEY"
Python
import os
import requests

HEADERS = {"X-Api-Key": os.environ["SLATECH_DATA_KEY"]}
seen = set()

def poll_leads(since_iso):
    resp = requests.get(
        "https://api.slatech.ai/v1/zapier/leads",
        headers=HEADERS,
        params={"since": since_iso},
        timeout=30,
    )
    resp.raise_for_status()
    new = [lead for lead in resp.json() if lead["id"] not in seen]
    seen.update(lead["id"] for lead in new)
    return new  # newest first, at most 50 per call
JavaScript
const since = new Date(Date.now() - 15 * 60 * 1000).toISOString();
const res = await fetch(
  `https://api.slatech.ai/v1/zapier/leads?since=${encodeURIComponent(since)}`,
  { headers: { "X-Api-Key": process.env.SLATECH_DATA_KEY } },
);
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const leads = await res.json(); // newest first, at most 50

A lead carries id, name, email, phone, message, vertical, timestamp, status and pageUrl. Any of the contact fields can be null.

JSON
[
  {
    "id": "a6c4e1d2-93f0-4b7e-8d25-1f3b6a9c0e47",
    "name": "Dana Levi",
    "email": "dana@example.com",
    "phone": "+972501234567",
    "message": "Do you have a slot on Thursday afternoon?",
    "vertical": null,
    "timestamp": "2026-12-04T09:20:11.403",
    "status": "Pending",
    "pageUrl": "https://example.com/booking/"
  }
]

A conversation row is one question and its answer: id, sessionId, question, answer, timestamp, wasResolved, sourceClicked, userCountry and pageUrl.

One whole conversation

GET /v1/zapier/conversations/{sessionId}

Every turn of one conversation, oldest first: id, question, answer, timestamp, wasResolved. The sessionId is the one the widget or your own ask requests sent.

Check the key

GET /v1/zapier/test

Returns {"ok": true, "siteId", "siteName", "siteDomain"} when the key, the scope and the plan feature are all in order. Use it as the connection test of your automation.

cURL
# Recent turns (default: the last hour)
curl "https://api.slatech.ai/v1/zapier/conversations?since=2026-12-04T08:00:00Z" \
  -H "X-Api-Key: $SLATECH_DATA_KEY"

# Every turn of one conversation, oldest first
curl https://api.slatech.ai/v1/zapier/conversations/7d0f6a52-3c1e-4b8e-9f0a-2a6c5e1b9d47 \
  -H "X-Api-Key: $SLATECH_DATA_KEY"

# Check the key
curl https://api.slatech.ai/v1/zapier/test -H "X-Api-Key: $SLATECH_DATA_KEY"

Analytics for your own dashboard

GET /v1/embed/analytics/queries-summary
GET /v1/embed/analytics/queries-by-day
GET /v1/embed/analytics/quality-trend

Aggregates only, no question text and no contact details. All three take days, from 1 to 90, default 30; the window ends now and starts at midnight UTC of the first day.

  • queries-summary: totalQueries, resolved, resolutionRate (a percentage), avgConfidence (0 to 100) and topIntents. Today topIntents groups questions by their utmSource value.
  • queries-by-day: one entry per day with count and resolved, including days with zero.
  • quality-trend: per day avgConfidence and avgFactuality (0 to 100) and the number of samples; the scores are null on days without samples.
cURL
curl "https://api.slatech.ai/v1/embed/analytics/queries-summary?days=30" \
  -H "X-Api-Key: $SLATECH_DATA_KEY"

curl "https://api.slatech.ai/v1/embed/analytics/queries-by-day?days=14" \
  -H "X-Api-Key: $SLATECH_DATA_KEY"

curl "https://api.slatech.ai/v1/embed/analytics/quality-trend?days=14" \
  -H "X-Api-Key: $SLATECH_DATA_KEY"
JSON
// queries-summary
{
  "from": "2026-11-05",
  "to": "2026-12-04",
  "totalQueries": 412,
  "resolved": 371,
  "resolutionRate": 90.0,
  "avgConfidence": 78.4,
  "topIntents": [ { "intent": "newsletter", "count": 37 } ]
}

// queries-by-day
{ "from": "2026-11-21", "to": "2026-12-04",
  "series": [ { "date": "2026-11-21", "count": 12, "resolved": 11 } ] }

// quality-trend (null scores on days without samples)
{ "from": "2026-11-21", "to": "2026-12-04",
  "series": [ { "date": "2026-11-21", "avgConfidence": null, "avgFactuality": null, "samples": 0 } ] }

Related