Skip to content

Upload a source document

POST
/api/v1/sources

Send the document as a multipart file upload. Accepted formats are PDF, Word (.docx, .doc), PowerPoint, OpenDocument Text and RTF. Text extraction and embedding start asynchronously after the upload; follow progress through state, which ends in embedding_complete (or one of the *_failed states). When title is omitted the first 50 characters of the filename are used.

Media typemultipart/form-data
object
source
required
object
file
required
string format: binary
title
string

Defaults to the filename

description
string

201

The created source

Response body
Media typeapplication/json
object
id
string
title
string
description
string | null
state
string
Allowed values: new ocr_job_started ocr_job_completed ocr_job_failed ocr_data_processed embedding_complete embedding_failed

Processing state. Passages are searchable once embedding_complete.

file
object
filename
string
content_type
string
byte_size
integer
download_url
string | null format: uri

The download endpoint for this source

created_at
string format: date-time
updated_at
string format: date-time

403

Insufficient scope, role, or credits

Response body
Media typeapplication/json
object
error
object
code
string

A stable machine-readable code

message
string
details
Array<string>

Present on validation errors; one entry per failed validation

422

The record could not be saved

Response body
Media typeapplication/json
object
error
object
code
string

A stable machine-readable code

message
string
details
Array<string>

Present on validation errors; one entry per failed validation