SalesHose · Docs

Developer documentation

Embed a SalesHose form anywhere

SalesHose builds conversational lead-qualification forms that score, route, and book your leads. This is everything you (or an AI coding tool) need to drop one into any website and read its data over a public REST API.

QuickstartEmbed modesPlatform guidesJavaScript APIREST APIBuild with AI

Quickstart

Every form has a slug (e.g. demo). Drop these two lines where you want the form to appear:

<div data-saleshose="demo"></div>
<script src="https://saleshose.com/embed.js" async></script>

That's it. The form loads in a sandboxed iframe, so it never clashes with your site's CSS or JavaScript. Replace demo with your own form's slug (find it in the builder, or in the form URL saleshose.com/f/your-slug).

Embed modes

Inline

Renders the form inside a container on the page. Set an optional data-height (default 560px).

<div data-saleshose="demo" data-height="600"></div>
<script src="https://saleshose.com/embed.js" async></script>

Popup button

Renders a button; the form opens in a centered modal.

<div data-saleshose="demo" data-mode="popup" data-label="Talk to sales"></div>
<script src="https://saleshose.com/embed.js" async></script>

Chat bubble (one line)

A floating launcher in the bottom-right corner — no container needed. Ideal for pasting into any site once.

<script src="https://saleshose.com/embed.js" data-saleshose="demo" data-mode="bubble" data-label="💬 Chat" async></script>
AttributeWhereValues
data-saleshosediv or scriptyour form slug (required)
data-modediv or scriptinline (default for div) · popup · bubble (default for script)
data-labeldiv or scriptbutton / bubble text
data-heightdiv (inline)pixels, default 560

Platform guides

PlatformHow
WordPressAdd a Custom HTML block and paste the snippet. (Classic editor: Text tab.)
ShopifyAdd a Custom Liquid section (or an HTML block in a page) and paste the snippet.
HubSpotDrag an Embed / Rich text → Source code module onto the page and paste the snippet.
WebflowDrop an Embed element and paste the snippet.
Framer / Wix / SquarespaceUse the platform's Embed / Custom Code block.
Plain HTML / any sitePaste anywhere in your HTML.

React / Next.js

import { useEffect } from "react";

export default function SalesHoseForm({ slug }) {
  useEffect(() => {
    const s = document.createElement("script");
    s.src = "https://saleshose.com/embed.js";
    s.async = true;
    document.body.appendChild(s);
    return () => { s.remove(); };
  }, []);
  return <div data-saleshose={slug} />;
}

JavaScript API

Once embed.js has loaded, a global SalesHose object is available:

// Open any form in a modal
SalesHose.open("demo");

// Render programmatically
SalesHose.render({ slug: "demo", target: "#lead-form", mode: "inline" });
SalesHose.render({ slug: "demo", mode: "bubble", label: "Need a quote?" });

// Close the modal
SalesHose.close();

When a form is submitted inside an embed, it posts a message to the host page you can listen for:

window.addEventListener("message", (e) => {
  if (e.data && e.data.type === "saleshose:submitted") {
    console.log("Lead captured for", e.data.slug, "score", e.data.score);
  }
});

Public REST API

No key required for the public endpoints below. Base URL https://saleshose.com.

Get a form's config

GET /api/forms/{slug}

200 → { "slug": "demo", "title": "…", "config": { "blocks": [...], "theme": {...} } }

Submit a response

Send the answers keyed by each block's name. Returns the computed lead score and the resolved ending (including any assigned rep / booking link).

POST /api/forms/{slug}/responses
Content-Type: application/json

{
  "data": { "name": "Jane", "email": "jane@acme.com", "budget": "€20k+" },
  "completed": true,
  "meta": { "utm_source": "google" }
}

200 → {
  "ok": true,
  "id": "…",
  "score": 105,
  "ending": { "title": "…", "book": { "url": "https://cal.com/rep/intro" }, "rep": "Alice" }
}
Tip: pass a stable "id" with "completed": false to capture partial responses, then re-POST the same id with "completed": true to finish it.

Track funnel events (optional)

POST /api/forms/{slug}/events
{ "kind": "view" | "start" | "complete", "session": "…" }

Build with AI

Building a SalesHose integration with an AI coding tool (Cursor, v0, Lovable, Claude, Copilot…)? Point it at these machine-readable references:

Or paste this prompt:

Add a SalesHose conversational lead form to my site.
Embed it with:
<div data-saleshose="MY_SLUG"></div>
<script src="https://saleshose.com/embed.js" async></script>
Modes: data-mode="inline|popup|bubble". JS API: SalesHose.open(slug),
SalesHose.render({slug,target,mode,label}). It loads in an iframe.
Full docs: https://saleshose.com/docs