Skip to content

GET /widget

1 min read

Returns the website widget’s look for the key’s assistant. The widget calls this when a page loads, before it draws the chat button. You only need it if you’re building your own chat window and want it to match the settings in the Widget section.

GET https://answers.snoowl.com/api/v1/widget
Authorization: Bearer ansp_…

Accepts any key. From a browser, a website key works only on its listed websites. This endpoint isn’t rate-limited and isn’t charged.

curl https://answers.snoowl.com/api/v1/widget \
  -H "Authorization: Bearer YOUR_SITE_KEY" \
  -H "Origin: https://www.example.com"

The Origin header here stands in for the browser, because a website key refuses requests without one.

{
  "title": "Tallyfold Help",
  "greeting": "Hi! Ask me anything about our product.",
  "color": "#5b5bd6",
  "position": "right",
  "starters": ["How do I get a refund?", "Can I change my plan later?"],
  "show_citations": true,
  "size": "medium"
}
FieldTypeDescription
titlestringThe chat window’s title. When the Title setting is empty, this is the Assistant’s name from settings, then the assistant’s own name, then “Ask us”.
greetingstringThe first message in the chat. Up to 300 characters.
colorstringThe accent colour, as #rrggbb.
positionstringright or left: the bottom corner the chat button sits in.
startersarray of stringsUp to four starter questions, each up to 80 characters.
show_citationsbooleanWhether sources are shown under answers.
sizestringsmall, medium or large.

With a preview key, the response is the look that was shown in the Widget section when the preview was made, including unsaved changes.

Errors use the error format: 401 for a missing, unknown or revoked key, and 403 for a website key used from a site that isn’t on its list.