Append a segment
curl --request POST \
--url https://api.usepatchwork.co/v1/files/{id}/append \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form segment_index=123 \
--form chunk=@example-fileconst form = new FormData();
form.append('segment_index', '123');
form.append('chunk', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.usepatchwork.co/v1/files/{id}/append', 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}/append"
files = { "chunk": ("example-file", open("example-file", "rb")) }
payload = { "segment_index": "123" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, 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>"
}
}{
"status": "error",
"error": {
"message": "<string>",
"code": "<string>",
"details": "<unknown>"
}
}Files
Append a segment
Upload one segment of a chunked upload. Idempotent per segment_index — re-send an index to overwrite it (that is how you resume). Every segment except the last must be exactly segment_size bytes.
POST
/
v1
/
files
/
{id}
/
append
Append a segment
curl --request POST \
--url https://api.usepatchwork.co/v1/files/{id}/append \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form segment_index=123 \
--form chunk=@example-fileconst form = new FormData();
form.append('segment_index', '123');
form.append('chunk', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.usepatchwork.co/v1/files/{id}/append', 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}/append"
files = { "chunk": ("example-file", open("example-file", "rb")) }
payload = { "segment_index": "123" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, 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>"
}
}{
"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:
255Path Parameters
Response
Segment stored. Returns the upload's current state.