Requests and responses
The rules every endpoint follows, so your code can handle them all the same way.
On this page
- Request bodies are JSON, sent with
Content-Type: application/json. - Times are UTC, as in
2026-12-03T09:00:51Z. Sizes are in bytes, and credits are whole numbers. - A request body with a field the endpoint doesn’t take is refused with
bad_request, so a misspelt name is caught at once. - Responses can gain new fields within
/v1. Ignore the ones your code doesn’t know.
Every ID starts with what it names, so an ID sent in the wrong place is caught at once.
| Prefix | Names |
|---|---|
file_ | An uploaded file, or a job’s result |
job_ | A job |
task_ | One run inside a job: one per file it runs |
wh_ | A webhook endpoint |
msg_ | A webhook message |
POST /v1/uploads and POST /v1/jobs take an Idempotency-Key header: any unique text up to 255 characters, such as a UUID. Send the same key again with every retry of the same request. A dropped connection then never starts two jobs or charges twice.
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()A retry with the same key and the same body does nothing twice. A retried upload gets the first answer again; a retried job gets the job as it is now, with status 200. Both are marked with this header:
Idempotent-Replayed: true- A key is kept for 24 hours.
- The same key with a different body is refused with
idempotency_key_reused. - A retry that arrives while the first request is still running is refused with
idempotency_key_in_use. Wait a moment, then retry.
GET /v1/jobs lists jobs newest first, a page at a time. limit sets the page size, from 1 to 100, 20 by default. Send a page’s next_cursor as cursor to get the next one; it’s null on the last page.
# The first page, then the next one with its next_cursor, until next_cursor is null.
curl "https://api.filesokay.com/v1/jobs?limit=100" \
-H "Authorization: Bearer $FILESOKAY_KEY"
curl "https://api.filesokay.com/v1/jobs?limit=100&cursor=MTc5NjIyMDg3NzE4MTA4OC5mOGM1YWFmNy1kMDVjLTQxNTAtOTQxZS03MGFiYmNmNWRmMzU" \
-H "Authorization: Bearer $FILESOKAY_KEY"const jobs = [];
let cursor = null;
do {
const query = new URLSearchParams({ limit: "100" });
if (cursor) query.set("cursor", cursor);
const res = await fetch(`https://api.filesokay.com/v1/jobs?${query}`, {
headers: { Authorization: `Bearer ${process.env.FILESOKAY_KEY}` },
});
const page = await res.json();
jobs.push(...page.jobs);
cursor = page.next_cursor;
} while (cursor);
console.log(`${jobs.length} jobs`);import os
import requests
jobs, cursor = [], None
while True:
params = {"limit": 100, **({"cursor": cursor} if cursor else {})}
page = requests.get(
"https://api.filesokay.com/v1/jobs",
params=params,
headers={"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}"},
).json()
jobs += page["jobs"]
cursor = page["next_cursor"]
if not cursor:
break
print(f"{len(jobs)} jobs")Every response carries an X-Request-Id header, and every error a request_id. Quote it when you contact us about a request: it finds that request in our logs.