Skip to main content
POST
/
ai-knowledge-bases
/
{kb_id}
/
documents
Upload Document to Knowledge Base
curl --request POST \
  --url https://api.wacht.dev/ai-knowledge-bases/{kb_id}/documents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'metadata={}' \
  --form file=@example-file
{
  "id": "<string>",
  "knowledge_base_id": "<string>",
  "name": "user-manual.pdf",
  "type": "pdf",
  "size": 2048576,
  "token_count": 15000,
  "status": "ready",
  "uploaded_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Path Parameters

kb_id
string
required

Body

multipart/form-data
file
file
required
metadata
object

Response

id
string
knowledge_base_id
string
name
string
Example:
type
enum<string>
Available options:
pdf,
txt,
md,
docx,
html
Example:
size
integer
Example:
token_count
integer
Example:
status
enum<string>
Available options:
processing,
ready,
failed
Example:
uploaded_at
string<date-time>