Uploads
Getting files to us: each file goes straight to storage, in one send up to 5 GB or in parts. Uploading files shows the whole flow.
On this page
POST/v1/uploads
Starts one upload per file and gives the first part links for each. A file of up to 5 GB gets one link for the whole file: send it with PUT in one request. A larger file, or any file when multipart is true, goes in parts: send each part with PUT to its url, as the raw bytes of that part. Every part is part_size bytes except the last. Then call complete. The sizes and types are checked now, before anything is sent; the file's content is checked when it's complete.
Headers
Idempotency-KeystringAny unique text, such as a UUID, sent again unchanged with every retry of the same request. Kept for 24 hours.
Up to 255 characters
Request body
operationstringRequiredThe operation the files are for. It decides the types and sizes allowed.
filesobject[]Required1 to 50 items
files[].namestringRequiredThe file's name, with its extension.
files[].sizeintegerRequiredIts size in bytes.
At least 1
files[].typestringIts media type, such as
video/mp4, if you know it.multipartbooleanSend every file in parts, whatever its size. Without it, a file of up to 5 GB gets one link for the whole file.
Default
false
Returns
- 201The uploads, with each one's first part links.
11 fields
filesobject[]Requiredfiles[].idstringRequiredfiles[].namestringRequiredThe name, cleaned of anything unsafe.
files[].sizeintegerRequiredfiles[].part_sizeintegerRequiredThe size of every part except the last; the file's size when it goes in one request.
files[].part_countintegerRequiredAt least 1
files[].partsobject[]RequiredLinks for the first parts. Ask for the rest with
POST /v1/uploads/{id}/parts.files[].parts[].numberintegerRequiredAt least 1
files[].parts[].urlstring (URL)RequiredSend the part's bytes here with
PUT. The link works for one hour.files[].links_expire_atstring (date-time)Requiredfiles[].delete_atstring (date-time)RequiredWhen the file is deleted if no job uses it.
Errors
Example
curl -X POST https://api.filesokay.com/v1/uploads \
-H "Authorization: Bearer $FILESOKAY_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"operation": "video.compress",
"files": [
{
"name": "lecture.mp4",
"size": 12417467,
"type": "video/mp4"
}
]
}'const res = await fetch("https://api.filesokay.com/v1/uploads", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
operation: "video.compress",
files: [
{
name: "lecture.mp4",
size: 12417467,
type: "video/mp4"
}
]
}),
});
const uploads = await res.json();import os
import uuid
import requests
res = requests.post(
"https://api.filesokay.com/v1/uploads",
headers={
"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"operation": "video.compress",
"files": [
{
"name": "lecture.mp4",
"size": 12417467,
"type": "video/mp4"
}
]
},
)
uploads = res.json(){
"files": [
{
"id": "file_3cf0737aefa34b89b7b4443c9467d60c",
"name": "lecture.mp4",
"size": 12417467,
"part_size": 12417467,
"part_count": 1,
"parts": [
{
"number": 1,
"url": "https://…"
}
],
"links_expire_at": "2026-12-03T10:22:53Z",
"delete_at": "2026-12-10T09:22:52Z"
}
]
}GET/v1/uploads/{id}
The parts storage already has, so an interrupted upload sends only the missing ones. Once the upload is complete, the answer is the file.
Path parameters
idstringRequired
Returns
- 200The upload's progress, or the file once it's complete.
UploadProgress · 9 fields
idstringRequiredstatestringRequiredsizeintegerRequiredpart_sizeintegerRequiredpart_countintegerRequiredparts_receivedobject[]Requiredparts_received[].numberintegerRequiredparts_received[].sizeintegerRequireddelete_atstring (date-time)Required
File · 18 fields
idstringRequirednamestringRequiredoperationstringRequiredThe operation it was uploaded for.
statestringRequiredOne of
uploadingoruploadedsizeintegerRequiredcreated_atstring (date-time)Requireduploaded_atstring (date-time)delete_atstring (date-time)When it's deleted. Left out while a job uses it.
checkobjectThe check of the file's content when its upload completed.
check.statestringRequiredproceed: an operation can use it.refuse: it can't, forreason.couldnt_read: the check couldn't read all of it; a job reads it in full.check_failed: a problem on our side; complete the upload again to retry.One of
checking,proceed,refuse,couldnt_read, orcheck_failedcheck.reasonstringcheck.detailobjectcheck.kindstringWhat the file really is, such as
video.check.typestringIts real format, such as
mp4, whatever its name says.check.factsobjectWhat the check read, such as a video's length, size and codecs.
check.facts_completebooleandownload_urlstring (URL)Only on
GET /v1/files/{id}, once it's uploaded.download_expires_atstring (date-time)
Errors
Example
curl https://api.filesokay.com/v1/uploads/file_3cf0737aefa34b89b7b4443c9467d60c \
-H "Authorization: Bearer $FILESOKAY_KEY"const res = await fetch("https://api.filesokay.com/v1/uploads/file_3cf0737aefa34b89b7b4443c9467d60c", {
headers: {
Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
},
});
const progress = await res.json();import os
import requests
res = requests.get(
"https://api.filesokay.com/v1/uploads/file_3cf0737aefa34b89b7b4443c9467d60c",
headers={
"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
},
)
progress = res.json(){
"delete_at": "2026-12-10T09:22:52Z",
"id": "file_3cf0737aefa34b89b7b4443c9467d60c",
"part_count": 1,
"part_size": 12417467,
"parts_received": [
{
"number": 1,
"size": 12417467
}
],
"size": 12417467,
"state": "uploading"
}DELETE/v1/uploads/{id}
Cancels the upload and discards the parts already sent.
Path parameters
idstringRequired
Returns
- 204Cancelled.
Errors
Example
curl -X DELETE https://api.filesokay.com/v1/uploads/file_3cf0737aefa34b89b7b4443c9467d60c \
-H "Authorization: Bearer $FILESOKAY_KEY"const res = await fetch("https://api.filesokay.com/v1/uploads/file_3cf0737aefa34b89b7b4443c9467d60c", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
},
});
console.log(res.status);import os
import requests
res = requests.delete(
"https://api.filesokay.com/v1/uploads/file_3cf0737aefa34b89b7b4443c9467d60c",
headers={
"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
},
)
print(res.status_code)POST/v1/uploads/{id}/parts
Links for up to 100 parts at once, for a large file or links that expired.
Path parameters
idstringRequired
Request body
part_numbersinteger[]Required1 to 100 items
Returns
- 200The links.
4 fields
partsobject[]Requiredparts[].numberintegerRequiredAt least 1
parts[].urlstring (URL)RequiredSend the part's bytes here with
PUT. The link works for one hour.links_expire_atstring (date-time)Required
Errors
Example
curl -X POST https://api.filesokay.com/v1/uploads/file_20f80f7404ff41858dc0a0544f059576/parts \
-H "Authorization: Bearer $FILESOKAY_KEY" \
-H "Content-Type: application/json" \
-d '{
"part_numbers": [
21,
22,
23
]
}'const res = await fetch("https://api.filesokay.com/v1/uploads/file_20f80f7404ff41858dc0a0544f059576/parts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
part_numbers: [
21,
22,
23
]
}),
});
const links = await res.json();import os
import requests
res = requests.post(
"https://api.filesokay.com/v1/uploads/file_20f80f7404ff41858dc0a0544f059576/parts",
headers={
"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
},
json={
"part_numbers": [
21,
22,
23
]
},
)
links = res.json(){
"links_expire_at": "2026-12-03T19:00:33Z",
"parts": [
{
"number": 21,
"url": "https://…"
},
{
"number": 22,
"url": "https://…"
},
{
"number": 23,
"url": "https://…"
}
]
}POST/v1/uploads/{id}/complete
Joins the parts and checks the file's content. The answer is the file with its check: proceed means an operation can use it. Calling it again gives the same answer. A part missing or of the wrong length is named in a 409 answer.
Path parameters
idstringRequired
Returns
- 200The file and its check.
18 fields
idstringRequirednamestringRequiredoperationstringRequiredThe operation it was uploaded for.
statestringRequiredOne of
uploadingoruploadedsizeintegerRequiredcreated_atstring (date-time)Requireduploaded_atstring (date-time)delete_atstring (date-time)When it's deleted. Left out while a job uses it.
checkobjectThe check of the file's content when its upload completed.
check.statestringRequiredproceed: an operation can use it.refuse: it can't, forreason.couldnt_read: the check couldn't read all of it; a job reads it in full.check_failed: a problem on our side; complete the upload again to retry.One of
checking,proceed,refuse,couldnt_read, orcheck_failedcheck.reasonstringcheck.detailobjectcheck.kindstringWhat the file really is, such as
video.check.typestringIts real format, such as
mp4, whatever its name says.check.factsobjectWhat the check read, such as a video's length, size and codecs.
check.facts_completebooleandownload_urlstring (URL)Only on
GET /v1/files/{id}, once it's uploaded.download_expires_atstring (date-time)
Errors
Example
curl -X POST https://api.filesokay.com/v1/uploads/file_3cf0737aefa34b89b7b4443c9467d60c/complete \
-H "Authorization: Bearer $FILESOKAY_KEY"const res = await fetch("https://api.filesokay.com/v1/uploads/file_3cf0737aefa34b89b7b4443c9467d60c/complete", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
},
});
const file = await res.json();import os
import requests
res = requests.post(
"https://api.filesokay.com/v1/uploads/file_3cf0737aefa34b89b7b4443c9467d60c/complete",
headers={
"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
},
)
file = res.json(){
"id": "file_3cf0737aefa34b89b7b4443c9467d60c",
"name": "lecture.mp4",
"operation": "video.compress",
"state": "uploaded",
"size": 12417467,
"created_at": "2026-12-03T09:22:53Z",
"uploaded_at": "2026-12-03T09:23:02Z",
"delete_at": "2026-12-04T09:23:02Z",
"check": {
"state": "proceed",
"kind": "video",
"type": "mp4",
"facts": {
"container": "mp4",
"protection": "none",
"attachments": [],
"duration_ms": 20023,
"frame_count": 600,
"audio_tracks": [
{
"codec": "aac",
"channels": 1,
"sample_rate": 44100
}
],
"video_tracks": [
{
"hdr": "none",
"codec": "h264",
"width": 1280,
"chroma": "420",
"height": 720,
"profile": "High",
"rotation": 0,
"bit_depth": 8,
"frame_rate": 30,
"interlaced": false,
"variable_frame_rate": false
}
],
"data_end_bytes": 12417467,
"subtitle_tracks": []
},
"facts_complete": true
}
}