apyhub
DATA EXTRACTION · FILE MANIPULATION

Fix PDF Orientation API

Hosted on ApyHub

What it does

PDF Auto Corrector auto-rotates PDF pages to correct orientation using OCR. Send one or more PDF files in files, and you get back a batch with a batch_id plus per-file job records showing job_id, filename, status, and progress.

Use it when scanned documents come in sideways, upside down, or mixed across pages. The service is built for document workflows where page orientation needs to be fixed before indexing, review, or downstream extraction.

Track work with /status/:job_id for an individual job or batch, or call /overall-status with multiple job IDs to see aggregate progress. When a job is finished, /download/:job_id returns the corrected PDF as binary output.

PDF Auto Corrector fits into intake pipelines for invoices, forms, records, and archived scans where orientation errors would break OCR or make documents hard to read.

Note: Pricing is 1 atom per page + 50.

▣ ENDPOINT 01 / 04
POST
Auto-rotate PDF pages to correct orientation using OCR
https://api.eu.apyhub.com/flowdocs/auto-correct-pdf-pages

QUICKSTART

GUIDE

Quickstart

Upload one or more PDF files to start an auto-rotation batch.

curl -X POST "https://api.eu.apyhub.com/flowdocs/auto-correct-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 auto-rotate.

About this endpoint

What it does

This endpoint submits one or more PDF files for OCR-based auto-rotation so their page orientation can be corrected. It returns a batch identifier and a per-file job list with each job’s current status and progress.

Request Body

ParameterTypeMandatoryDescription
filesString ArrayYesPDF files to auto-rotate.

Response

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

ParameterTypeMandatoryDescription
batch_idStringYesParent id for this submit; also returned as X-Apy-Job-Id.
jobsObject ArrayYesArray of per-file job objects. Each job includes job_id, filename, status, progress, and batch_id.
jobs[].job_idStringYesJob identifier for the individual file.
jobs[].filenameStringYesName of the submitted PDF file.
jobs[].statusStringYesCurrent status of the individual job.
jobs[].progressIntegerYesProgress value for the individual job.
jobs[].batch_idStringNoParent batch id this child belongs to.

Notes

This endpoint kicks off an async job and returns immediately with a job 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. Use the batch_id field from the response, which is also returned as X-Apy-Job-Id.

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 an auto-correct job
https://api.eu.apyhub.com/flowdocs/auto-correct-pdf-pages/status/:job_id

QUICKSTART

GUIDE

Quickstart

Check the status of a job by replacing :job_id in the endpoint URL with your job ID.

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

What you'll get back

Returns a JSON object. Depending on the job state, the top-level fields include job_id (string), status (queued, processing, done, or failed), and progress (integer from 0 to 100). Some responses also include batch (boolean), total_files (integer), completed_files (integer), jobs (array of job objects), batch_id (string), and error (string or null).

{
  "job_id": "job_12345",
  "status": "processing",
  "progress": 60
}
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 an auto-correct PDF job or batch for the job_id supplied in the path. The response shape depends on the job type: it may include batch-level counts and a jobs array, or a smaller job status object.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesIdentifies the job or batch.

Response

Returns a JSON object whose shape is one of three possible variants, all using job_id, status, and progress as core fields. The status field is an enum with values queued, processing, done, and failed; progress is an integer from 0 to 100.

ParameterTypeMandatoryDescription
job_idStringYesThe job identifier. In the batch variant, this is documented as the batch id.
batchBooleanYesPresent only in the batch variant; constrained to true.
batch_idStringYesParent batch id. Billing happens at the parent, not here.
statusENUMYesOne of queued, processing, done, failed.
progressIntegerYesCompletion percentage, from 0 to 100.
total_filesIntegerYesTotal number of files in the batch.
completed_filesIntegerYesNumber of files completed in the batch.
jobsObject ArrayYesPresent only in the batch variant. Each item contains job_id, status, and progress.
jobs[].job_idStringNoThe child job identifier.
jobs[].statusStringNoThe child job status.
jobs[].progressIntegerNoThe child job progress.
errorStringNoAn error message, if present. Nullable in the schema.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ ENDPOINT 03 / 04
GET
Download a finished auto-correct output
https://api.eu.apyhub.com/flowdocs/auto-correct-pdf-pages/download/:job_id

QUICKSTART

GUIDE

Quickstart

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

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

What you'll get back

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

(binary file content)
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 auto-correct PDF output for a completed job, identified by job_id. The response is a binary file stream.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesThe job identifier in the URL path.

Response

Returns a binary payload as a raw file download. The output schema is a string with format: binary, so the response is not a JSON object and has no named top-level fields.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ ENDPOINT 04 / 04
GET
Aggregate progress across auto-correct jobs
https://api.eu.apyhub.com/flowdocs/auto-correct-pdf-pages/overall-status

QUICKSTART

GUIDE

Quickstart

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

curl -X GET "https://api.eu.apyhub.com/flowdocs/auto-correct-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: unknown, queued, processing, done, or failed
  • progress is an integer from 0 to 100
{
  "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 status and overall progress for one or more auto-correct PDF jobs identified by job_ids. The response includes a top-level status, total progress, and optional per-job details.

Query Parameter(s)

AttributeTypeMandatoryDescription
job_idsStringYesJob identifier(s) to include in the aggregate check.

Response

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

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