Document Management API
MinIO-based document storage and management endpoints.
Endpoints
Create Bucket
Creates a new MinIO bucket.Request Body:
Response: APIOutputResponse
Upload File
Uploads a file to MinIO bucket and registers it in the database.Parameters:
- file
: UploadFile (multipart/form-data)
- bucket_name
: string (default: "default-bucket")
Response: APIOutputResponse
with file_id
in response field
Notes: - Checks for existing files in database - Creates database record - Uses temporary file storage during upload
Delete Object
Deletes object from MinIO and removes all associated database records.Request Body:
Response: APIOutputResponse
Notes: - Removes QA pairs, chunks, and file records from database - Deletes object from MinIO storage
Delete Bucket
Deletes a MinIO bucket.Request Body:
Response: APIOutputResponse
List Objects
Lists objects in a MinIO bucket.Query Parameters:
- bucket_name
: string (optional)
- prefix
: string (optional)
- recursive
: boolean (default: false)
Response: APIOutputResponse
with object list
List Buckets
Lists all MinIO buckets.Response: APIOutputResponse
with bucket list
Get Object Info
Retrieves metadata for a specific object.Query Parameters:
- bucket_name
: string (required)
- object_name
: string (required)
Response: APIOutputResponse
with object metadata
Get File ID
Retrieves file ID from database using filename.Query Parameters:
- file_name
: string (required)
Response: APIOutputResponse
with file_id
Error Handling
All endpoints return standardized error responses:
- 400
: Bad Request
- 404
: Not Found
- 500
: Internal Server Error
Dependencies
- MinIO for object storage
- Database for file metadata
- Temporary file handling for uploads