Skip to main content
POST
/
files
Create file upload
curl --request POST \
  --url https://api.bedrock.cv/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "prj_01JABCD123",
  "filename": "site-photo.jpg",
  "content_type": "image/jpeg"
}
'
{
  "data": {
    "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"
  }
}
Create a file record and receive a signed URL to upload the file directly to cloud storage.

Upload flow

  1. Call POST /files with the filename and content type
  2. Upload the file to the returned upload_url using a PUT request
  3. The file status transitions from awaiting_upload to processing automatically
  4. Once processed, the file’s text content is extracted and indexed
# Step 1: Create the file record
curl -X POST https://api.bedrock.cv/files \
  -H "Authorization: Bearer sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"project_id": "prj_01JABCD123", "filename": "specs.pdf", "content_type": "application/pdf"}'

# Step 2: Upload to the signed URL
curl -X PUT "https://storage.bedrock.cv/uploads/fil_01JABCD123?signature=..." \
  -H "Content-Type: application/pdf" \
  --data-binary @specs.pdf
The signed upload URL expires after 15 minutes. If it expires, create a new file record.

Authorizations

Authorization
string
header
required

API key prefixed with sk_. Example: Authorization: Bearer sk_xxx

Headers

X-API-Version
string
default:2026-01-01

API version

Body

application/json
project_id
string
required
filename
string
required
content_type
enum<string>
required
Available options:
application/pdf,
image/png,
image/jpeg,
image/tiff

Response

Success

data
object
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"
}