Kroos Developers
Kroos Developers › Website chatbot

Locations, hours & visitor context

How the chatbot knows which location a visitor is dealing with, whether it's open right now, and when to offer a call or a person. Learned from your site; corrected in the console or the API.

The chatbot knows where it is and when it is: the page it was opened on, the visitor's local time, and whether the location that matters to this visitor is open. It uses that to answer "are you open?", to suggest calling while you're open, and to keep helping (and take a message) when you're closed.

Where the information comes from#

  1. Your website, first. Kroos learns your locations, phone numbers and opening hours from your own public pages when it learns about your business (learning). Nothing it learns is used until you confirm it.
  2. The console or the API, second. For what your pages don't say (holiday closures, a live-chat desk, procedures). Details you enter must agree with your public site; see learning.
Tip

publishing schema.org LocalBusiness data (address, phone, openingHoursSpecification) for each location helps Kroos, search engines and AI assistants describe you correctly (AI visibility).

What the widget sends#

The widget sends a small, passive context object with each message. Visitors are never asked where they are. Kroos uses the visitor's location only to pick the right location and time.

FieldSourceNotes
pagelocation.origin + location.pathnameQuery strings and fragments are never sent. Ignored unless the page is on one of your own domains
titledocument.titleUp to 120 characters; dropped if it looks like an instruction
referrerdocument.referrer originOrigin only
tzIntl.DateTimeFormat().resolvedOptions().timeZoneMust be a valid IANA zone
localTimethe browser clockUsed for "what time is it?"
langnavigator.language

Kroos uses these, and coarse network location where available, to pick the location that matters to the visitor. A business with one location always uses it.

In your own chat interface#

Add context to POST /api/public/v1/chat:

json
{
  "pk": "kroos_pk_...",
  "message": "Can I talk to someone?",
  "context": { "page": "https://brightsmile.example/locations/dallas", "title": "Dallas office", "tz": "America/Chicago", "localTime": "2026-12-01T15:04:00.000Z", "lang": "en-US" }
}

The answer includes a presence object:

jsonResponse
{
  "answer": "Bright Smiles Dallas is open right now, until 5 PM their time. The team is available now: call +1 214-555-0100.",
  "presence": {
    "location": { "name": "Bright Smiles Dallas", "city": "Dallas", "phone": "+1 214-555-0100" },
    "open": true,
    "label": "Open until 5 PM",
    "hours": "Mon–Fri 8 AM–5 PM · Sat–Sun closed",
    "offer": ["call"],
    "visitorTime": "9:04 AM"
  }
}

offer lists what to show now: call (a tap-to-call button), live_chat (your live-chat link, in liveChatUrl) and message (the handoff form, when the location is closed).

Check presence without a message#

http
GET /api/public/v1/presence?pk=kroos_pk_...&page=https://brightsmile.example/&tz=America/Chicago

Returns { "presence": { … } } in the same shape, or { "presence": null } when no locations are known. The widget calls this when it opens, to show "Open until 5 PM" in its header.

Manage locations (organization API)#

All three need your secret key (authentication).

Read#

http
GET /api/tenant/presence

Returns presence (learned locations, your overrides, hidden ids, live options, procedures), locations (what the chatbot uses, with your corrections applied) and live (the options in effect).

Update#

http
PUT /api/tenant/presence

Send any of these fields:

FieldTypeNotes
overridesarrayLocations you set. Use the id of a learned location to correct it (only the fields you send change), or a new name to add one. Fields: id, name, street, city, region, postal, country, lat, lon, tz, phone, email, url, hours, closedDates
hoursstring or object"Mon-Fri 9am-6pm; Sat 10am-2pm", "Mo-Fr 09:00-18:00", or { "1": [[540, 1080]] } (day 0 = Sunday, minutes after midnight)
closedDatesstring[]Local dates, YYYY-MM-DD
hiddenstring[]Learned location ids to ignore
live.preferHumansWhenOpenbooleanSuggest calling or chatting with a person while the visitor's location is open
live.messageWhenClosedbooleanOffer to take a message when closed (default true)
live.liveChatUrlstringAn https:// link to your live-chat desk
sopsstring[]Up to 20 procedures the chatbot follows, for example "After 6 PM, emergencies call 555-0100"

A procedure that reads like an instruction to an AI rather than a business rule is rejected with presence.invalid_sop.

Learn from your site#

http
POST /api/tenant/presence/learn

Starts a learning session limited to your locations and hours (202 Accepted). You get an email when it's ready to review; nothing changes until you confirm it.

Privacy#

  • Nothing here identifies a visitor. The page path, time zone and clock are used for this answer and aren't kept as a profile.
  • The chatbot never asks visitors for their location or time zone on your site. Only Kroos's own apps may ask, for example /chat.
  • Everything the widget sends is treated as data. None of it can change what a visitor is allowed to do.

Last updated 2026-12-03