Skip to main content
POST
presigned upload knowledge group

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Upload-Token
string

Lab's short-lived upload token, which Lab's own uploader sends instead of an API key. API clients authenticate with Authorization: Bearer <API key> and leave this out.

Path Parameters

id
string
required

Knowledge folder ID, from GET /v1/knowledge/groups

Body

application/json
filename
string
required

The document's file name, with its extension.

Required string length: 1 - 255
contentType
string
required

The file's MIME type, such as application/pdf. The PUT to uploadUrl must send the same Content-Type.

Maximum string length: 255
fileSize
integer

The file's size in bytes, at most 52428800 (50MB). Confirmation measures the uploaded file and enforces both limits again on its real size.

Required range: x >= 0
chunkSize
integer

Maximum tokens per chunk for this document, as for the multipart upload. Defaults to the group's chunkSize, or 350.

Required range: 100 <= x <= 2000
chunkOverlap
integer

Token overlap between chunks for this document, as for the multipart upload. At most half of chunkSize.

Required range: 0 <= x <= 1000

Response

The document was created as UPLOADED, waiting for its file.

uploadUrl
string<uri>
required

Presigned URL to PUT the file's bytes to, valid for 1 hour.

documentId
string
required

The new document's ID, for the confirm-upload call.