Unispec Docs
ApiKnowledge

Add a document

Add a document by inline `text`, a `url` to fetch, or a multipart file upload (PDF, DOCX, TXT, Markdown, HTML). Ingestion runs asynchronously; poll the document `status` until `ready`.

POST
/v1/knowledge/{name}/documents

Add a document by inline text, a url to fetch, or a multipart file upload (PDF, DOCX, TXT, Markdown, HTML). Ingestion runs asynchronously; poll the document status until ready.

Authorization

TokenAuth
Authorization<token>

Project API key as Token lb-sk_...

In: header

Path Parameters

name*string

Request Body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/v1/knowledge/string/documents" \  -H "Content-Type: application/json" \  -d '{    "text": "Refunds within 30 days.",    "title": "returns"  }'
{  "id": "string",  "filename": "string",  "source_type": "text",  "status": "uploaded",  "chunk_count": 0,  "error": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}