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
    • Ελληνικά
    • 简体中文
    • 繁體中文

Results and downloads

Each completed task lists its results, each with a download link. Fetch the job again whenever you need fresh links.

On this page

A job’s results

GET /v1/jobs/{id} lists the results in each task’s outputs:

FieldMeaning
file_idThe result’s ID.
nameIts file name.
sizeIts size in bytes.
download_urlA link that downloads it.
download_expires_atWhen the link stops working.

Download the results

A download link works for the shorter of 7 days and the time left before the result is deleted. Fetch the job again for fresh links. The link downloads the file under its name and needs no key, so anyone who has it can download the file until it expires: keep links private.

# Each result's download_url is in the job. The link needs no key.
curl https://api.filesokay.com/v1/jobs/job_a1c9531eeb00434aba0058796f1ca517 \
  -H "Authorization: Bearer $FILESOKAY_KEY"

curl -o lecture-compressed.mp4 "$DOWNLOAD_URL"
import fs from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const res = await fetch(
  "https://api.filesokay.com/v1/jobs/job_a1c9531eeb00434aba0058796f1ca517",
  { headers: { Authorization: `Bearer ${process.env.FILESOKAY_KEY}` } },
);
const job = await res.json();

for (const task of job.tasks) {
  for (const output of task.outputs) {
    const file = await fetch(output.download_url);
    if (!file.ok) throw new Error(`${output.name}: ${file.status}`);
    await pipeline(Readable.fromWeb(file.body), fs.createWriteStream(output.name));
  }
}
import os

import requests

job = requests.get(
    "https://api.filesokay.com/v1/jobs/job_a1c9531eeb00434aba0058796f1ca517",
    headers={"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}"},
).json()

for task in job["tasks"]:
    for output in task["outputs"]:
        with requests.get(output["download_url"], stream=True) as res:
            res.raise_for_status()
            with open(output["name"], "wb") as f:
                for chunk in res.iter_content(chunk_size=1 << 20):
                    f.write(chunk)

How long files are kept

FileDeleted
An upload that is never completed7 days after it starts
A completed upload that no job uses24 hours after it completes, or 3 days for a file of 10 GiB or more
A completed task’s input60 minutes after the task completes
A failed or cancelled task’s input24 hours after the task ends
A job’s results3 days after they’re ready; 7 days when the task’s input is over 5 GiB, and 10 days over 20 GiB

Each file’s delete_at shows when it will be deleted.

Delete files sooner

DELETE /v1/jobs/{id}/files deletes an ended job’s inputs and results now. The job and its record of credits stay. A running job’s files can’t be deleted: cancel it first.

curl -X DELETE https://api.filesokay.com/v1/jobs/job_a1c9531eeb00434aba0058796f1ca517/files \
  -H "Authorization: Bearer $FILESOKAY_KEY"
const res = await fetch("https://api.filesokay.com/v1/jobs/job_a1c9531eeb00434aba0058796f1ca517/files", {
  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/jobs/job_a1c9531eeb00434aba0058796f1ca517/files",
    headers={
        "Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
    },
)
print(res.status_code)

DELETE /v1/files/{id} deletes one uploaded file now. Both are final.