Create file upload
Files
Create file
Create a file record and get a signed upload URL.
POST
Create file upload
Create a file record and receive a signed URL to upload the file directly to cloud storage.
Upload flow
- Call
POST /fileswith the filename and content type - Upload the file to the returned
upload_urlusing aPUTrequest - The file status transitions from
awaiting_uploadtoprocessingautomatically - Once processed, the file’s text content is extracted and indexed
The signed upload URL expires after 15 minutes. If it expires, create a new file record.
Authorizations
API key prefixed with sk_. Example: Authorization: Bearer sk_xxx
Headers
API version
Body
application/json
Response
Success
Example:
{
"id": "projects%2Fprj_01JABCD123%2Ffiles%2Fsite-photo.jpg",
"upload_url": "https://storage.googleapis.com/bedrock-files/projects/prj_01JABCD123/files/site-photo.jpg?X-Goog-Signature=...",
"key": "projects/prj_01JABCD123/files/site-photo.jpg",
"filename": "site-photo.jpg",
"content_type": "image/jpeg"
}