apyhub
Back
▣ FILE CONVERSION · FILE MANIPULATION

Deskew PDF API

Hosted on ApyHub

What it does

PDF Deskew corrects small angle tilts in PDF pages and returns deskewed files you can download once processing finishes. Send one or more PDF files in the files array, then track each job by job_id or follow the parent batch_id for multi-file submissions.

Use it when scanned documents come in slightly rotated: invoices, forms, contracts, archived reports, or any page set that needs a cleaner upright presentation before storage, review, or downstream extraction. The submit response gives you a batch_id plus a jobs array with each file's job_id, filename, status, and progress.

You can poll /status/:job_id for a single job or batch, with status values like queued, processing, done, and failed. For grouped workloads, /overall-status aggregates progress across multiple job IDs and returns the combined status, progress, and per-job details. When a job is complete, /download/:job_id returns the finished output as binary data.

PDF Deskew is a fit for document pipelines that need straightened pages before OCR, indexing, QA review, or long-term archiving.

Note: Pricing is 1 atom per page + 50.

▣ ENDPOINT 01 / 04
POST
Deskew PDF pages to fix small angle tilts
https://api.eu.apyhub.com/flowdocs/deskew-pdf-pages

QUICKSTART

GUIDE

Quickstart

Upload one or more PDF files to start a deskew batch.

curl -X POST "https://api.eu.apyhub.com/flowdocs/deskew-pdf-pages" \
  -H "apy-token: $APY_TOKEN" \
  -F "files=@/path/to/report.pdf"

What you'll get back

Returns a JSON object with a batch_id string and a jobs array. Each job is an object with job_id, filename, status, and progress fields.

{
  "batch_id": "a1b2c3d4e5f6a7b8",
  "jobs": [
    {
      "job_id": "a1b2c3d4",
      "filename": "report.pdf",
      "status": "queued",
      "progress": 0
    }
  ]
}
TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
files*
PDF files to deskew.

About this endpoint

What it does

Uploads one or more PDF files and starts a deskew operation for each file, returning a batch identifier and per-file job metadata for tracking the work.

Request Body

ParameterTypeDescription
filesBinary ArrayPDF files to deskew.

Response

Returns a JSON object with a batch_id string field and a jobs array field. Each item in jobs is an object containing job_id (string), filename (string), status (string), batch_id (string), and progress (integer).

ParameterTypeDescription
batch_idStringParent id for this submit; also returned as X-Apy-Job-Id.
jobsObject ArrayArray of per-file job objects.
jobs[].job_idStringJob identifier for the individual file.
jobs[].filenameStringName of the PDF file.
jobs[].statusStringCurrent status of the individual job.
jobs[].batch_idStringParent batch id this child belongs to.
jobs[].progressIntegerProgress value for the individual job.

Notes

This endpoint kicks off an async job and returns immediately with a batch identifier; the actual work runs in the background. Pair this call with the corresponding job_check endpoint — poll that until the status reaches a terminal state to retrieve the result. Extract the job identifier from batch_id in the response, which is also returned as X-Apy-Job-Id.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 04
GET
Get the status of a deskew job
https://api.eu.apyhub.com/flowdocs/deskew-pdf-pages/status/:job_id

QUICKSTART

GUIDE

Quickstart

Check the status of a deskew PDF job by passing its job_id in the URL path.

curl -X GET "https://api.eu.apyhub.com/flowdocs/deskew-pdf-pages/status/:job_id" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object describing the job status. The response can be one of three object shapes, but each includes job_id, status, and progress; one variant also includes batch_id, and another includes batch, total_files, completed_files, and jobs.

{
  "job_id": "job-123",
  "status": "processing",
  "progress": 45
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Retrieves the current status of a deskew job, including its progress. Depending on the job type, the response may also include batch-related fields or a list of child jobs.

Path Parameter(s)

AttributeTypeDescription
job_idStringIdentifies the job to check.

Response

Returns a JSON object describing the job status. The response schema allows three object shapes; all include job_id, status, and progress, with some shapes also including batch-related fields, completed_files, total_files, jobs, or error.

ParameterTypeDescription
job_idStringThe job identifier. In the batch shape, this is described as the batch id.
statusENUMJob state. Allowed values: queued, processing, done, failed.
progressIntegerProgress percentage from 0 to 100.
batchBooleanPresent only in the batch shape. The schema constrains it to true.
total_filesIntegerPresent only in the batch shape. Total number of files in the batch.
completed_filesIntegerPresent only in the batch shape. Number of files completed so far.
jobsObject ArrayPresent only in the batch shape. List of child jobs.
jobs[].job_idStringChild job identifier.
jobs[].statusStringChild job status.
jobs[].progressIntegerChild job progress.
batch_idStringPresent only in the batch-child shape. Parent batch id. Billing happens at the parent, not here.
errorStringPresent in some shapes and nullable.
▣ ENDPOINT 03 / 04
GET
Download a finished deskew output
https://api.eu.apyhub.com/flowdocs/deskew-pdf-pages/download/:job_id

QUICKSTART

GUIDE

Quickstart

Download the processed PDF for a completed deskew job by replacing job_id in the path.

curl -X GET "https://api.eu.apyhub.com/flowdocs/deskew-pdf-pages/download/:job_id" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a binary file (string with format: binary) — the downloaded PDF content itself.

TRY ITLIVE · 5 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Downloads the finished deskewed PDF output for a completed job. The job_id path parameter identifies which job’s generated file to retrieve.

Path Parameter(s)

AttributeTypeDescription
job_idStringIdentifies the finished deskew job to download.

Response

Returns the binary file content for the completed deskew output. The response schema is a single binary string, so the endpoint does not define a JSON wrapper or named response fields.

▣ ENDPOINT 04 / 04
GET
Aggregate progress across deskew jobs
https://api.eu.apyhub.com/flowdocs/deskew-pdf-pages/overall-status

QUICKSTART

GUIDE

Quickstart

Check the overall status for one or more deskew jobs by passing job_ids as a query parameter.

curl -X GET "https://api.eu.apyhub.com/flowdocs/deskew-pdf-pages/overall-status?job_ids=job-123,job-456" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with required status and progress fields, plus optional details, total_files, and completed_files.

  • status is a string enum: unknown, queued, processing, done, or failed
  • progress is an integer from 0 to 100
  • details is an array of objects, each with job_id, status, and progress
  • total_files and completed_files are integers
{
  "status": "processing",
  "progress": 60,
  "details": [
    {
      "job_id": "job-123",
      "status": "processing",
      "progress": 60
    }
  ],
  "total_files": 2,
  "completed_files": 1
}
TRY ITLIVE · 1 ATOM
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.

About this endpoint

What it does

Returns the aggregate progress for one or more deskew jobs passed in the job_ids query parameter. The response includes overall status and progress, with optional summary counts and per-job details.

Query Parameter(s)

AttributeTypeDescription
job_idsStringJob identifier(s) to aggregate.

Response

Returns a JSON object with required status and progress fields, plus optional details, total_files, and completed_files fields. The status is a string enum, and progress is an integer from 0 to 100.

AttributeTypeDescription
statusENUMOverall aggregate status. Allowed values: unknown, queued, processing, done, failed.
detailsObject ArrayPer-job status entries. Each item includes job_id (string), status (string), and progress (integer).
progressIntegerOverall progress percentage. Minimum 0, maximum 100.
total_filesIntegerTotal number of files included in the aggregate.
completed_filesIntegerNumber of files completed so far.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.