curl --request POST \
--url https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
[
{
"name": "prueba.jpg",
"fileType": "IMAGE",
"checksumBase64": "OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=",
"contentType": "image/jpeg"
}
]
'import requests
url = "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files"
payload = [
{
"name": "prueba.jpg",
"fileType": "IMAGE",
"checksumBase64": "OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=",
"contentType": "image/jpeg"
}
]
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
name: 'prueba.jpg',
fileType: 'IMAGE',
checksumBase64: 'OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=',
contentType: 'image/jpeg'
}
])
};
fetch('https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/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-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/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([
[
'name' => 'prueba.jpg',
'fileType' => 'IMAGE',
'checksumBase64' => 'OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=',
'contentType' => 'image/jpeg'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files"
payload := strings.NewReader("[\n {\n \"name\": \"prueba.jpg\",\n \"fileType\": \"IMAGE\",\n \"checksumBase64\": \"OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=\",\n \"contentType\": \"image/jpeg\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"name\": \"prueba.jpg\",\n \"fileType\": \"IMAGE\",\n \"checksumBase64\": \"OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=\",\n \"contentType\": \"image/jpeg\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"name\": \"prueba.jpg\",\n \"fileType\": \"IMAGE\",\n \"checksumBase64\": \"OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=\",\n \"contentType\": \"image/jpeg\"\n }\n]"
response = http.request(request)
puts response.read_body[
{
"mediaId": "4a2c1f7e-2f84-4a5f-bd2d-6b6b2f0c1234",
"presignUrl": {
"url": "https://s3.amazonaws.com/bucket/path/to/object",
"method": "PUT",
"headers": {
"Content-Type": "image/jpeg",
"x-amz-checksum-sha256": "OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo="
}
}
}
]{
"title": "Forbidden",
"status": 403,
"code": "BRIDGE_CORE_0301"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"title": "Too Many Requests",
"status": 429,
"code": "BRIDGE_RATE_LIMIT_0001"
}Create presigned uploads for files
Upload an attachment, such as a PDF, image, or document, before creating a message. This operation returns presigned PUT data; the file bytes are uploaded separately. After the upload succeeds, use the returned mediaId in the sending operation. Follow Send an attachment for the checksum, upload, and message steps.
Generates presigned URLs to upload files (Presigned PUT). Validates extension, contentType, and type-specific limits. Checksum required: send SHA-256 digest in checksumBase64 (Base64). Upload must include header x-amz-checksum-sha256 with the same value.
To upload your files, you MUST use the returned presigned URL with the HTTP PUT method. Ensure that you upload the file exactly to the URL indicated, without modifications (as required by AWS S3 Presigned URL PUT usage). Refer to the official AWS S3 documentation on Presigned PUT URLs for details: AWS S3 Presigned PUT Documentation. Be sure to include all required headers as specified in the response (e.g., ‘x-amz-checksum-sha256’ with the correct SHA-256 value). If you fail to use the correct HTTP method or headers, AWS will reject the upload request.
| Type | Extension | Content Type | Max Size |
|---|---|---|---|
| Image | .jpeg | image/jpeg | 16 MB |
| .jpg | image/jpeg | ||
| .png | image/png | ||
| .webp | image/webp | ||
| GIF | .gif | image/gif | 3 MB |
| .mp4 | video/mp4 | ||
| Video | .avi | video/x-msvideo | 64 MB |
| .mov | video/quicktime | ||
| .mp4 | video/mp4 | ||
| Audio | .m4a | audio/mp4 | 16 MB |
| .mp3 | audio/mpeg | ||
| .ogg | audio/ogg | ||
| .wav | audio/wav | ||
| Document | .doc | application/msword | 100 MB |
| .docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | ||
| application/pdf | |||
| .ppt | application/vnd.ms-powerpoint | ||
| .pptx | application/vnd.openxmlformats-officedocument.presentationml.presentation | ||
| .txt | text/plain | ||
| .xls | application/vnd.ms-excel | ||
| .xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
curl --request POST \
--url https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
[
{
"name": "prueba.jpg",
"fileType": "IMAGE",
"checksumBase64": "OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=",
"contentType": "image/jpeg"
}
]
'import requests
url = "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files"
payload = [
{
"name": "prueba.jpg",
"fileType": "IMAGE",
"checksumBase64": "OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=",
"contentType": "image/jpeg"
}
]
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
name: 'prueba.jpg',
fileType: 'IMAGE',
checksumBase64: 'OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=',
contentType: 'image/jpeg'
}
])
};
fetch('https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/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-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/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([
[
'name' => 'prueba.jpg',
'fileType' => 'IMAGE',
'checksumBase64' => 'OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=',
'contentType' => 'image/jpeg'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files"
payload := strings.NewReader("[\n {\n \"name\": \"prueba.jpg\",\n \"fileType\": \"IMAGE\",\n \"checksumBase64\": \"OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=\",\n \"contentType\": \"image/jpeg\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"name\": \"prueba.jpg\",\n \"fileType\": \"IMAGE\",\n \"checksumBase64\": \"OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=\",\n \"contentType\": \"image/jpeg\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"name\": \"prueba.jpg\",\n \"fileType\": \"IMAGE\",\n \"checksumBase64\": \"OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo=\",\n \"contentType\": \"image/jpeg\"\n }\n]"
response = http.request(request)
puts response.read_body[
{
"mediaId": "4a2c1f7e-2f84-4a5f-bd2d-6b6b2f0c1234",
"presignUrl": {
"url": "https://s3.amazonaws.com/bucket/path/to/object",
"method": "PUT",
"headers": {
"Content-Type": "image/jpeg",
"x-amz-checksum-sha256": "OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo="
}
}
}
]{
"title": "Forbidden",
"status": 403,
"code": "BRIDGE_CORE_0301"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"title": "Too Many Requests",
"status": 429,
"code": "BRIDGE_RATE_LIMIT_0001"
}Path Parameters
Body
Was this page helpful?

