CBFiles¶
File storage and CDN service powered by MinIO.
Overview¶
CBFiles provides centralized file management for all Campaign Brain modules:
- File Operations: Upload, download, list, delete files via REST API
- Bucket Management: Create and configure storage buckets with access control
- Signed URLs: Time-limited URLs for secure file sharing
- CDN Delivery: Public file delivery via
cdn.nominate.ai - Python Client: Easy integration for internal services
Endpoints¶
| Service | URL | Purpose |
|---|---|---|
| API | files.nominate.ai | Full API access |
| CDN | cdn.nominate.ai | Public file delivery |
| Docs | files.nominate.ai/docs | OpenAPI/Swagger UI |
Architecture¶
┌─────────────────────────────────────────────────────────────┐
│ Internal Services │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ cbapp │ │cbworkflow│ │cbsurveys│ │ cbradio │ ... │
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │ │
│ └───────────┴─────┬─────┴───────────┘ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ CBFiles API │ │
│ │ files.nominate.ai│ │
│ └────────┬─────────┘ │
│ │ │
│ ┌────────▼─────────┐ │
│ │ MinIO │ │
│ │ Object Storage │ │
│ └────────┬─────────┘ │
└───────────────────────┼──────────────────────────────────────┘
│
▼
┌──────────────────┐
│ CDN │
│ cdn.nominate.ai │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ App Users │
│ (External) │
└──────────────────┘
Quick Start¶
Python Client¶
from cbfiles.client import CBFilesClient
with CBFilesClient("https://files.nominate.ai", "cbfiles_xxx") as client:
# Upload a file
result = client.upload_file(
bucket_name="my-bucket",
object_name="documents/report.pdf",
content=open("report.pdf", "rb"),
content_type="application/pdf"
)
# Get signed URL for sharing
signed = client.get_signed_url("my-bucket", "documents/report.pdf", expires_in=3600)
print(f"Share: {signed['url']}")
REST API¶
# Upload a file
curl -X POST "https://files.nominate.ai/api/v1/buckets/my-bucket/files/doc.pdf" \
-H "X-API-Key: $CBFILES_KEY" \
-F "file=@./document.pdf"
# Get signed download URL
curl -X POST "https://files.nominate.ai/api/v1/buckets/my-bucket/files/doc.pdf/signed-url" \
-H "X-API-Key: $CBFILES_KEY"
Documentation¶
- Developer Guide - Complete API reference and integration examples