Create file (POST /files)
REST · callableUpload corpus media to a base from base64 bytes or a public http(s) URL. Storage finalize + processing create File, Visibility, and EmbeddingIndex rows in Dgraph.
curl -sS -X POST 'https://us-central1-qaleb-x.cloudfunctions.net/createFile' \
-H 'Authorization: Bearer YOUR_FIREBASE_ID_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"data": {
"baseId": "<base-uuid>",
"data": "<base64-bytes>",
"mimeType": "application/pdf",
"filename": "report.pdf",
"visibility": "public"
}
}'
# Or ingest a public image URL (server-side fetch; mimeType optional):
curl -sS -X POST 'https://us-central1-qaleb-x.cloudfunctions.net/createFile' \
-H 'Authorization: Bearer YOUR_FIREBASE_ID_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"data": {
"baseId": "<base-uuid>",
"url": "https://images.example.com/catalog/product.jpg",
"filename": "product.jpg",
"visibility": "public",
"prompt": "Describe the product, visible text, colors, and notable details.",
"region": "eu"
}
}'{
"status": "success",
"data": {
"fileId": "0xabc…",
"storagePath": "public/media/0xabc…/media/src/report.pdf",
"path": "public/media/0xabc…/media/src/report.pdf",
"visibility": "public",
"bucket": "your-project.appspot.com",
"embedModel": "GEM_2_768"
}
}Provide exactly one source: data containing raw base64 bytes (without a data-URL prefix) plus mimeType, or url pointing to a publicly accessible http/https file such as an image (mimeType optional and inferred from the response). Optional prompt controls how Media.content is described; omit it to use Organization.defContentPrompt when set, otherwise the system summary prompt. Optional region is us, eu, or asia for corpus object storage; omit region to store in us (America, lowest-cost). The product UI may auto-select the lowest-latency region; Location in the files table is inferred from the file URL. Processing is async (save defaults true). Subscribe (step 3) or query (step 2) to see status → completed. Private uploads require a payment method (visibility=private). For integrations after genToken, send Authorization: Bearer YOUR_API_JWT; baseId must be in the token bases claim.