Upload a file
curl --request POST \
--url https://api.bachs.io/v1/utilities/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form scope=generalconst form = new FormData();
form.append('file', '<string>');
form.append('scope', 'general');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.bachs.io/v1/utilities/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.bachs.io/v1/utilities/uploads"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "scope": "general" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bachs.io/v1/utilities/uploads"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\ngeneral\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))
}{
"upload_id": "upl_4f3e2d1c",
"file_name": "product-hero.png",
"mime_type": "image/png",
"file_size_bytes": 204800,
"url": "https://cdn.bachs.io/uploads/upl_4f3e2d1c/product-hero.png",
"linked_resource_type": null,
"linked_resource_id": null,
"created_at": "2026-01-24T12:00:00.000Z",
"updated_at": "2026-01-24T12:00:00.000Z"
}{
"detail": "Validation failed for one or more fields",
"error_code": "VALIDATION_ERROR",
"doc_url": "https://docs.bachs.io/api-reference/error-reference#general",
"errors": [
{
"field": "name",
"message": "This field is required",
"type": "missing"
}
]
}{
"detail": "Invalid API key",
"error_code": "UNAUTHORIZED"
}Media
Upload a file
Upload a product image and receive an upload_id. Pass this ID in the media array when creating or updating a product.
Files must be sent as multipart/form-data. Maximum size is 20 MB.
This endpoint is for product media. For a person’s identity document or a company filing, use Upload a compliance file instead. It checks the file type and records what the file is for.
POST
/
v1
/
utilities
/
uploads
Upload a file
curl --request POST \
--url https://api.bachs.io/v1/utilities/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form scope=generalconst form = new FormData();
form.append('file', '<string>');
form.append('scope', 'general');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.bachs.io/v1/utilities/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.bachs.io/v1/utilities/uploads"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "scope": "general" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bachs.io/v1/utilities/uploads"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\ngeneral\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))
}{
"upload_id": "upl_4f3e2d1c",
"file_name": "product-hero.png",
"mime_type": "image/png",
"file_size_bytes": 204800,
"url": "https://cdn.bachs.io/uploads/upl_4f3e2d1c/product-hero.png",
"linked_resource_type": null,
"linked_resource_id": null,
"created_at": "2026-01-24T12:00:00.000Z",
"updated_at": "2026-01-24T12:00:00.000Z"
}{
"detail": "Validation failed for one or more fields",
"error_code": "VALIDATION_ERROR",
"doc_url": "https://docs.bachs.io/api-reference/error-reference#general",
"errors": [
{
"field": "name",
"message": "This field is required",
"type": "missing"
}
]
}{
"detail": "Invalid API key",
"error_code": "UNAUTHORIZED"
}Authorizations
Bearer token authentication. Pass your API key as Authorization: Bearer sk_.... See Authentication for keys, scopes, and sandbox vs production.
Headers
Body
multipart/form-data
Response
Upload created
A stored file and its metadata.

