Developer API

AutoGlass CRM API Reference

Integrate your website and other systems with the CRM: embed the instant-quote widget (price + online booking), or send in leads from any contact form — every endpoint here is documented with request fields, responses and copy-paste examples.

https://www.autoglass-crm.com

Overview

The CRM exposes a small, focused HTTP API. All requests and responses are JSON, sent over HTTPS. You authenticate with an API key you generate inside the CRM. CORS is enabled, so you can call the public endpoints directly from browser JavaScript on your own website.

REST + JSON

Plain HTTPS requests with JSON bodies — no SDK required.

API-key auth

Per-website keys, generated and revoked in Settings.

Copy-paste ready

cURL, fetch and a full HTML form for every endpoint.

Authentication

Create a key in Settings → Website Leads (Admin only). You can issue one key per website, see how many leads each has received, and disable or delete a key at any time. The full key (format agk_…) is shown once — copy it immediately.

Send the key on every request in either header:

http
X-API-Key: agk_9f3a1b…
# — or —
Authorization: Bearer agk_9f3a1b…
🔒

A key used in browser code is visible to visitors. That's acceptable for lead intake (it can only create leads and can be revoked), but for full secrecy proxy the request through your own server and add the header there.

Quote Widget

Live

The embeddable instant-quote funnel: a visitor enters their ZIP and vehicle (VIN or year/make/model), leaves their contact info — a Lead is created that instant — then sees their price (choosing between glass options when several fit) and can book an appointment on the spot. Booking converts the lead into a client + job, ready to dispatch.

Drop-in embed (recommended)

Two lines on any website — plain HTML, WordPress, Webflow, React. It renders in a Shadow DOM (no CSS conflicts), and all branding, wording, colors and booking behaviour are managed centrally in Settings → Quote Widget — edits there go live on every site without touching them.

html
<div data-autoglass-quote data-api-key="agk_your_key"></div>
<script src="https://www.autoglass-crm.com/embed/quote-widget.js" async></script>

Container options

Optional data-* attributes override the CRM-configured values for that page only:

AttributePurpose
data-api-keyRequired. The site's key (agk_…).
data-shop-idRoute the lead + pricing to a specific shop.
data-accentAccent color (any CSS color).
data-theme"light" or "dark".
data-companyCompany name shown in the widget header.
data-phonePhone number for the "call us" buttons.
data-title / data-subtitle / data-cta / data-disclaimerWording overrides.
data-compare-percent"Other companies charge" markup %. 0 hides the comparison.
data-sourceAttribution label stored on the lead (default WEBSITE).

Under the hood (build your own UI)

The widget drives these public endpoints — all JSON, CORS-enabled, authenticated with the same X-API-Key header. The follow-up calls reference the lead through the signed bookingToken returned by POST /api/public/quote, so a visitor can only act on their own quote. Prices are final customer prices — vendor costs and part numbers are never exposed.

GET
https://www.autoglass-crm.com/api/public/quote/config

Branding, texts, services, booking days/windows — merged from the CRM settings.

GET
https://www.autoglass-crm.com/api/public/quote/vehicle-options

Cascading Year → Make → Model → Body lists (?type=years|makes|models|bodies).

POST
https://www.autoglass-crm.com/api/public/quote

Create the lead. With deferQuote:true returns instantly (quote:null + bookingToken); without it, also prices in the same call.

POST
https://www.autoglass-crm.com/api/public/quote/price

Phase two: price the saved lead (slow — live vendor lookup; show progress). Updates the lead with the shown options.

POST
https://www.autoglass-crm.com/api/public/quote/select

Record which glass option the customer picked — stored on the lead.

POST
https://www.autoglass-crm.com/api/public/quote/book

Book a day (tomorrow+) + Morning/Evening window + address. Converts the lead: client + job appear in the CRM.

GET
https://www.autoglass-crm.com/api/public/quote/places

Address autocomplete for the booking form (server-side Google Places proxy).

Full request/response schemas and a step-by-step integration recipe live in the repo doc docs/embeddable-quote-widget.md.

Website Leads

Live

Turn a website contact / quote form into a CRM lead. Each submission becomes a Lead tagged 🌐 Website, attributed to the originating site.

POSThttps://www.autoglass-crm.com/api/public/leads

Request body

JSON. phone is the only strictly required field, plus a name (name, or firstName + lastName).

FieldTypeRequiredNotes
namestringname or firstFull name; split into first/last automatically.
firstNamestringname or firstUse instead of name if you have separate fields.
lastNamestringoptionalOptional.
phonestringrequiredMinimum 7 characters.
emailstringoptionalValidated if present.
vinstringoptionalRecommended — drives accurate glass lookup.
yearnumberoptional1900–2100.
makestringoptionalOptional.
modelstringoptionalOptional.
serviceTypestringoptionalFree text e.g. "windshield repair" — mapped to a job type.
jobTypestringoptionalSame as serviceType; either works.
addressstringoptionalService location.
citystringoptional
statestringoptional
zipstringoptional
messagestringoptionalCustomer message → stored as customer notes.
websitestringoptionalOriginating page/site; overrides auto-detected source.
shopIdstringoptionalRoute the lead to a specific shop.
sourcestringoptionalPublic source only (WEBSITE, GOOGLE, FACEBOOK…). Defaults WEBSITE.

Responses

201Created. { "ok": true, "leadNumber": "LD-2026-000045", "id": "…" }
400Body was not valid JSON.
401Missing, unknown, or revoked API key.
422Validation failed — body includes issues.fieldErrors.
500Could not save the lead — retry.

Examples

bash
curl -X POST https://www.autoglass-crm.com/api/public/leads \
  -H "Content-Type: application/json" \
  -H "X-API-Key: agk_9f3a1b…" \
  -d '{
    "name": "Jane Doe",
    "phone": "555-123-4567",
    "email": "jane@example.com",
    "vin": "1HGCM82633A004352",
    "serviceType": "windshield repair",
    "message": "Rock chip on the highway"
  }'

What happens to the lead

  • • Created with source = WEBSITE and a unique number (LD-YYYY-NNNNNN).
  • • Attributed to the originating website (stored on the lead and shown with a 🌐 Website flag).
  • • Routed to a shop: payload shopId → default shop → the only active shop.
  • • Appears instantly in Leads, newest first.

Hostinger guide

No-code

Have a website built on Hostinger? You can connect it without writing any code — paste one block into an Embed element. This works for the Hostinger Website Builder, WordPress, or a plain HTML site.

  1. 1In the CRM, go to Settings → Website Leads, create a key (optionally routed to a shop), and copy it.
  2. 2In Hostinger Website Builder → Add element → Advanced → Embed code (WordPress: use the free WPCodeplugin as an HTML snippet; plain HTML: paste inside <body>).
  3. 3Paste the block below, replace agk_PASTE_YOUR_KEY_HERE with your key, then Publish.
html
<!-- AutoGlass CRM lead form -->
<form id="agc-lead-form" style="max-width:480px;display:grid;gap:10px">
  <input name="name"  placeholder="Full name*"  required />
  <input name="phone" placeholder="Phone*" required />
  <input name="email" type="email" placeholder="Email" />
  <input name="vin"   placeholder="VIN (windshield / door jamb)" />
  <select name="service">
    <option value="WINDSHIELD_REPLACEMENT">Windshield replacement</option>
    <option value="WINDSHIELD_REPAIR">Windshield chip / crack repair</option>
    <option value="DOOR_GLASS_FRONT_LEFT">Door glass — front left</option>
    <option value="DOOR_GLASS_FRONT_RIGHT">Door glass — front right</option>
    <option value="DOOR_GLASS_REAR_LEFT">Door glass — rear left</option>
    <option value="DOOR_GLASS_REAR_RIGHT">Door glass — rear right</option>
    <option value="BACK_GLASS">Back glass / rear window</option>
    <option value="OTHER">Something else</option>
  </select>
  <textarea name="message" placeholder="Tell us what happened" rows="3"></textarea>
  <button type="submit">Request a quote</button>
  <p id="agc-status"></p>
</form>

<script>
(function () {
  var CRM_ENDPOINT = "https://www.autoglass-crm.com/api/public/leads";
  var API_KEY = "agk_PASTE_YOUR_KEY_HERE";  // from Settings → Website Leads
  var form = document.getElementById("agc-lead-form");
  var status = document.getElementById("agc-status");
  form.addEventListener("submit", function (e) {
    e.preventDefault();
    status.textContent = "Sending…";
    fetch(CRM_ENDPOINT, {
      method: "POST",
      headers: { "Content-Type": "application/json", "X-API-Key": API_KEY },
      body: JSON.stringify({
        name: form.name.value, phone: form.phone.value, email: form.email.value,
        vin: form.vin.value, jobType: form.service.value,
        message: form.message.value, website: location.hostname
      })
    })
      .then(function (r) { return r.json(); })
      .then(function (d) { form.reset(); status.textContent = d.ok ? "Thanks! We'll be in touch." : "Please check your details."; })
      .catch(function () { status.textContent = "Something went wrong — please call us."; });
  });
})();
</script>

The endpoint is already filled in with your CRM domain. Only the API key needs replacing.

Open the full Hostinger guide

Ready to connect a website?

Generate a key and paste in one of the snippets above.

Get an API key

More endpoints will appear here as they ship. Questions? Contact your CRM administrator.