Finalize a chunked upload
curl --request POST \
--url https://api.usepatchwork.co/v1/files/{id}/finalize \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usepatchwork.co/v1/files/{id}/finalize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.usepatchwork.co/v1/files/{id}/finalize"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"status": "success",
"data": {
"id": "<string>",
"state": "uploading",
"created_at": "2023-11-07T05:31:56Z",
"media_type": "<string>",
"filename": "<string>",
"size": 123,
"sha256": "<string>",
"segment_size": 123,
"received_segments": [
123
],
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Files
Finalize a chunked upload
Assemble the segments into the final file and compute its SHA-256. Returns the ready handle.
POST
/
v1
/
files
/
{id}
/
finalize
Finalize a chunked upload
curl --request POST \
--url https://api.usepatchwork.co/v1/files/{id}/finalize \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usepatchwork.co/v1/files/{id}/finalize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.usepatchwork.co/v1/files/{id}/finalize"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"status": "success",
"data": {
"id": "<string>",
"state": "uploading",
"created_at": "2023-11-07T05:31:56Z",
"media_type": "<string>",
"filename": "<string>",
"size": 123,
"sha256": "<string>",
"segment_size": 123,
"received_segments": [
123
],
"expires_at": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Authorizations
Identify accepts a workspace API key (sk_…). Loom accepts either a short-lived session token (direct) or a workspace API key (relay).
Headers
Makes this POST safe to retry. The first call does the work and its response is stored; a retry with the same key returns that stored response with Idempotency-Replayed: true, without charging again. Same key with a different body is rejected. Keys expire after 24 hours.
Maximum string length:
255