Docs
Open dashboard

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_typestringoptional
    Default "document"
    documentfaqproduct_infopolicyscriptother
  • contentstringoptional
    Text content. Mutually exclusive with storage_path.
  • tagsstring[]optional
    Default []
  • categorystring0–255 charsoptional
  • storage_pathstringoptional
    Path returned by the upload-url endpoint. Mutually exclusive with content. Must start with kb/{workspaceId}/.
  • file_namestringoptional
    Required with storage_path.
  • file_typestringoptional
    Required with storage_path.
  • file_size_bytesintegeroptional
    Required 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_pathstringnullableoptional
    Storage 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 Request
    Validation failed / malformed request.
  • 401Unauthorized
    Missing, malformed, or invalid API key.
  • 403Forbidden
    Workspace unavailable, suspended, or paywalled.
  • 409Conflict
    Request conflicts with current resource state.
  • 429Too Many Requests
    Workspace request limit exceeded; shared across all its API keys.