Identify the effective limits
Callstudio_get_upload_policy with workspace. It returns accept
(allowed file extensions), ordinaryMaxBytes, whether resumable uploads are
enabled, and the chunkBytes, maxBytes, maxParts, maxConcurrent
and multipartThresholdBytes values. Workspace and server restrictions
can change. Treat the returned limits as specific to that workspace.
Upload a single file
Callstudio_prepare_file_upload with workspace, then POST multipart
form data to its uploadPath. Send the file in file and optionally
send the destination folder ULID in parent. Omit parent for the root.
id, versionId and revision.
Import an image with supplied renditions
Callstudio_prepare_image_import with workspace. Use its separate
uploadPath with the original in file and 1–12 named images under
variants. An optional roles map assigns the thumbnail or preview to
a variant from this request.
[a-z][a-z0-9_-]{0,22}. The saved presets acquire the
import- prefix. Each image must meet workspace file policy and the
40-million-pixel validation limit. The complete bundle must fit the ordinary
upload byte limit. The source and supplied conversions belong to one version.
Resumable uploads
- Call
studio_begin_uploadwithworkspace, the filename inname, declared bytesize, and retrykey. Optionally provideparentanddirect: trueto prefer S3 Multipart. - Record the returned session
id,transport,chunkBytes,sizeandacceptedParts. The card also returns the state and either the published entry orentry: null. It addspartPathPrefixfor local transport. - Split the original into
chunkByteschunks starting at index 0. The last part contains the remainder. Hash the exact bytes of each part with SHA-256. RespectmaxConcurrent. If the connection drops, querystudio_get_uploadwith the same credential and resume the missing indices. - Call
studio_complete_uploadwithworkspaceandsessionafter all parts are accepted. A successful completion returns the published entry. Usestudio_cancel_uploadfor an unfinished session that should be discarded.
Local chunks
Send a binary PUT topartPathPrefix plus the zero-based part index. Include
X-Part-SHA256 as 64 lowercase hex characters. The HTTP result is
{"accepted":true}. An accepted index can be retried with the same bytes.
S3 Multipart
Use the transport returned bystudio_begin_upload. direct: true is a
preference, and Studio may return local transport. For Multipart, call
studio_sign_upload_part with workspace, session, part and
sha256. PUT the exact bytes to its signed URL using the returned headers.
Keep the S3 ETag, including its quotes, and call studio_record_upload_part
with workspace, session, part and etag. A signed part only appears in
acceptedParts after recording. If a URL expires, ask for a new signature for
the same index and checksum. Never forward the Studio bearer token to S3.
Download an authorized version
Callstudio_prepare_file_download with workspace, entry and
optionally version. If you omit the version, Studio resolves the current
version when preparing the link. GET the returned downloadPath on the Studio
origin with the bearer token. The binary route checks workspace, permission
and version again. Set the output to a local path you control.