Upload a single CAS blob for an upload session
PUT
/v1/upload-sessions/{uploadSessionId}/blobs/{sha256}
const url = 'https://api.presscloud.example/v1/upload-sessions/example/blobs/example';const options = { method: 'PUT', headers: { 'X-Upload-Token': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/octet-stream' }, body: 'binary'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.presscloud.example/v1/upload-sessions/example/blobs/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/octet-stream' \ --header 'X-Upload-Token: example' \ --data binaryUploads one raw file blob addressed by sha256 and stores it in CAS if it is referenced by the upload session.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” uploadSessionId
required
string
sha256
required
string
Header Parameters
Section titled “Header Parameters ” X-Upload-Token
required
string
Opaque session token returned when the upload session is created.
Request Body required
Section titled “Request Body required ” Media type application/octet-stream
string format: binary
Responses
Section titled “ Responses ”Blob uploaded or confirmed present.
Media type application/json
object
uploadSessionId
required
string
alreadyPresent
required
boolean
blob
required
object
sha256
required
string
size
required
integer
mime
string
r2Key
required
string
Example generated
{ "uploadSessionId": "example", "alreadyPresent": true, "blob": { "sha256": "example", "size": 1, "mime": "example", "r2Key": "example" }}Invalid request payload or parameters.
Media type application/json
object
error
required
string
message
required
string
Example generated
{ "error": "example", "message": "example"}Authentication material for the operation is missing.
Media type application/json
object
error
required
string
message
required
string
Example generated
{ "error": "example", "message": "example"}The caller is not permitted to perform the operation.
Media type application/json
object
error
required
string
message
required
string
Example generated
{ "error": "example", "message": "example"}Requested resource was not found.
Media type application/json
object
error
required
string
message
required
string
Example generated
{ "error": "example", "message": "example"}Requested operation conflicts with the current resource state.
Media type application/json
object
error
required
string
message
required
string
Example generated
{ "error": "example", "message": "example"}The requested resource is no longer available.
Media type application/json
object
error
required
string
message
required
string
Example generated
{ "error": "example", "message": "example"}