Create knowledge document
POST/knowledge-base
Create a new knowledge document in this workspace. Provide either content (inline text) or storage_path (from the upload-url endpoint), not both. Paywalled — requires active subscription and sufficient credits.
Requires
Authorization: Bearer <api_key>. Create a key in the Inspra dashboard under Workspace Settings → API Keys.Body application/json
- titlestring1–500 charsrequired
- descriptionstring0–2000 charsoptional
- document_typestringoptionalDefault
"document"documentfaqproduct_infopolicyscriptother - contentstringoptionalText content. Mutually exclusive with storage_path.
- tagsstring[]optionalDefault
[] - categorystring0–255 charsoptional
- storage_pathstringoptionalPath returned by the upload-url endpoint. Mutually exclusive with content. Must start with
kb/{workspaceId}/. - file_namestringoptionalRequired with storage_path.
- file_typestringoptionalRequired with storage_path.
- file_size_bytesintegeroptionalRequired with storage_path.
Response 201 Created
Document created.
- idstringuuidrequired
- titlestring0–500 charsrequired
- descriptionstringnullable0–2000 charsoptional
- document_typestringrequired
documentfaqproduct_infopolicyscriptother - statusstringrequired
draftprocessingactivearchivederror - file_namestringnullableoptional
- file_typestringnullableoptional
- file_size_bytesintegernullableoptional
- storage_pathstringnullableoptionalStorage path returned from the upload-url endpoint.
- tagsstring[]required
- categorystringnullable0–255 charsoptional
- usage_countintegerrequired
- last_used_atstringnullabledate-timeoptional
- created_atstringdate-timerequired
- updated_atstringdate-timerequired
Errors
- 400Bad RequestValidation failed / malformed request.
- 401UnauthorizedMissing, malformed, or invalid API key.
- 403ForbiddenWorkspace unavailable, suspended, or paywalled.
- 409ConflictRequest conflicts with current resource state.
- 429Too Many RequestsWorkspace request limit exceeded; shared across all its API keys.