Uploading files

Initiate a file upload

Reserve a file version and get a presigned PUT URL. `contentMd5` is required — it is signed into the URL alongside the byte length, so storage rejects any body that doesn't match exactly. Send the returned `requiredHeaders` verbatim on your PUT. Max file size: 5 GB (413 above that).

POST/api/v1/projects/{projectId}/files/upload/initiate

Request

Body
json
{
  "path": "Content/Maps/MainLevel.umap",
  "sha256": "a1b2c3...",
  "size": 524288000,
  "contentMd5": "rL0Y20zC+Fzt72VPzMSk2A=="
}

Response

200 OK
json
{
  "path": "Content/Maps/MainLevel.umap",
  "fileId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "version": 12,
  "storageKey": "1b9d6bcd/7c9e6679/f47ac10b/12/a1b2c3_MainLevel.umap",
  "uploadUrl": "https://s3.eu-central-003.backblazeb2.com/...",
  "requiredHeaders": {
    "Content-Length": "524288000",
    "Content-MD5": "rL0Y20zC+Fzt72VPzMSk2A=="
  }
}

Examples

curlbash
curl -X POST https://usourcecontrol.com/api/v1/projects/7c9e6679-7425-40de-944b-e07fc1f90ae7/files/upload/initiate \
  -H "Authorization: Bearer usc_your_project_key" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "Content/Maps/MainLevel.umap",
    "sha256": "a1b2c3...",
    "size": 524288000,
    "contentMd5": "rL0Y20zC+Fzt72VPzMSk2A=="
  }'

Try it

Try itChanges data
POST/api/v1/projects/{projectId}/files/upload/initiate

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.

Was this helpful?

Back to top