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

Jobs

Running an operation on uploaded files. A job holds one task per file it runs. Running jobs explains settings, statuses and batches.

On this page

Estimate a job

POST/v1/estimates

The same body as POST /v1/jobs. Answers the most the job can cost, which is what starting it would reserve, and what would happen to each input, without running or reserving anything.

Request body

  • operationstringRequired

    The operation's ID, from GET /v1/operations.

  • inputsobject[]Required

    The input files, in order. Up to the operation's max_files.

  • inputs[].file_idstringRequired
  • settingsobject

    The operation's settings, following its settings_schema. Leave it out for the defaults.

  • client_referencestring

    Your own reference, returned with the job and its webhooks, and searchable in GET /v1/jobs.

    Up to 255 characters

Returns

  • 200The estimate.
14 fields
  • operationstringRequired
  • settingsobjectRequired

    The settings with every default filled in.

  • reserved_creditsintegerRequired

    The most the job can cost, which starting it reserves. It's charged only what it uses.

  • available_creditsintegerRequired
  • shortfallintegerRequired

    How many credits are missing to start it.

    At least 0

  • tasksobject[]Required

    One per input, in order.

  • tasks[].statusstringRequired

    waiting: it would run. skipped: it wouldn't, for reason.

    One of waiting or skipped

  • tasks[].inputsobject[]Required
  • tasks[].inputs[].file_idstring
  • tasks[].inputs[].namestring
  • tasks[].reserved_creditsinteger
  • tasks[].reasonstring
  • tasks[].detailsobject
  • tasks[].previewobject

    What the operation would do, such as the output format, codec and picture size.

Example

curl -X POST https://api.filesokay.com/v1/estimates \
  -H "Authorization: Bearer $FILESOKAY_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "video.compress",
    "inputs": [
      {
        "file_id": "file_3cf0737aefa34b89b7b4443c9467d60c"
      }
    ],
    "settings": {
      "method": "target_size",
      "target": {
        "unit": "percent",
        "value": 50
      }
    }
  }'
const res = await fetch("https://api.filesokay.com/v1/estimates", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    operation: "video.compress",
    inputs: [
      {
        file_id: "file_3cf0737aefa34b89b7b4443c9467d60c"
      }
    ],
    settings: {
      method: "target_size",
      target: {
        unit: "percent",
        value: 50
      }
    }
  }),
});
const estimate = await res.json();
import os

import requests

res = requests.post(
    "https://api.filesokay.com/v1/estimates",
    headers={
        "Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
    },
    json={
      "operation": "video.compress",
      "inputs": [
        {
          "file_id": "file_3cf0737aefa34b89b7b4443c9467d60c"
        }
      ],
      "settings": {
        "method": "target_size",
        "target": {
          "unit": "percent",
          "value": 50
        }
      }
    },
)
estimate = res.json()
Response
{
  "available_credits": 1908,
  "operation": "video.compress",
  "reserved_credits": 2,
  "settings": {
    "method": "target_size",
    "target": {
      "unit": "percent",
      "value": 50
    },
    "resolution": "auto",
    "codec": "same",
    "frame_rate": "original",
    "audio": "keep",
    "output_format": "same"
  },
  "shortfall": 0,
  "tasks": [
    {
      "status": "waiting",
      "inputs": [
        {
          "file_id": "file_3cf0737aefa34b89b7b4443c9467d60c",
          "name": "lecture.mp4"
        }
      ],
      "reserved_credits": 2,
      "preview": {
        "output": {
          "format": "mp4",
          "extension": "mp4",
          "file_name": "lecture-compressed.mp4"
        },
        "video": {
          "codec": "h264",
          "width": 1280,
          "height": 720,
          "frame_rate": "original",
          "hdr": "none"
        },
        "smallest_bytes": 634179
      }
    }
  ]
}

List jobs

GET/v1/jobs

The jobs the Workspace's API keys started, newest first.

Query parameters

  • limitinteger

    How many jobs a page holds.

    Default 20 · 1 to 100

  • cursorstring

    The next_cursor of the page before.

  • client_referencestring

    Only the jobs started with this client_reference.

    Up to 255 characters

Returns

  • 200A page of jobs.
30 fields
  • jobsobject[]Required
  • jobs[].idstringRequired
  • jobs[].operationstringRequired
  • jobs[].statusstringRequired

    waiting: no task is running, and at least one is still waiting to start. completed: every task completed, apart from any that were cancelled. partly_failed: some completed and some failed. failed: every task failed, apart from any that were cancelled. cancelled: cancelled before any completed.

    One of waiting, processing, completed, partly_failed, failed, or cancelled

  • jobs[].client_referencestring | nullRequired
  • jobs[].settingsobjectRequired
  • jobs[].created_atstring (date-time)Required
  • jobs[].started_atstring (date-time)
  • jobs[].finished_atstring (date-time)
  • jobs[].reserved_creditsintegerRequired
  • jobs[].charged_creditsintegerRequired
  • jobs[].tasksobject[]Required

    One per input, in the request's order, skipped inputs among them.

  • jobs[].tasks[].idstring

    Left out of a skipped input, which never became a task.

  • jobs[].tasks[].statusstringRequired

    One of waiting, processing, completed, failed, cancelled, or skipped

  • jobs[].tasks[].progressintegerRequired

    0 to 100

  • jobs[].tasks[].stagestring

    What it's doing now, such as processing or uploading.

  • jobs[].tasks[].reasonstring

    Why it failed or was skipped.

  • jobs[].tasks[].detailsobject
  • jobs[].tasks[].reserved_creditsinteger
  • jobs[].tasks[].charged_creditsinteger
  • jobs[].tasks[].inputsobject[]Required
  • jobs[].tasks[].inputs[].file_idstring
  • jobs[].tasks[].inputs[].namestring
  • jobs[].tasks[].outputsobject[]Required
  • jobs[].tasks[].outputs[].file_idstringRequired
  • jobs[].tasks[].outputs[].namestringRequired
  • jobs[].tasks[].outputs[].sizeintegerRequired
  • jobs[].tasks[].outputs[].download_urlstring (URL)

    The result, as a download, valid until download_expires_at.

  • jobs[].tasks[].outputs[].download_expires_atstring (date-time)
  • next_cursorstring | nullRequired

    Send it as cursor for the next page. Null on the last page.

Example

curl "https://api.filesokay.com/v1/jobs?client_reference=lecture-0412" \
  -H "Authorization: Bearer $FILESOKAY_KEY"
const res = await fetch("https://api.filesokay.com/v1/jobs?client_reference=lecture-0412", {
  headers: {
    Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
  },
});
const page = await res.json();
import os

import requests

res = requests.get(
    "https://api.filesokay.com/v1/jobs?client_reference=lecture-0412",
    headers={
        "Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
    },
)
page = res.json()
Response
{
  "jobs": [
    {
      "id": "job_a1c9531eeb00434aba0058796f1ca517",
      "operation": "video.compress",
      "status": "completed",
      "client_reference": "lecture-0412",
      "settings": {
        "audio": "keep",
        "codec": "same",
        "method": "target_size",
        "target": {
          "unit": "percent",
          "value": 50
        },
        "frame_rate": "original",
        "resolution": "auto",
        "output_format": "same"
      },
      "created_at": "2026-12-03T09:23:14Z",
      "started_at": "2026-12-03T09:23:33Z",
      "finished_at": "2026-12-03T09:23:50Z",
      "reserved_credits": 2,
      "charged_credits": 1,
      "tasks": [
        {
          "id": "task_3f648f64472b4ea4b88568eea9d4f88c",
          "status": "completed",
          "progress": 100,
          "reserved_credits": 2,
          "charged_credits": 1,
          "inputs": [
            {
              "file_id": "file_3cf0737aefa34b89b7b4443c9467d60c",
              "name": "lecture.mp4"
            }
          ],
          "outputs": [
            {
              "file_id": "file_a1c8014998a14c4da72d6e6a0c74314c",
              "name": "lecture-compressed.mp4",
              "size": 6054914,
              "download_url": "https://…",
              "download_expires_at": "2026-12-06T09:23:50Z"
            }
          ]
        }
      ]
    }
  ],
  "next_cursor": null
}

Start a job

POST/v1/jobs

Runs an operation on files: one task per input that runs, with its credits reserved. An input that can't be used, or that the operation wouldn't change with these settings, is skipped with its reason and costs nothing. When no input would run, the answer is 422 nothing_to_run. Send an Idempotency-Key, so a retry never starts a second job.

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's ID, from GET /v1/operations.

  • inputsobject[]Required

    The input files, in order. Up to the operation's max_files.

  • inputs[].file_idstringRequired
  • settingsobject

    The operation's settings, following its settings_schema. Leave it out for the defaults.

  • client_referencestring

    Your own reference, returned with the job and its webhooks, and searchable in GET /v1/jobs.

    Up to 255 characters

Returns

  • 200A retry with the same Idempotency-Key and body. The job, as it is now.
  • 201The new job.
28 fields
  • idstringRequired
  • operationstringRequired
  • statusstringRequired

    waiting: no task is running, and at least one is still waiting to start. completed: every task completed, apart from any that were cancelled. partly_failed: some completed and some failed. failed: every task failed, apart from any that were cancelled. cancelled: cancelled before any completed.

    One of waiting, processing, completed, partly_failed, failed, or cancelled

  • client_referencestring | nullRequired
  • settingsobjectRequired
  • created_atstring (date-time)Required
  • started_atstring (date-time)
  • finished_atstring (date-time)
  • reserved_creditsintegerRequired
  • charged_creditsintegerRequired
  • tasksobject[]Required

    One per input, in the request's order, skipped inputs among them.

  • tasks[].idstring

    Left out of a skipped input, which never became a task.

  • tasks[].statusstringRequired

    One of waiting, processing, completed, failed, cancelled, or skipped

  • tasks[].progressintegerRequired

    0 to 100

  • tasks[].stagestring

    What it's doing now, such as processing or uploading.

  • tasks[].reasonstring

    Why it failed or was skipped.

  • tasks[].detailsobject
  • tasks[].reserved_creditsinteger
  • tasks[].charged_creditsinteger
  • tasks[].inputsobject[]Required
  • tasks[].inputs[].file_idstring
  • tasks[].inputs[].namestring
  • tasks[].outputsobject[]Required
  • tasks[].outputs[].file_idstringRequired
  • tasks[].outputs[].namestringRequired
  • tasks[].outputs[].sizeintegerRequired
  • tasks[].outputs[].download_urlstring (URL)

    The result, as a download, valid until download_expires_at.

  • tasks[].outputs[].download_expires_atstring (date-time)

Example

curl -X POST https://api.filesokay.com/v1/jobs \
  -H "Authorization: Bearer $FILESOKAY_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operation": "video.compress",
    "inputs": [
      {
        "file_id": "file_3cf0737aefa34b89b7b4443c9467d60c"
      }
    ],
    "settings": {
      "method": "target_size",
      "target": {
        "unit": "percent",
        "value": 50
      }
    },
    "client_reference": "lecture-0412"
  }'
const res = await fetch("https://api.filesokay.com/v1/jobs", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({
    operation: "video.compress",
    inputs: [
      {
        file_id: "file_3cf0737aefa34b89b7b4443c9467d60c"
      }
    ],
    settings: {
      method: "target_size",
      target: {
        unit: "percent",
        value: 50
      }
    },
    client_reference: "lecture-0412"
  }),
});
const job = await res.json();
import os
import uuid

import requests

res = requests.post(
    "https://api.filesokay.com/v1/jobs",
    headers={
        "Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
      "operation": "video.compress",
      "inputs": [
        {
          "file_id": "file_3cf0737aefa34b89b7b4443c9467d60c"
        }
      ],
      "settings": {
        "method": "target_size",
        "target": {
          "unit": "percent",
          "value": 50
        }
      },
      "client_reference": "lecture-0412"
    },
)
job = res.json()
Response
{
  "id": "job_a1c9531eeb00434aba0058796f1ca517",
  "operation": "video.compress",
  "status": "waiting",
  "client_reference": "lecture-0412",
  "settings": {
    "audio": "keep",
    "codec": "same",
    "method": "target_size",
    "target": {
      "unit": "percent",
      "value": 50
    },
    "frame_rate": "original",
    "resolution": "auto",
    "output_format": "same"
  },
  "created_at": "2026-12-03T09:23:14Z",
  "reserved_credits": 2,
  "charged_credits": 0,
  "tasks": [
    {
      "id": "task_3f648f64472b4ea4b88568eea9d4f88c",
      "status": "waiting",
      "progress": 0,
      "reserved_credits": 2,
      "inputs": [
        {
          "file_id": "file_3cf0737aefa34b89b7b4443c9467d60c",
          "name": "lecture.mp4"
        }
      ],
      "outputs": []
    }
  ]
}

Get a job

GET/v1/jobs/{id}

The job and its tasks. A completed task lists its results with download links, each valid for up to 7 days; ask again for fresh ones. Webhooks tell you when a job ends, so you needn't ask repeatedly.

Path parameters

  • idstringRequired

Returns

  • 200The job.
28 fields
  • idstringRequired
  • operationstringRequired
  • statusstringRequired

    waiting: no task is running, and at least one is still waiting to start. completed: every task completed, apart from any that were cancelled. partly_failed: some completed and some failed. failed: every task failed, apart from any that were cancelled. cancelled: cancelled before any completed.

    One of waiting, processing, completed, partly_failed, failed, or cancelled

  • client_referencestring | nullRequired
  • settingsobjectRequired
  • created_atstring (date-time)Required
  • started_atstring (date-time)
  • finished_atstring (date-time)
  • reserved_creditsintegerRequired
  • charged_creditsintegerRequired
  • tasksobject[]Required

    One per input, in the request's order, skipped inputs among them.

  • tasks[].idstring

    Left out of a skipped input, which never became a task.

  • tasks[].statusstringRequired

    One of waiting, processing, completed, failed, cancelled, or skipped

  • tasks[].progressintegerRequired

    0 to 100

  • tasks[].stagestring

    What it's doing now, such as processing or uploading.

  • tasks[].reasonstring

    Why it failed or was skipped.

  • tasks[].detailsobject
  • tasks[].reserved_creditsinteger
  • tasks[].charged_creditsinteger
  • tasks[].inputsobject[]Required
  • tasks[].inputs[].file_idstring
  • tasks[].inputs[].namestring
  • tasks[].outputsobject[]Required
  • tasks[].outputs[].file_idstringRequired
  • tasks[].outputs[].namestringRequired
  • tasks[].outputs[].sizeintegerRequired
  • tasks[].outputs[].download_urlstring (URL)

    The result, as a download, valid until download_expires_at.

  • tasks[].outputs[].download_expires_atstring (date-time)

Example

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

import requests

res = requests.get(
    "https://api.filesokay.com/v1/jobs/job_a1c9531eeb00434aba0058796f1ca517",
    headers={
        "Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
    },
)
job = res.json()
Response
{
  "id": "job_a1c9531eeb00434aba0058796f1ca517",
  "operation": "video.compress",
  "status": "completed",
  "client_reference": "lecture-0412",
  "settings": {
    "audio": "keep",
    "codec": "same",
    "method": "target_size",
    "target": {
      "unit": "percent",
      "value": 50
    },
    "frame_rate": "original",
    "resolution": "auto",
    "output_format": "same"
  },
  "created_at": "2026-12-03T09:23:14Z",
  "started_at": "2026-12-03T09:23:33Z",
  "finished_at": "2026-12-03T09:23:50Z",
  "reserved_credits": 2,
  "charged_credits": 1,
  "tasks": [
    {
      "id": "task_3f648f64472b4ea4b88568eea9d4f88c",
      "status": "completed",
      "progress": 100,
      "reserved_credits": 2,
      "charged_credits": 1,
      "inputs": [
        {
          "file_id": "file_3cf0737aefa34b89b7b4443c9467d60c",
          "name": "lecture.mp4"
        }
      ],
      "outputs": [
        {
          "file_id": "file_a1c8014998a14c4da72d6e6a0c74314c",
          "name": "lecture-compressed.mp4",
          "size": 6054914,
          "download_url": "https://…",
          "download_expires_at": "2026-12-06T09:23:50Z"
        }
      ]
    }
  ]
}

Cancel a job

POST/v1/jobs/{id}/cancel

Stops the tasks still waiting or processing. A task that hadn't started costs nothing; one that had is charged for the time it ran. Cancelling an ended job changes nothing.

Path parameters

  • idstringRequired

Returns

  • 202Cancelling. The job, as it is now.
28 fields
  • idstringRequired
  • operationstringRequired
  • statusstringRequired

    waiting: no task is running, and at least one is still waiting to start. completed: every task completed, apart from any that were cancelled. partly_failed: some completed and some failed. failed: every task failed, apart from any that were cancelled. cancelled: cancelled before any completed.

    One of waiting, processing, completed, partly_failed, failed, or cancelled

  • client_referencestring | nullRequired
  • settingsobjectRequired
  • created_atstring (date-time)Required
  • started_atstring (date-time)
  • finished_atstring (date-time)
  • reserved_creditsintegerRequired
  • charged_creditsintegerRequired
  • tasksobject[]Required

    One per input, in the request's order, skipped inputs among them.

  • tasks[].idstring

    Left out of a skipped input, which never became a task.

  • tasks[].statusstringRequired

    One of waiting, processing, completed, failed, cancelled, or skipped

  • tasks[].progressintegerRequired

    0 to 100

  • tasks[].stagestring

    What it's doing now, such as processing or uploading.

  • tasks[].reasonstring

    Why it failed or was skipped.

  • tasks[].detailsobject
  • tasks[].reserved_creditsinteger
  • tasks[].charged_creditsinteger
  • tasks[].inputsobject[]Required
  • tasks[].inputs[].file_idstring
  • tasks[].inputs[].namestring
  • tasks[].outputsobject[]Required
  • tasks[].outputs[].file_idstringRequired
  • tasks[].outputs[].namestringRequired
  • tasks[].outputs[].sizeintegerRequired
  • tasks[].outputs[].download_urlstring (URL)

    The result, as a download, valid until download_expires_at.

  • tasks[].outputs[].download_expires_atstring (date-time)

Example

curl -X POST https://api.filesokay.com/v1/jobs/job_a1c9531eeb00434aba0058796f1ca517/cancel \
  -H "Authorization: Bearer $FILESOKAY_KEY"
const res = await fetch("https://api.filesokay.com/v1/jobs/job_a1c9531eeb00434aba0058796f1ca517/cancel", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
  },
});
const job = await res.json();
import os

import requests

res = requests.post(
    "https://api.filesokay.com/v1/jobs/job_a1c9531eeb00434aba0058796f1ca517/cancel",
    headers={
        "Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
    },
)
job = res.json()
Response
{
  "id": "job_a1c9531eeb00434aba0058796f1ca517",
  "operation": "video.compress",
  "status": "cancelled",
  "client_reference": "lecture-0412",
  "settings": {
    "audio": "keep",
    "codec": "same",
    "method": "target_size",
    "target": {
      "unit": "percent",
      "value": 50
    },
    "frame_rate": "original",
    "resolution": "auto",
    "output_format": "same"
  },
  "created_at": "2026-12-03T09:23:14Z",
  "finished_at": "2026-12-03T09:23:20Z",
  "reserved_credits": 2,
  "charged_credits": 0,
  "tasks": [
    {
      "id": "task_3f648f64472b4ea4b88568eea9d4f88c",
      "status": "cancelled",
      "progress": 0,
      "reserved_credits": 2,
      "charged_credits": 0,
      "inputs": [
        {
          "file_id": "file_3cf0737aefa34b89b7b4443c9467d60c",
          "name": "lecture.mp4"
        }
      ],
      "outputs": []
    }
  ]
}

Delete a job's files

DELETE/v1/jobs/{id}/files

Deletes the job's input and result files now, once it has ended. An input another running job uses is left to that job. The job and its record of credits stay.

Path parameters

  • idstringRequired

Returns

  • 204Deleted.

Example

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)