High-Volume Photo Ingestion Pipeline
When ingesting 50,000 to 200,000 photos during a marathon, attempting to stream image bytes directly through an API worker causes server timeouts and bandwidth bottlenecks.
Fotobots employs an asynchronous presigned storage pipeline:
Step 1: Get Upload Ticket Step 2: Binary PUT Step 3: Confirm Ingestion┌─────────────┐ ┌─────────────┐ ┌─────────────┐│ Partner App ├───────────────►│ Cloud S3/R2 ├───────────────►│ Fotobots API ││ POST /signed│ │ Direct PUT │ │ POST /success└─────────────┘ └─────────────┘ └─────────────┘Step 1: Request Presigned Upload URL
Call POST /openapi/photos/photo/signed with your albumId and file details:
curl -X POST https://sandbox-api.fotobots.run/openapi/photos/photo/signed \ -H "Content-Type: application/json" \ -H "x-api-key: fb_test_YOUR_KEY" \ -d '{ "albumId": "d3b07384-d113-4a37-b4d6-f3ec0a4b7f8c", "filename": "runner_1001.jpg", "contentType": "image/jpeg" }'Response
{ "uploadUrl": "https://storage.fotobots.run/r2/upload?X-Amz-Signature=...", "photoId": "9fa8b123-e456-4789-a012-3456789abcde"}Step 2: Direct Binary PUT to Storage
Execute a direct HTTP PUT request with the raw image binary data directly to the uploadUrl:
curl -X PUT "https://storage.fotobots.run/r2/upload?X-Amz-Signature=..." \ -H "Content-Type: image/jpeg" \ --data-binary "@runner_1001.jpg"Step 3: Confirm Ingestion & Trigger AI Indexing
After the storage upload returns 200 OK, notify Fotobots to trigger the asynchronous facial recognition and bib OCR worker queues:
curl -X POST https://sandbox-api.fotobots.run/openapi/photos/photo/success \ -H "Content-Type: application/json" \ -H "x-api-key: fb_test_YOUR_KEY" \ -d '{ "albumId": "d3b07384-d113-4a37-b4d6-f3ec0a4b7f8c", "photoId": "9fa8b123-e456-4789-a012-3456789abcde" }'Response
{ "success": true, "message": "Photo queued for facial recognition and thumbnail processing"}