Widget Routes
Widget routes are public customer-browser routes used by https://woes.dev/widget.js, the embedded iframe, and mobile SDKs. They do not accept woesk_ REST API keys. They authenticate by widget public key and, where conversation state is involved, the per-conversation conversationSecret returned when the conversation is created.
A widget public key is public routing material, not a private credential. Never use it as proof that a caller can read or mutate a conversation. Conversation history, presence, feedback, and survey writes require the matching conversationSecret when they touch an existing thread.
Shared Rules
Routes
Config
Returns only customer-safe config: visual theme, launcher/welcome text, quick links, widget feature toggles, business-hours fields, enabled surveys, identity verification state, and whether the selected agent can auto-reply.
Config also records the widget install origin for the operator-side install check. That recording is best-effort and never blocks the config response.
Identity Check
For JWT mode, send { "publicKey": "...", "jwt": "..." } instead. A successful response includes verified: true, the resolved mode, and customer-safe identity fields. Failed proofs return 403 with verified: false.
Messages
POST /api/widget/messages creates the conversation on the first message and returns a conversationKey plus an opaque conversationSecret. Store both per widget key in the browser or SDK. The secret is required to read or continue that conversation later.
Message bodies are bounded and sanitized. context and identity are treated as customer-supplied until verified. Operator-only traces, provider internals, and private workspace data are excluded from widget history responses.
Presence, Feedback, And Surveys
Presence, feedback, and survey routes all verify that the conversation belongs to the widget key’s workspace before mutating or returning conversation state. Survey submissions also verify that the survey is configured and enabled for that workspace.
Updates
Widget updates are published announcements shown in the widget Updates tab.
Anonymous visitors can load published updates for the widget key. Read state is
only returned or written after Woes validates HMAC or JWT identity proof for the
same widget key. The server derives the reader identity from that proof; clients
should not invent or send their own readerKey.
Related Pages