curl --request POST \ --url 'https://api-prod.usefini.com/v2/knowledge/public/tree/initialize' \ --header 'Authorization: Bearer fini_your_api_key' \ --header 'Content-Type: application/json' \ --data '{ "initPrompt": "Create a support knowledge tree for billing, shipping, and returns." }' \ --output fini-tree-template.csv
const response = await fetch('https://api-prod.usefini.com/v2/knowledge/public/tree/initialize', { method: 'POST', headers: { Authorization: 'Bearer fini_your_api_key', 'Content-Type': 'application/json' }, body: JSON.stringify({ 'initPrompt': 'Answer only from approved knowledge and escalate if unsure.'} )});const data = await response.json();
import requestsresponse = requests.post( "https://api-prod.usefini.com/v2/knowledge/public/tree/initialize", headers={"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"}, json={ "initPrompt": "Answer only from approved knowledge and escalate if unsure."},)data = response.json()
{ "folders": [ { "id": "0f4da4fe-b2ae-4787-8c3b-854f36d9eb1b", "title": "Billing", "description": "Refunds, invoices, and subscription changes.", "parentFolderId": null, "active": true, "botIds": [ "2a1cf0f0-f35d-46ad-8e61-a15c86b2b312" ], "createdAt": "2026-07-28T08:55:32.000Z", "updatedAt": "2026-07-28T09:10:18.000Z" } ], "articles": [ { "id": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3", "title": "Refund policy", "mainKnowledge": "Customers can request a refund within 30 days of purchase.", "agentInstruction": "Use this article for refund eligibility questions.", "questions": [ "Can I get a refund?" ], "keywords": [ "refund", "billing" ], "escalation": false, "parentFolderId": "0f4da4fe-b2ae-4787-8c3b-854f36d9eb1b", "isDraft": false, "origin": "API_CREATED", "createdAt": "2026-07-28T08:55:32.000Z", "updatedAt": "2026-07-28T09:10:18.000Z" } ]}
Knowledge generation
Initialize knowledge folders
Generate a downloadable tree-import template file from an initialization prompt.
POST
/
v2
/
knowledge
/
public
/
tree
/
initialize
curl --request POST \ --url 'https://api-prod.usefini.com/v2/knowledge/public/tree/initialize' \ --header 'Authorization: Bearer fini_your_api_key' \ --header 'Content-Type: application/json' \ --data '{ "initPrompt": "Create a support knowledge tree for billing, shipping, and returns." }' \ --output fini-tree-template.csv
const response = await fetch('https://api-prod.usefini.com/v2/knowledge/public/tree/initialize', { method: 'POST', headers: { Authorization: 'Bearer fini_your_api_key', 'Content-Type': 'application/json' }, body: JSON.stringify({ 'initPrompt': 'Answer only from approved knowledge and escalate if unsure.'} )});const data = await response.json();
import requestsresponse = requests.post( "https://api-prod.usefini.com/v2/knowledge/public/tree/initialize", headers={"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"}, json={ "initPrompt": "Answer only from approved knowledge and escalate if unsure."},)data = response.json()
{ "folders": [ { "id": "0f4da4fe-b2ae-4787-8c3b-854f36d9eb1b", "title": "Billing", "description": "Refunds, invoices, and subscription changes.", "parentFolderId": null, "active": true, "botIds": [ "2a1cf0f0-f35d-46ad-8e61-a15c86b2b312" ], "createdAt": "2026-07-28T08:55:32.000Z", "updatedAt": "2026-07-28T09:10:18.000Z" } ], "articles": [ { "id": "4f5ef695-d03b-4d56-8fef-7f2bd5c17ef3", "title": "Refund policy", "mainKnowledge": "Customers can request a refund within 30 days of purchase.", "agentInstruction": "Use this article for refund eligibility questions.", "questions": [ "Can I get a refund?" ], "keywords": [ "refund", "billing" ], "escalation": false, "parentFolderId": "0f4da4fe-b2ae-4787-8c3b-854f36d9eb1b", "isDraft": false, "origin": "API_CREATED", "createdAt": "2026-07-28T08:55:32.000Z", "updatedAt": "2026-07-28T09:10:18.000Z" } ]}
Use this route when you are setting up knowledge folders for the first time and want Fini to scaffold a starting folder-and-article structure.
This route returns a downloadable file, not JSON. Save the response body using the returned Content-Type and Content-Disposition headers, then import that file with Persist knowledge folders.