This guide covers uploading documents to AlcoaBase via the web interface and the bulk upload CLI tool.
- Navigate to the Documents page (the default landing page after login).
- Click the Upload Document button in the top-right corner.
- In the upload dialog:
- File — Click the dashed area or drag and drop a file onto it. The selected filename will appear.
- Title — Enter a descriptive title (required, max 500 characters).
- Folder Path — Enter the logical folder path, e.g.
/quality/sops(required, max 1000 characters). - Document Type — Select from: SOP, Protocol, Report, General, Policy, Form.
- Tags — Optionally enter comma-separated tags, e.g.
quality, review, batch-record.
- Click Upload. A spinner indicates progress.
- On success the dialog closes and the document list refreshes with your new document.
- On failure an error message appears inside the dialog.
- Click on a document in the list to open its detail view.
- Click the New Version button.
- In the version dialog:
- File — Select the updated file.
- Version Type — Choose Major (e.g. 1.0 → 2.0) or Minor (e.g. 1.0 → 1.1).
- Change Reason — Describe what changed (required).
- Click Upload Version.
- The version history updates with the new entry.
- Pagination — Use Previous/Next buttons below the document list.
- Filter by tag — Type a tag name in the tag filter input.
- Filter by folder path — Type a path in the folder path input.
- Clear filters — Click the Clear button to reset.
The bulk upload tool recursively walks a directory and uploads every file as a document.
- Python 3.11+ with
uvinstalled - The backend running and accessible (e.g.
http://localhost:8080) - A valid authentication token (or set
ALCOABASE_TOKENenvironment variable) - Your user ID and company ID (check the admin panel or database)
cd src/backend
uv run python scripts/bulk_upload.py \
--directory /path/to/documents \
--api-url http://localhost:8080 \
--company-id 2 \
--user-id 1 \
--token YOUR_TOKEN| Option | Required | Default | Description |
|---|---|---|---|
--directory |
Yes | — | Root directory to recursively walk |
--api-url |
Yes | — | Backend API base URL |
--company-id |
Yes | — | Company ID for multi-tenancy |
--user-id |
Yes | — | User ID for audit attribution |
--token |
No | ALCOABASE_TOKEN env var |
Bearer token for authentication |
--document-type |
No | General |
Document type for all uploads |
--tags |
No | (empty) | Comma-separated tags for all uploads |
--dry-run |
No | off | List files without uploading |
Preview what would be uploaded without making any API calls:
uv run python scripts/bulk_upload.py \
--directory ./my-docs \
--api-url http://localhost:8080 \
--company-id 2 \
--user-id 1 \
--token mytoken \
--dry-runOutput:
Dry run: 5 files would be uploaded:
/path/to/my-docs/report.pdf -> title='report', folder_path='/'
/path/to/my-docs/sops/cleaning.docx -> title='cleaning', folder_path='sops'
...
--- Upload Summary ---
Total files: 5
Successful uploads: 0
Failed uploads: 0
For each file found in the directory tree:
| Field | Derived From | Example |
|---|---|---|
title |
Filename without extension | cleaning-procedure.pdf → cleaning-procedure |
folder_path |
Relative directory from root | sops/cleaning.pdf → sops, root-level → / |
document_type |
--document-type argument |
General (default) |
tags |
--tags argument |
Applied to all files |
- If a single file fails, the tool logs the error and continues with remaining files.
- The final summary shows total, successful, and failed counts.
- Exit code 1 if the directory doesn't exist or no token is provided.
uv run python scripts/bulk_upload.py \
--directory /shared/quality-docs \
--api-url http://localhost:8080 \
--company-id 2 \
--user-id 1 \
--token mytoken \
--document-type SOP \
--tags "quality,imported,2026"export ALCOABASE_TOKEN="your-bearer-token"
uv run python scripts/bulk_upload.py \
--directory ./docs \
--api-url http://localhost:8080 \
--company-id 2 \
--user-id 1