EMBEDDABLE CHAT AGENT

An agent for your product, live in an afternoon.

Askline is a hosted chat agent you point at your own knowledge base and drop into your website. One snippet in, one conversation out — no chatbot script trees, no canned replies.

POST /v2/ask · text/event-stream STREAMING
event: connection.created
data: {"type":"connection.created"}
event: curate
data: {"text":"Looking into that for you now.", "type":"curate"}
event: message.delta
data: {"delta":"Automation projects typically deploy in under two weeks.", "type":"message.delta"}
event: message.done
data: {"text":"Automation projects typically deploy in under two weeks.", "type":"message.done"}
event: conversation.completed
data: {"type":"conversation.completed"}
Getting started

Quick start

Paste this before the closing </body> tag. That's the whole install.

<script>
  window.asklineConfig = {
    tenantId: 'your-tenant-id'
  };
</script>
<script src="https://askline.code-mavericks.com/askline-sdk.js" async></script>

Configuration options — all optional except tenantId:

KeyDefaultWhat it does
tenantId— requiredIdentifies your site's Askline instance.
title"Chat with us"Panel header text.
greeting"Hi! I'm here to help..."First message shown when a visitor opens the widget.
placeholder"Type a message..."Input field placeholder text.
autodetectThemetrueIf true, the widget waits for your page to fully load, then matches its own colors to your site (via a theme-color meta tag, common CSS custom properties, or your page's light/dark background) — falls back to Askline's default navy if nothing usable is found. Set false to skip this and show default colors immediately.
The endpoint itself is fixed and never configurable from this snippet. Turnstile bot protection, if enabled for your site, is handled automatically — nothing to set up here.
Getting started

Access & allowlisting

Askline uses a single fixed endpoint for every client - there is no per-partner path. Instead, each site is allowlisted by host during onboarding, and by origin for cross-origin browser calls. Requests from a host or origin that hasn't been configured are rejected before any model call is made.

Reference · direct integration

Ask the agent

Building your own UI instead of using the SDK? Call the endpoint directly. Send the visitor's question with their prior turns; the response is a Server-Sent Events stream that opens instantly and closes when the answer is complete.

POST https://askline.code-mavericks.com/v2/ask?tenant_id=your-tenant-id
tenant_id is required as a query parameter — on both the request itself and any CORS preflight, since preflight requests carry no body. Missing or unrecognized tenant_id returns 401.
{
  "query": "What plans do you offer?",
  "history": [
    { "role": "user", "text": "..." },
    { "role": "assistant", "text": "..." }
  ],
  "turnstile_token": ""
}
// leave turnstile_token as an empty string if Turnstile isn't in use for your site - see the Turnstile section below

Event contract

EventPayloadMeaning
connection.created{type}Stream opened, request accepted.
curate{type, text}Status text while working. Repeatable; each replaces the last.
message.delta{type, delta}Answer chunk. One today, many when token streaming lands.
message.done{type, text}Full final answer, always emitted.
error{type, message}User-safe failure text. Replaces message events.
conversation.completed{type}Always the last event, success or error.
Comment lines beginning with : are transport keep-alives, sent roughly every 15 seconds. Ignore them; every SSE library already does.
Reference

Turnstile

Some sites have Cloudflare Turnstile bot protection enabled. If you're using the SDK, this is handled for you automatically. If you're calling the endpoint directly:

  1. GET /askline/loader?tenant_id=your-tenant-id
  2. If the response includes a turnstile_site_key, render Cloudflare's Turnstile widget with that key (appearance: 'interaction-only' recommended, so it stays invisible unless a visitor is actually challenged) and pass the resulting token as turnstile_token.
  3. If the response is empty, Turnstile isn't enabled for this site — omit or leave turnstile_token empty.
Reference

Guardrails & knowledge base

Every answer is grounded in a knowledge base you control - Askline only states facts that appear in the excerpts it retrieves, and says plainly when it doesn't know something rather than guessing. Off-limits topics and escalation rules are configured per site, not left to the model to decide on its own.

Reference

Errors

Requests from an unrecognized host or origin receive a 403 before the stream opens. Malformed or oversized queries receive a 400. Once the stream has opened, failures are reported as an error event rather than an HTTP status change, since the connection is already committed to streaming.

Guides

Knowledge base sync

Knowledge base content is authored as Markdown and synced in - unchanged sections are skipped, changed or new sections are re-embedded, and removed sections are pruned automatically. Talk to Code Mavericks about getting your content into the pipeline.