Skip to main content
POST
/
bridge
/
api
/
v1
/
workspaces
/
{workspaceId}
/
files
Create presigned uploads for files
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": "<string>",
    "checksumBase64": "<string>",
    "contentType": "image/jpeg"
  }
]
'
import requests

url = "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/files"

payload = [
{
"name": "<string>",
"checksumBase64": "<string>",
"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: '<string>', checksumBase64: '<string>', 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' => '<string>',
'checksumBase64' => '<string>',
'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\": \"<string>\",\n \"checksumBase64\": \"<string>\",\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\": \"<string>\",\n \"checksumBase64\": \"<string>\",\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\": \"<string>\",\n \"checksumBase64\": \"<string>\",\n \"contentType\": \"image/jpeg\"\n }\n]"

response = http.request(request)
puts response.read_body
[
  {
    "mediaId": "<string>",
    "presignUrl": {
      "url": "<string>",
      "method": "PUT",
      "headers": {}
    }
  }
]
{
"title": "Forbidden",
"status": 403,
"code": "BRIDGE_CORE_0301"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

x-api-key
string
header
required

Copy the API key as provided by the Bridge Console.

Path Parameters

workspaceId
string<uuid>
required

Unique identifier of the workspace (UUID v4).

Example:

"b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234"

Body

application/json
name
string
required

Original file name including extension.

Example:

"prueba.jpg"

fileType
enum<string>
required

Logical file type category.

Available options:
IMAGE,
VIDEO,
AUDIO,
DOCUMENT,
STICKER,
GIF
Examples:

"IMAGE"

"VIDEO"

"AUDIO"

"DOCUMENT"

checksumBase64
string
required

Base64-encoded SHA-256 digest of the entire file. This value will be used to sign the presigned PUT and must be sent back in the header x-amz-checksum-sha256 during upload.

Example:

"OaZ+I0yqf3u3u5w8h0Y2v4e7W9vHh3zbn2mA2m1yPVo="

contentType
string | null

MIME type of the file.

Example:

"image/jpeg"

Response

Successful Response

mediaId
string
required

Unique media identifier.

Example:

"4a2c1f7e-2f84-4a5f-bd2d-6b6b2f0c1234"

presignUrl
Presign Url · object
required

Presigned PUT data to upload the media (url, method and headers).