Documentação

A documentação para programadores está em inglês.

Documentação

Changelog

Changes to the Answers API contract and to @webknox/elements. Within v2, changes are additive: new fields, card types, layouts, reason values and error codes can appear, so ignore what you don't know. Anything that would break existing code comes as a new version.

2026-10-25 · @webknox/elements 1.0

  • On npm under the MIT licence: npm install @webknox/elements. Version 1.0 keeps the preview's element, properties and events.
  • New since the preview: a theme's style options accent, corners and font, and accent text shaded for contrast (see Saved themes below).

2026-10-25 · Saved themes

  • Pro and Scale can save themes in the console's new Themes section: a style preset with an accent colour, corners, a font and a layout per card type, at most 20 per account. render.theme takes a saved theme's id (th_ and 12 characters); another account's id, or one that does not exist, is a 400. A render keeps the theme as it was when it was made.
  • The theme object takes three safe style options, accent, corners and font, besides the preset and raw tokens; schemas/theme.schema.json describes a saved theme.
  • An accent colour (the accent attribute or a theme's) keeps text readable: text in the accent colour is shaded until it reaches 4.5:1 on the style's surfaces, while buttons and highlights keep the colour as given.

2026-10-25 · Hosted render

  • render (Pro and Scale): a matched answer with a card comes back with the URLs of the formats you ask for: embed_url (the interactive card for an iframe, which reports follow-ups, actions and its height to your page by postMessage) and image_url. They work for 30 days, then answer 410 Gone until the answer is deleted (within a day). The embed is free; an image adds 1 token.
  • The image is a PNG, or a JPEG when the card shows photos, 1200 px wide with square corners.
  • 403 plan_required: a request with render on Free or Starter. A 503 unavailable means the URLs could not be made; nothing is charged.

2026-10-22 · Free-plan credit and the daily quota

  • attribution: answers on the Free plan carry {text, url}, a credit such as "Answer by WebKnox" in the answer's language. Show it with the answer; <webknox-answer> shows it in every layout.
  • 429 quota_exceeded: no tokens are left today. Wait retry_after_s (until 00:00 UTC) or buy a pack (packs need a paid plan).

2026-10-21 · Answers API v2 draft

  • POST /v2/answers: send the conversation you already have and get back matched, a plain-text text, a shorter speech, a typed card, sources, follow_ups and actions. Unmatched turns come back with matched: false and are not billed.
  • 16 card types, each with a versioned JSON Schema: quick_answer, translation, definition, weather.forecast, sun_moon, nutrition.facts, recipe, timer, comparison, quiz, gallery, audio, video, snippet, on_this_day and movies.
  • Images in answers are WebKnox media URLs (https://webknox.com/media/v1/…), never third-party addresses. A media URL has no query string; one you add is ignored.
  • Hosted render URLs: ask with render to get an embed URL and a PNG image URL that expire at render.expires_at.

2026-10-21 · @webknox/elements 0.1 preview

  • <webknox-answer> renders every card type in any framework, with five styles (daylight, midnight, editorial, playful, mono) and five named themes (kiosk, dashboard, magazine, kids, status).
  • Layouts per card type, from full to glance, strip, table, chart, headline, label and macros.
  • Events for follow-ups (webknox-follow-up) and actions (webknox-action); focus moves to the card's next control when the one in use disappears.
  • Labels in English, German, French, Spanish, Portuguese and Italian, following the answer's locale.