Skip to main content
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
{
  "file": {},
  "Content-Type": "<string>",
  "Content-Disposition": "<string>"
}
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.

Headers

Authorization
string
required
Bearer token containing your Fini workspace API key. Format: Bearer fini_... The key needs write scope.
Content-Type
string
required
application/json

Body parameters

initPrompt
string
required
Prompt describing the folder-and-article structure you want Fini to scaffold.

Response

The response body is a generated tree template file.
file
binary
Downloadable tree-import template file.
Content-Type
string
MIME type for the returned file.
Content-Disposition
string
Attachment header containing the suggested filename.
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

Next step

Review the generated file, make any edits you want, then upload it with Persist knowledge folders.

Errors

The request body is malformed or initPrompt is missing or empty.
The API key is missing, malformed, revoked, or invalid.
The API key does not include the write scope.
Fini failed while generating the tree template. Retry once, then narrow the prompt if the failure persists.