apyhub
FILE CONVERSION · FILE MANIPULATION

Deskew PDF API

Hosted on ApyHub

What it does

PDF Deskew straightens scanned or photographed PDF pages that have small angle tilts. Send one or more PDF files in the files array, and the service creates deskew jobs for each upload.

Use it when you need to clean up scans before archiving, indexing, or extracting text. The POST endpoint returns a jobs array with job_id, filename, status, and progress, so you can track each file as it moves from queued to processing to done or failed.

Poll GET /status/:job_id for a single job’s job_id, status, progress, and optional error. When a job is finished, GET /download/:job_id returns the corrected PDF as binary output.

If you are handling batches, GET /overall-status lets you check progress across multiple job IDs in one request. It returns aggregate status and progress, plus total_files, completed_files, and per-job details so you can surface batch completion in your own workflow.

Note: Pricing is 1 atom per page + 50.

▣ ENDPOINT 01 / 04
POST
Deskew PDF pages to fix small angle tilts
http://localhost:8080/flowdocs/deskew-pdf-pages
QUICKSTARTGUIDE

Quickstart

Upload one or more PDF files to deskew them.

curl -X POST "http://localhost:8080/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 jobs array. Each item in jobs is an object with job_id (string), filename (string), status (string), and progress (integer).

{
  "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

Deskews uploaded PDF pages to correct small angle tilts. It accepts one or more PDF files and returns a JSON object containing job details for each submitted file.

Request Body

ParameterTypeMandatoryDescription
filesString ArrayYesPDF files to deskew. Max File Upload limit - 5

Response

Returns a JSON object with a jobs array field. Each item in jobs is an object containing job_id, filename, status, and progress fields.

ParameterTypeMandatoryDescription
jobsObject ArrayYesOne job entry per submitted file.
jobs[].job_idStringYesJob identifier.
jobs[].filenameStringYesThe original filename of the submitted PDF.
jobs[].statusStringYesJob status.
jobs[].progressIntegerYesJob progress.

Body

Name
Type
Description
bodyREQUIRED
object

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
http://localhost:8080/flowdocs/deskew-pdf-pages/status/:job_id
QUICKSTARTGUIDE

Quickstart

Check the status of a deskew PDF job by its job_id.

curl -X GET "http://localhost:8080/flowdocs/deskew-pdf-pages/status/:job_id" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with these top-level fields: job_id string, status string (queued, processing, done, or failed), progress integer from 0 to 100, and optional error string when present.

{
  "job_id": "job_12345",
  "status": "processing",
  "progress": 60,
  "error": null
}
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 current status of a deskew PDF job identified by job_id. The response includes the job identifier, its processing status, and progress, with an optional error field when present.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesIdentifies the deskew job.

Response

Returns a JSON object with job_id as a string, status as a string enum, progress as an integer, and error as a nullable string. The status field can be queued, processing, done, or failed, and progress is constrained to values from 0 to 100.

AttributeTypeMandatoryDescription
errorStringNoAn error message if available; nullable.
job_idStringYesThe job identifier.
statusENUMYesJob state. Allowed values: queued, processing, done, failed.
progressIntegerYesProgress percentage, from 0 to 100.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ ENDPOINT 03 / 04
GET
Download a finished deskew output
http://localhost:8080/flowdocs/deskew-pdf-pages/download/:job_id
QUICKSTARTGUIDE

Quickstart

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

curl -X GET "http://localhost:8080/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.

(binary PDF data)
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)

AttributeTypeMandatoryDescription
job_idStringYesIdentifies 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.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ ENDPOINT 04 / 04
GET
Aggregate progress across deskew jobs
http://localhost:8080/flowdocs/deskew-pdf-pages/overall-status
QUICKSTARTGUIDE

Quickstart

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

curl -X GET "http://localhost:8080/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 status and progress fields, plus optional details, total_files, and completed_files.

  • status is a string (unknown, queued, processing, done, or failed) describing the overall job state.
  • progress is an integer from 0 to 100 indicating overall completion.
{
  "status": "processing",
  "progress": 65,
  "details": [
    {
      "job_id": "job-123",
      "status": "processing",
      "progress": 70
    }
  ],
  "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 identified by the job_ids query parameter. The response includes the overall status and progress, plus optional summary fields and per-job details.

Query Parameter(s)

AttributeTypeMandatoryDescription
job_idsStringYesComma-separated job identifier(s) passed as a query parameter.

Response

Returns a JSON object with required status and progress fields. The response may also include details, total_files, and completed_files fields for per-job and aggregate summary information.

AttributeTypeMandatoryDescription
statusENUMYesOverall aggregate status. Allowed values: unknown, queued, processing, done, failed.
detailsObject ArrayNoPer-job status entries. Each item may include: job_id (String), status (String), and progress (Integer).
progressIntegerYesOverall progress percentage from 0 to 100.
total_filesIntegerNoTotal number of files included in the aggregate calculation.
completed_filesIntegerNoNumber of files completed so far.

Query parameters

Name
Type
Description
job_idsREQUIRED
string
▣ 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.