Associate an uploaded file with a knowledge base and trigger processing.
This is Step 2 of the file upload flow (after uploading to the presigned URL).
What this endpoint does:
The orgId is automatically extracted from your JWT token - you don’t need to include it in the request body.
Complete upload flow:
1. POST /upload/presigned → Get signed URL + file metadata
2. PUT to signed URL → Upload file to storage
3. POST /kb/files → Associate with KB & trigger processing
JWT token from Clerk authentication.
Must be from a user with org:admin role.
The ID of the knowledge base to associate the file with
123
The file UUID returned from the presigned upload endpoint
"550e8400-e29b-41d4-a716-446655440000"
Original filename
"quarterly-report.pdf"
The storage key returned from the presigned upload endpoint
"org_xxx/uploads/550e8400-e29b-41d4-a716-446655440000/quarterly-report.pdf"
The content key returned from the presigned upload endpoint
"org_xxx/contents/550e8400-e29b-41d4-a716-446655440000.md"
MIME type of the file
"application/pdf"
File size in bytes (optional but recommended)
1048576