Uploading files
Initiate up to 1,000 uploads
The batched form of initiate, and what the desktop app uses. Up to 1,000 files per call. Results are per-file and isolated: a file whose content already exists in this project comes back as `{ dedup: true }` with no upload URL (skip the PUT, confirm with `dedup: true`), and a file that fails validation comes back as `{ path, error }` without sinking the batch.
POST
/api/v1/projects/{projectId}/files/upload/initiate-batchRequest
json
{
"files": [
{ "path": "Content/FX/P_Smoke.uasset", "sha256": "aa11...", "size": 20480, "contentMd5": "..." },
{ "path": "Content/FX/P_Fire.uasset", "sha256": "bb22...", "size": 30720, "contentMd5": "..." }
]
}Response
json
{
"results": [
{
"path": "Content/FX/P_Smoke.uasset",
"fileId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"version": 4,
"storageKey": "1b9d6bcd/7c9e6679/f47ac10b/4/aa11_P_Smoke.uasset",
"uploadUrl": "https://s3.eu-central-003.backblazeb2.com/...",
"requiredHeaders": { "Content-Length": "20480", "Content-MD5": "..." }
},
{
"path": "Content/FX/P_Fire.uasset",
"fileId": "9c0f1a77-4e2b-4d18-b3aa-51c7e9d0b246",
"version": 2,
"dedup": true
}
]
}Examples
curlbash
curl -X POST https://usourcecontrol.com/api/v1/projects/7c9e6679-7425-40de-944b-e07fc1f90ae7/files/upload/initiate-batch \
-H "Authorization: Bearer usc_your_project_key" \
-H "Content-Type: application/json" \
-d '{
"files": [
{ "path": "Content/FX/P_Smoke.uasset", "sha256": "aa11...", "size": 20480, "contentMd5": "..." },
{ "path": "Content/FX/P_Fire.uasset", "sha256": "bb22...", "size": 30720, "contentMd5": "..." }
]
}'Try it
Try itChanges data
POST/api/v1/projects/{projectId}/files/upload/initiate-batch
Kept in this tab only, sent straight to the API, and never to our servers. Create one in your project’s settings.
This is a POST request against the live API. It will really run, on the real project the key belongs to.