Skip to content

Menu

  • Media
  • Pricing
  • Docs
  • Language: English

    This page isn’t available in the greyed-out languages.

    • English
    • Español
    • Português
    • Français
    • Deutsch
    • Italiano
    • Nederlands
    • Polski
    • 日本語
    • 한국어
    • Bahasa Indonesia
    • Tiếng Việt
    • Türkçe
    • العربية
    • ไทย
    • Български
    • Català
    • Hrvatski
    • Eesti
    • Magyar
    • Latviešu
    • Lietuvių
    • Srpski
    • Slovenčina
    • Slovenščina
    • Українська
    • Čeština
    • Română
    • Svenska
    • Dansk
    • Norsk bokmål
    • Suomi
    • עברית
    • हिन्दी
    • Tagalog
    • Bahasa Melayu
    • Ελληνικά
    • 简体中文
    • 繁體中文

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

Start uploads

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-Keystring

    Any 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

  • operationstringRequired

    The operation the files are for. It decides the types and sizes allowed.

  • filesobject[]Required

    1 to 50 items

  • files[].namestringRequired

    The file's name, with its extension.

  • files[].sizeintegerRequired

    Its size in bytes.

    At least 1

  • files[].typestring

    Its media type, such as video/mp4, if you know it.

  • multipartboolean

    Send 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[]Required
  • files[].idstringRequired
  • files[].namestringRequired

    The name, cleaned of anything unsafe.

  • files[].sizeintegerRequired
  • files[].part_sizeintegerRequired

    The size of every part except the last; the file's size when it goes in one request.

  • files[].part_countintegerRequired

    At least 1

  • files[].partsobject[]Required

    Links for the first parts. Ask for the rest with POST /v1/uploads/{id}/parts.

  • files[].parts[].numberintegerRequired

    At least 1

  • files[].parts[].urlstring (URL)Required

    Send the part's bytes here with PUT. The link works for one hour.

  • files[].links_expire_atstring (date-time)Required
  • files[].delete_atstring (date-time)Required

    When the file is deleted if no job uses it.

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()
Response
{
  "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 an upload's progress

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
  • idstringRequired
  • statestringRequired
  • sizeintegerRequired
  • part_sizeintegerRequired
  • part_countintegerRequired
  • parts_receivedobject[]Required
  • parts_received[].numberintegerRequired
  • parts_received[].sizeintegerRequired
  • delete_atstring (date-time)Required
File · 18 fields
  • idstringRequired
  • namestringRequired
  • operationstringRequired

    The operation it was uploaded for.

  • statestringRequired

    One of uploading or uploaded

  • sizeintegerRequired
  • created_atstring (date-time)Required
  • uploaded_atstring (date-time)
  • delete_atstring (date-time)

    When it's deleted. Left out while a job uses it.

  • checkobject

    The check of the file's content when its upload completed.

  • check.statestringRequired

    proceed: an operation can use it. refuse: it can't, for reason. 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, or check_failed

  • check.reasonstring
  • check.detailobject
  • check.kindstring

    What the file really is, such as video.

  • check.typestring

    Its real format, such as mp4, whatever its name says.

  • check.factsobject

    What the check read, such as a video's length, size and codecs.

  • check.facts_completeboolean
  • download_urlstring (URL)

    Only on GET /v1/files/{id}, once it's uploaded.

  • download_expires_atstring (date-time)

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()
Response
{
  "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"
}

Cancel an upload

DELETE/v1/uploads/{id}

Cancels the upload and discards the parts already sent.

Path parameters

  • idstringRequired

Returns

  • 204Cancelled.

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.

  • idstringRequired
  • part_numbersinteger[]Required

    1 to 100 items

  • 200The links.
4 fields
  • partsobject[]Required
  • parts[].numberintegerRequired

    At least 1

  • parts[].urlstring (URL)Required

    Send the part's bytes here with PUT. The link works for one hour.

  • links_expire_atstring (date-time)Required
Response
{
  "links_expire_at": "2026-12-03T19:00:33Z",
  "parts": [
    {
      "number": 21,
      "url": "https://…"
    },
    {
      "number": 22,
      "url": "https://…"
    },
    {
      "number": 23,
      "url": "https://…"
    }
  ]
}

Complete an upload

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
  • idstringRequired
  • namestringRequired
  • operationstringRequired

    The operation it was uploaded for.

  • statestringRequired

    One of uploading or uploaded

  • sizeintegerRequired
  • created_atstring (date-time)Required
  • uploaded_atstring (date-time)
  • delete_atstring (date-time)

    When it's deleted. Left out while a job uses it.

  • checkobject

    The check of the file's content when its upload completed.

  • check.statestringRequired

    proceed: an operation can use it. refuse: it can't, for reason. 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, or check_failed

  • check.reasonstring
  • check.detailobject
  • check.kindstring

    What the file really is, such as video.

  • check.typestring

    Its real format, such as mp4, whatever its name says.

  • check.factsobject

    What the check read, such as a video's length, size and codecs.

  • check.facts_completeboolean
  • download_urlstring (URL)

    Only on GET /v1/files/{id}, once it's uploaded.

  • download_expires_atstring (date-time)

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()
Response
{
  "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
  }
}