curl --request POST \
--url https://api.filecheck.io/jobs/optimize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sources": [
"<unknown>"
],
"async": false,
"webhook": "<unknown>",
"metaData": "<unknown>"
}
'import requests
url = "https://api.filecheck.io/jobs/optimize"
payload = {
"sources": ["<unknown>"],
"async": False,
"webhook": "<unknown>",
"metaData": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sources: ['<unknown>'],
async: false,
webhook: '<unknown>',
metaData: '<unknown>'
})
};
fetch('https://api.filecheck.io/jobs/optimize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filecheck.io/jobs/optimize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sources' => [
'<unknown>'
],
'async' => false,
'webhook' => '<unknown>',
'metaData' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.filecheck.io/jobs/optimize"
payload := strings.NewReader("{\n \"sources\": [\n \"<unknown>\"\n ],\n \"async\": false,\n \"webhook\": \"<unknown>\",\n \"metaData\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.filecheck.io/jobs/optimize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sources\": [\n \"<unknown>\"\n ],\n \"async\": false,\n \"webhook\": \"<unknown>\",\n \"metaData\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.filecheck.io/jobs/optimize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sources\": [\n \"<unknown>\"\n ],\n \"async\": false,\n \"webhook\": \"<unknown>\",\n \"metaData\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"job": {
"id": "<string>",
"createdAt": "<string>",
"modifiedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"ruleId": "<string>",
"workflowId": "<string>",
"metaData": {},
"tasks": [
{
"id": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"fileType": "<string>",
"mimeType": "<string>",
"source": "<string>",
"fileRef": "<string>",
"clientRef": "<string>",
"jobId": "<string>",
"originalArtifact": {},
"outputArtifacts": [
{
"kind": "<string>",
"role": "<string>",
"bucket": "<string>",
"key": "<string>",
"downloadUrl": "<string>",
"expiresIn": 123
}
],
"steps": [
{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"reason": "<string>",
"params": {},
"runtimeParams": {},
"started": "<string>",
"ended": "<string>",
"duration": 123,
"outputs": [
{}
]
}
]
}
],
"orderId": "<string>",
"customerId": "<string>",
"customerEmail": "<string>",
"summary": {},
"results": {}
}
}{
"job": {
"id": "<string>",
"createdAt": "<string>",
"modifiedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"ruleId": "<string>",
"workflowId": "<string>",
"metaData": {},
"tasks": [
{
"id": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"fileType": "<string>",
"mimeType": "<string>",
"source": "<string>",
"fileRef": "<string>",
"clientRef": "<string>",
"jobId": "<string>",
"originalArtifact": {},
"outputArtifacts": [
{
"kind": "<string>",
"role": "<string>",
"bucket": "<string>",
"key": "<string>",
"downloadUrl": "<string>",
"expiresIn": 123
}
],
"steps": [
{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"reason": "<string>",
"params": {},
"runtimeParams": {},
"started": "<string>",
"ended": "<string>",
"duration": 123,
"outputs": [
{}
]
}
]
}
],
"orderId": "<string>",
"customerId": "<string>",
"customerEmail": "<string>",
"summary": {},
"results": {}
}
}{
"pending": true,
"job": {
"id": "<string>",
"createdAt": "<string>",
"modifiedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"ruleId": "<string>",
"workflowId": "<string>",
"metaData": {},
"tasks": [
{
"id": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"fileType": "<string>",
"mimeType": "<string>",
"source": "<string>",
"fileRef": "<string>",
"clientRef": "<string>",
"jobId": "<string>",
"originalArtifact": {},
"outputArtifacts": [
{
"kind": "<string>",
"role": "<string>",
"bucket": "<string>",
"key": "<string>",
"downloadUrl": "<string>",
"expiresIn": 123
}
],
"steps": [
{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"reason": "<string>",
"params": {},
"runtimeParams": {},
"started": "<string>",
"ended": "<string>",
"duration": 123,
"outputs": [
{}
]
}
]
}
],
"orderId": "<string>",
"customerId": "<string>",
"customerEmail": "<string>",
"summary": {},
"results": {}
}
}{
"error": true,
"message": "<string>"
}{
"error": true,
"message": "<string>"
}{
"error": true,
"message": "<string>"
}Optimize a file
Sugar wrapper. Runs an optimize-only job. Async (201) by default; sync: true waits for the result.
curl --request POST \
--url https://api.filecheck.io/jobs/optimize \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sources": [
"<unknown>"
],
"async": false,
"webhook": "<unknown>",
"metaData": "<unknown>"
}
'import requests
url = "https://api.filecheck.io/jobs/optimize"
payload = {
"sources": ["<unknown>"],
"async": False,
"webhook": "<unknown>",
"metaData": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sources: ['<unknown>'],
async: false,
webhook: '<unknown>',
metaData: '<unknown>'
})
};
fetch('https://api.filecheck.io/jobs/optimize', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filecheck.io/jobs/optimize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sources' => [
'<unknown>'
],
'async' => false,
'webhook' => '<unknown>',
'metaData' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.filecheck.io/jobs/optimize"
payload := strings.NewReader("{\n \"sources\": [\n \"<unknown>\"\n ],\n \"async\": false,\n \"webhook\": \"<unknown>\",\n \"metaData\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.filecheck.io/jobs/optimize")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sources\": [\n \"<unknown>\"\n ],\n \"async\": false,\n \"webhook\": \"<unknown>\",\n \"metaData\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.filecheck.io/jobs/optimize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sources\": [\n \"<unknown>\"\n ],\n \"async\": false,\n \"webhook\": \"<unknown>\",\n \"metaData\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"job": {
"id": "<string>",
"createdAt": "<string>",
"modifiedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"ruleId": "<string>",
"workflowId": "<string>",
"metaData": {},
"tasks": [
{
"id": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"fileType": "<string>",
"mimeType": "<string>",
"source": "<string>",
"fileRef": "<string>",
"clientRef": "<string>",
"jobId": "<string>",
"originalArtifact": {},
"outputArtifacts": [
{
"kind": "<string>",
"role": "<string>",
"bucket": "<string>",
"key": "<string>",
"downloadUrl": "<string>",
"expiresIn": 123
}
],
"steps": [
{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"reason": "<string>",
"params": {},
"runtimeParams": {},
"started": "<string>",
"ended": "<string>",
"duration": 123,
"outputs": [
{}
]
}
]
}
],
"orderId": "<string>",
"customerId": "<string>",
"customerEmail": "<string>",
"summary": {},
"results": {}
}
}{
"job": {
"id": "<string>",
"createdAt": "<string>",
"modifiedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"ruleId": "<string>",
"workflowId": "<string>",
"metaData": {},
"tasks": [
{
"id": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"fileType": "<string>",
"mimeType": "<string>",
"source": "<string>",
"fileRef": "<string>",
"clientRef": "<string>",
"jobId": "<string>",
"originalArtifact": {},
"outputArtifacts": [
{
"kind": "<string>",
"role": "<string>",
"bucket": "<string>",
"key": "<string>",
"downloadUrl": "<string>",
"expiresIn": 123
}
],
"steps": [
{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"reason": "<string>",
"params": {},
"runtimeParams": {},
"started": "<string>",
"ended": "<string>",
"duration": 123,
"outputs": [
{}
]
}
]
}
],
"orderId": "<string>",
"customerId": "<string>",
"customerEmail": "<string>",
"summary": {},
"results": {}
}
}{
"pending": true,
"job": {
"id": "<string>",
"createdAt": "<string>",
"modifiedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"ruleId": "<string>",
"workflowId": "<string>",
"metaData": {},
"tasks": [
{
"id": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"status": "<string>",
"outcome": "<string>",
"fileType": "<string>",
"mimeType": "<string>",
"source": "<string>",
"fileRef": "<string>",
"clientRef": "<string>",
"jobId": "<string>",
"originalArtifact": {},
"outputArtifacts": [
{
"kind": "<string>",
"role": "<string>",
"bucket": "<string>",
"key": "<string>",
"downloadUrl": "<string>",
"expiresIn": 123
}
],
"steps": [
{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"reason": "<string>",
"params": {},
"runtimeParams": {},
"started": "<string>",
"ended": "<string>",
"duration": 123,
"outputs": [
{}
]
}
]
}
],
"orderId": "<string>",
"customerId": "<string>",
"customerEmail": "<string>",
"summary": {},
"results": {}
}
}{
"error": true,
"message": "<string>"
}{
"error": true,
"message": "<string>"
}{
"error": true,
"message": "<string>"
}Authorizations
Your secret key as a bearer token, e.g. Authorization: Bearer sk_live_…. Secret keys are server-side only.
Body
Optimize one or more files. Each source carries its own params, namespaced by file type: params.pdf for PDFs (DynaPDF pipeline) and params.raster for bitmaps (Sharp + fal.ai pipeline). Exactly one namespace per source is consumed — the server picks based on the detected file type. Mixed batches (PDF + raster in the same request) are supported. The request is synchronous by default — the response is 200 with { job } on completion, or 202 with pending: true if the job does not finish within ~27 s. An optional webhook is called when the job reaches a terminal status.
List of files to optimize. Each item may include a params object describing which optimizations to apply. Even a single file must be wrapped in an array.
1 - 50 elementsWhen true, return 201 immediately with { job, pending: true } and let the webhook (if any) deliver the terminal result. When false (default), the request is synchronous — 200 on completion, or 202 with pending: true if the job does not finish within ~27 s.
Response
Sync completion (sync: true)
Show child attributes
Show child attributes