Generate polished, ready-to-share documents from your Genie’s knowledge base — FAQs, how-to guides, and one-pagers, all grounded in your own content.
Genie Documents lets you produce professionally written documents directly from the knowledge base attached to a Genie. You choose a template, select the source documents to draw from, and receive a structured, print-ready result in seconds.All generated content is grounded strictly in the source material you provide — no facts are invented. The output is structured as an ordered list of sections, each with a heading and body, ready to render or export.
Produces a structured document from one or more knowledge-base documents using a Smart template. Only documents you own (or public documents) can be used as sources.
Array of knowledge-base document UUIDs to use as source material. At least one document is required. Documents are combined up to an internal character limit; the largest documents are trimmed first if the total exceeds the limit.
Optional plain-text description of the document’s focus (e.g. "returning customer onboarding"). When omitted, the template covers the most broadly useful information from the source material.
{ "success": true, "data": { "document": { "title": "Frequently Asked Questions", "subtitle": "Everything a new customer needs to know", "template": "faq", "sections": [ { "heading": "What are your business hours?", "body": "We're open Monday through Friday, 9am to 5pm. Our team typically responds to messages within one business day." }, { "heading": "How do I get started?", "body": "Simply create an account on our website and follow the setup wizard. The whole process takes under five minutes.\n\n1. Visit our website and click \"Sign up\"\n2. Enter your business details\n3. Connect your first channel" } ] }, "meta": { "sourceDocuments": ["Product Overview", "Support Handbook"], "skippedDocuments": [], "truncated": false } }}
Persists a generated document as a permanent knowledge-base record linked to the specified Genie. Use this after generate to store the result so it can be managed, published, and surfaced on the Genie’s Help Hub.New documents are created as private (is_public: false) and are not pushed to the Genie’s knowledge base automatically. Publishing is a separate action through the knowledge-base update path.Pass id to update an existing branded document. Omit id to create a new one.
true when a new document was created; false when an existing document was updated.
const response = await ApiService.invoke({ resource: "genie-documents", action: "save", data: { agentId: "550e8400-e29b-41d4-a716-446655440000", template: "faq", title: "Frequently Asked Questions", subtitle: "Everything a new customer needs to know", sections: [ { heading: "What are your business hours?", body: "We're open Monday through Friday, 9am to 5pm.", }, { heading: "How do I get started?", body: "Create an account and follow the setup wizard.", }, ], sourceDocumentIds: [ "770e8400-e29b-41d4-a716-446655440002", ], },});// response.created === true → new document// response.document.id → UUID to use for subsequent updates
Section headings that end with ? are automatically extracted and stored as indexed questions. These questions appear on the Genie’s Help Hub question band when the document is published.
Missing required fields (agentId, template, title, sections, documentIds), invalid template key, no sections supplied, or trying to save a non-branded document
NOT_FOUND
404
Specified document id not found (save), or none of the source document IDs exist (generate)
UNAUTHORIZED
401
Access to the Genie or document is denied
INTERNAL_ERROR
500
Document generation failed, returned no content, or storage upload failed