Running jobs
A job runs one operation on one or more uploaded files. It starts at once, runs in the background and reports each file’s outcome.
On this page
An operation is what a job does, such as video.compress. GET /v1/operations lists them all, and GET /v1/operations/{id} gives one with its settings schema.
curl https://api.filesokay.com/v1/operations/video.compressconst res = await fetch("https://api.filesokay.com/v1/operations/video.compress");
const operation = await res.json();import requests
res = requests.get(
"https://api.filesokay.com/v1/operations/video.compress",
)
operation = res.json()Each operation says what it takes and how it works:
| Field | Meaning |
|---|---|
input_formats | The file extensions it takes. A file with another extension is taken too when the type you send for it is of the operation’s kind, such as video/mp4. |
max_files | The most input files one job takes. |
limits.max_file_bytes | The largest input file, in bytes. |
grouping | separate: one task per file, each with its own result. together: one task for all the files, as in a merge. |
settings_schema | The JSON Schema its settings follow, with every setting’s default. |
Send the operation, the input files by ID and, if you want, its settings and your own reference. Send an Idempotency-Key too, so a retry never starts a second job.
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(){
"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": []
}
]
}settingsis checked against the operation’s schema. A setting you leave out takes its default, and the job shows every setting with its default filled in.taskshas one task per input, in your order.reserved_creditsis the most the job can cost. It’s charged only what it uses: see credits.
POST /v1/estimates takes the same body as POST /v1/jobs and runs nothing. It answers the most the job can cost, the credits you have, how many are missing, and what each file would become.
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(){
"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
}
}
]
}| Job status | Meaning |
|---|---|
waiting | No task is running, and at least one is still waiting to start. |
processing | At least one task is running. |
completed | Every task completed, apart from any that were cancelled. |
partly_failed | Some tasks completed and some failed. |
failed | Every task failed, apart from any that were cancelled. |
cancelled | It was cancelled before any task completed. |
Each task has its own status: waiting, processing, completed, failed, cancelled or skipped. A running task shows its progress, from 0 to 100. A failed or skipped task gives its reason.
One job can run an operation on many files, up to its max_files. With separate grouping, each file is its own task: one failed file doesn’t stop the others and isn’t charged.
A file that can’t be used is skipped, with its reason, and the rest run. Skipped files cost nothing. The reasons:
| Reason | Meaning |
|---|---|
not_found | No uploaded file has this ID. |
not_ready | Its upload isn’t completed yet. |
refused | Its check refused it. |
check_failed | Its check failed on our side. |
other_operation | It was uploaded for another operation. |
file_in_use | Another job is using it. |
repeated | It’s listed twice in this job. |
An operation can also skip a file it wouldn’t change with these settings, such as a video already smaller than its target size. When no file would run, the job isn’t started: the request is refused with nothing_to_run, with each file’s reason. An operation with together grouping, which makes one result from all its files, refuses the whole job with files_unusable instead.
client_reference holds your own ID for the job, such as an order number, up to 255 characters. It comes back with the job and in every webhook message, and GET /v1/jobs?client_reference=… finds the job by it. It doesn’t have to be unique.
POST /v1/jobs/{id}/cancel stops the tasks still waiting or running. A task that hadn’t started costs nothing; one that had is charged for the time it ran. Cancelling a job that has ended changes nothing.
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()