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"
}
'import requests
url = "https://api.bedrock.cv/files"
payload = {
"project_id": "prj_01JABCD123",
"filename": "site-photo.jpg",
"content_type": "image/jpeg"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: 'prj_01JABCD123',
filename: 'site-photo.jpg',
content_type: 'image/jpeg'
})
};
fetch('https://api.bedrock.cv/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bedrock.cv/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => 'prj_01JABCD123',
'filename' => 'site-photo.jpg',
'content_type' => 'image/jpeg'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bedrock.cv/files"
payload := strings.NewReader("{\n \"project_id\": \"prj_01JABCD123\",\n \"filename\": \"site-photo.jpg\",\n \"content_type\": \"image/jpeg\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bedrock.cv/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"prj_01JABCD123\",\n \"filename\": \"site-photo.jpg\",\n \"content_type\": \"image/jpeg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bedrock.cv/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"prj_01JABCD123\",\n \"filename\": \"site-photo.jpg\",\n \"content_type\": \"image/jpeg\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}{
"type": "https://docs.bedrock.cv/errors/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "One or more request fields are invalid.",
"code": "VALIDATION_ERROR",
"request_id": "req_01JABCD123",
"errors": {
"project_id": [
"Required field"
]
}
}{
"type": "https://docs.bedrock.cv/errors/authentication",
"title": "Unauthorized",
"status": 401,
"detail": "Invalid or missing API key.",
"code": "UNAUTHORIZED",
"request_id": "req_01JABCD123"
}{
"type": "https://docs.bedrock.cv/errors/rate-limit",
"title": "Rate limited",
"status": 429,
"detail": "Rate limit exceeded. Try again in 60 seconds.",
"code": "RATE_LIMITED",
"request_id": "req_01JABCD123"
}Files
Create file
Create a file record and get a signed upload URL.
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"
}
'import requests
url = "https://api.bedrock.cv/files"
payload = {
"project_id": "prj_01JABCD123",
"filename": "site-photo.jpg",
"content_type": "image/jpeg"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: 'prj_01JABCD123',
filename: 'site-photo.jpg',
content_type: 'image/jpeg'
})
};
fetch('https://api.bedrock.cv/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bedrock.cv/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => 'prj_01JABCD123',
'filename' => 'site-photo.jpg',
'content_type' => 'image/jpeg'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bedrock.cv/files"
payload := strings.NewReader("{\n \"project_id\": \"prj_01JABCD123\",\n \"filename\": \"site-photo.jpg\",\n \"content_type\": \"image/jpeg\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bedrock.cv/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": \"prj_01JABCD123\",\n \"filename\": \"site-photo.jpg\",\n \"content_type\": \"image/jpeg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bedrock.cv/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": \"prj_01JABCD123\",\n \"filename\": \"site-photo.jpg\",\n \"content_type\": \"image/jpeg\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}{
"type": "https://docs.bedrock.cv/errors/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "One or more request fields are invalid.",
"code": "VALIDATION_ERROR",
"request_id": "req_01JABCD123",
"errors": {
"project_id": [
"Required field"
]
}
}{
"type": "https://docs.bedrock.cv/errors/authentication",
"title": "Unauthorized",
"status": 401,
"detail": "Invalid or missing API key.",
"code": "UNAUTHORIZED",
"request_id": "req_01JABCD123"
}{
"type": "https://docs.bedrock.cv/errors/rate-limit",
"title": "Rate limited",
"status": 429,
"detail": "Rate limit exceeded. Try again in 60 seconds.",
"code": "RATE_LIMITED",
"request_id": "req_01JABCD123"
}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
# 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
BearerAuthApiKeyAuth
API key prefixed with sk_. Example: Authorization: Bearer sk_xxx
Headers
API version
Body
application/json
Response
Success
Show child attributes
Show child attributes
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"
}
⌘I