Knowledge bases
Create a knowledge base
Creates an empty knowledge base; add documents with Add a knowledge base document. With validate_only, the checks run and 204 answers, nothing is created.
Authorization
AuthorizationstringheaderrequiredBearer <key>, where <key> is a workspace API key or a user API key. See Authentication.
workspace_id*integerThe workspace. List the ones your key can reach with GET /v1/workspaces.
region*RegionsRegion of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them
"besg""usnv"Idempotency-Key?|Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.
nullapplication/json- body
name*NameName, unique among the workspace's knowledge bases of the region
1 <= length <= 255resource_id?|The id genies reference it by, unique in the region; derived from the name when absent (a renamed knowledge base keeps its own, so its old name needs another one)
nullfolder_id?|Folder to list it in; the root when absent
nullis_shared_with_workspace?Is Shared With Workspacetrue lets every member of the workspace use it
falsevalidate_only?Validate OnlyRun every check of the write and answer 204 without writing: a refused write answers the error the write would
falseCreated
application/json- response
A knowledge base, which genies answer from
knowledge_base_id*Knowledge Base Idname*Nameresource_id*Resource Idregion*Regionis_shared_with_workspace*Is Shared With Workspacefolder_id*string|nullcreated_time*Created Timedate-timelast_modified_time*Last Modified Timedate-timecurl -X POST 'https://api.stacksync.com/v1/workspaces/0/knowledge-bases?region=besg' \ -H 'Content-Type: application/json' \ -d '{ "name": "<name>"}'{ "knowledge_base_id": "<knowledge_base_id>", "name": "<name>", "resource_id": "<resource_id>", "region": "<region>", "is_shared_with_workspace": false, "folder_id": "<folder_id>", "created_time": "2027-01-15T09:00:00Z", "last_modified_time": "2027-01-15T09:00:00Z"}