Skip to content
cartage

API quickstart

Send a folder from a script. You need a Freight, Studio or Bulk workspace and an API token with transfers:write.

1. Create a transfer

A transfer describes what you are about to upload. Cartage answers with an upload session and the part size to use.

curl -X POST https://mirror-fr.edokus.ru/api/v1/transfers \
  -H "Authorization: Bearer $CARTAGE_TOKEN" \
  -H "Idempotency-Key: brightwater-v7" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Brightwater_Reel_Final_v7",
    "region": "eu-north",
    "expires_in": "14d",
    "files": [{"path": "reel/A001.mov", "size": 53687091200}]
  }'

{
  "id": "t_8x41kd", "state": "pending",
  "upload": {"session": "u_71c2", "part_size": 16777216, "max_parallel": 8,
             "expires_at": "2026-11-12T09:41:07Z"},
  "link": "https://mirror-fr.edokus.ru/d/9fK2-Wq7vLmE"
}

Send the same Idempotency-Key again and you get the same transfer back, not a second one. Keys are remembered for 24 hours.

2. Upload the parts

Parts are numbered from 1. Send each with its SHA-256 so a damaged part is refused rather than stored.

curl -X PUT https://mirror-fr.edokus.ru/api/v1/uploads/u_71c2/parts/1 \
  -H "Authorization: Bearer $CARTAGE_TOKEN" \
  -H "X-Cartage-Sha256: 9c1e5b07a44d03f2e8b61c9d5f02a7d13b8e64c07d19a2fe0b3c55a6e1d49f80" \
  --data-binary @part-0001.bin

The 201 response carries the part's etag. A 409 means the part is already stored with different content; ask for the session state and carry on from there. Details are in resumable uploads.

3. Complete and share

curl -X POST https://mirror-fr.edokus.ru/api/v1/transfers/t_8x41kd/complete \
  -H "Authorization: Bearer $CARTAGE_TOKEN"

{"id": "t_8x41kd", "state": "ready", "size": 53687091200,
 "link": "https://mirror-fr.edokus.ru/d/9fK2-Wq7vLmE",
 "expires_at": "2026-10-22T09:41:07Z", "receipt": "R-4F29A8C1"}

The same thing in Python

from cartage import Client

c = Client(token=os.environ["CARTAGE_TOKEN"])
t = c.transfers.put("./brightwater", expires_in="14d", region="eu-north")
print(t.link, t.receipt)      # resumes automatically if the process restarts

Errors you will meet

StatuserrorWhat to do
401invalid_tokenCheck the token and its scopes.
402plan_limitMonthly volume reached; upgrade or wait for the reset on the 1st.
413transfer_too_largeOver 100 GB (1 TB on Bulk). Split the set.
422validation_failedThe message names the field.
429rate_limitedWait for Retry-After seconds.

Tokens begin with ctg_live_ and are shown once. If one leaks, revoke it in Settings; the revocation takes effect within 5 seconds worldwide.