Skip to main content
POST
/
builders
/
{builderId}
/
attachments
/
bulk-upload
Bulk upload attachments
curl --request POST \
  --url https://api.buildpass.global/builders/{builderId}/attachments/bulk-upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form type=attachment \
  --form file:0='@example-file' \
  --form type:0=attachment \
  --form file:1='@example-file' \
  --form type:1=attachment
import requests

url = "https://api.buildpass.global/builders/{builderId}/attachments/bulk-upload"

files = {
"file:0": ("example-file", open("example-file", "rb")),
"file:1": ("example-file", open("example-file", "rb"))
}
payload = {
"type": "attachment",
"type:0": "attachment",
"type:1": "attachment"
}
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.text)
const form = new FormData();
form.append('type', 'attachment');
form.append('file:0', '<string>');
form.append('type:0', 'attachment');
form.append('file:1', '<string>');
form.append('type:1', 'attachment');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

fetch('https://api.buildpass.global/builders/{builderId}/attachments/bulk-upload', 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.buildpass.global/builders/{builderId}/attachments/bulk-upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nattachment\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file:0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type%3A0\"\r\n\r\nattachment\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file:1\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type%3A1\"\r\n\r\nattachment\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);

$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.buildpass.global/builders/{builderId}/attachments/bulk-upload"

payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nattachment\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file:0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type%3A0\"\r\n\r\nattachment\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file:1\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type%3A1\"\r\n\r\nattachment\r\n-----011000010111000001101001--")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")

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.buildpass.global/builders/{builderId}/attachments/bulk-upload")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nattachment\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file:0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type%3A0\"\r\n\r\nattachment\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file:1\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type%3A1\"\r\n\r\nattachment\r\n-----011000010111000001101001--")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.buildpass.global/builders/{builderId}/attachments/bulk-upload")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nattachment\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file:0\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type%3A0\"\r\n\r\nattachment\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file:1\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type%3A1\"\r\n\r\nattachment\r\n-----011000010111000001101001--"

response = http.request(request)
puts response.read_body
{
  "uploads": [
    {
      "key": "external-uploads/ckbuilder123456789012345678/photo.jpg",
      "type": "attachment",
      "regionId": "au1",
      "imageUrl": "<string>",
      "fileName": "<string>",
      "contentType": "<string>",
      "fieldName": "<string>"
    }
  ]
}
Requires a valid authenticated request for the builder. No resource-specific scope is required for upload. Uploads multiple attachment files into BuildPass-managed attachment storage and returns attachment references. Include type=attachment in the multipart body to apply the same type to all files, or type:0=attachment, type:1=attachment, and so on to set a type per file. The type tells BuildPass which storage family to use; attachment is the only externally supported upload type for now. For example, you can use each returned { key, regionId, type } to bulk upsert photos by passing it as photos[].imageAttachment.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

builderId
string
required

Body

multipart/form-data
type
enum<string>
required

Upload type to apply to every file.

Available options:
attachment
file:0
file
type:0
enum<string>

Optional upload type for file:0.

Available options:
attachment
file:1
file
type:1
enum<string>

Optional upload type for file:1.

Available options:
attachment

Response

201 - application/json

Attachments uploaded

uploads
object[]