Skip to main content
POST
Associate file with knowledge base

Authorizations

Authorization
string
header
required

JWT token from Clerk authentication.

Must be from a user with org:admin role.

Body

application/json
kbId
integer
required

The ID of the knowledge base to associate the file with

Example:

123

fileId
string<uuid>
required

The file UUID returned from the presigned upload endpoint

Example:

"550e8400-e29b-41d4-a716-446655440000"

fileName
string
required

Original filename

Example:

"quarterly-report.pdf"

fileKey
string
required

The storage key returned from the presigned upload endpoint

Example:

"org_xxx/uploads/550e8400-e29b-41d4-a716-446655440000/quarterly-report.pdf"

contentKey
string
required

The content key returned from the presigned upload endpoint

Example:

"org_xxx/contents/550e8400-e29b-41d4-a716-446655440000.md"

contentType
string
required

MIME type of the file

Example:

"application/pdf"

fileSize
integer

File size in bytes (optional but recommended)

Example:

1048576

userMetadata
object | null

Optional metadata to attach to the file record. For inbound email files, this includes emailId, emailSubject, emailFrom, emailDate, and emailMessageId to link files from the same email.

Example:

Response

File associated and processing started

success
boolean
required
Example:

true

file
object
required