apyhub
DATA EXTRACTION · FILE MANIPULATION

Auto Rotate PDF API

What it does

Auto Rotate PDF corrects page orientation in PDF files using OCR. Send one or more PDF files in the files array, and the service starts a job for each file.

The POST response returns a jobs array. Each job includes a job_id, filename, status, and progress, so you can track each document independently. Use GET /status/:job_id to check a single job, and GET /overall-status when you want aggregated progress for a set of job IDs.

When processing is complete, GET /download/:job_id returns the finished PDF as binary output. That makes Auto Rotate PDF useful for scanned documents, archived forms, receipts, and any PDF where page rotation may be inconsistent and needs correction before storage, review, or downstream OCR.

If you are building a document pipeline, this service fits between file upload and indexing. It gives you a simple job-based flow: submit PDFs, monitor progress, and download the corrected output when the job is done.

▣ ENDPOINT 01 / 04
POST
Auto-rotate PDF pages to correct orientation using OCR
http://localhost:8080/pankajretestflows/auto-correct-pdf

QUICKSTART

GUIDE

Quickstart

Upload one or more PDF files to auto-rotate them.

curl -X POST "http://localhost:8080/pankajretestflows/auto-correct-pdf" \
  -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, filename, status, and progress fields.

{
  "jobs": [
    {
      "job_id": "a1b2c3d4",
      "filename": "report.pdf",
      "status": "queued",
      "progress": 0
    }
  ]
}
TRY ITLIVE · 100 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

Uploads one or more PDF files and starts OCR-based auto-rotation processing for each file. The response returns a list of job records, one per submitted file, so you can track processing progress.

Request Body

ParameterTypeMandatoryDescription
filesString ArrayYesPDF files to auto-rotate. Each array item is a binary file upload.

Response

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

ParameterTypeMandatoryDescription
jobsObject ArrayYesList of job records created for the submitted PDF files.
jobs[].job_idStringYesJob identifier for tracking the file's processing.
jobs[].filenameStringYesName of the submitted PDF file.
jobs[].statusStringYesCurrent job status.
jobs[].progressIntegerYesProgress value for the job.

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
http://localhost:8080/pankajretestflows/auto-correct-pdf/status/:job_id

QUICKSTART

GUIDE

Quickstart

Check the status of a PDF auto-correction job by its job ID.

curl -X GET "http://localhost:8080/pankajretestflows/auto-correct-pdf/status/:job_id" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with job_id as a string, status as a string (queued, processing, done, or failed), progress as an integer from 0 to 100, and optional error as a string or null.

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

Retrieves the current status of an auto-correct PDF job identified by job_id. The response returns the job identifier, its current status, and a numeric progress value, with an optional error message when present.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesIdentifies the auto-correct job to look up.

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 success response is an object containing the current job state; status can be queued, processing, done, or failed, and progress ranges from 0 to 100.

ParameterTypeMandatoryDescription
job_idStringYesThe job identifier.
statusENUMYesCurrent job state. Allowed values: queued, processing, done, failed.
progressIntegerYesJob progress as a percentage from 0 to 100.
errorStringNoError message, if present. This field is nullable.

Notes

Poll this endpoint with the job_id returned by the submit call. The status field cycles through transitional values (queued, processing) before reaching a terminal state (done or failed). Read progress alongside status to track completion, and check error if the job fails.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ ENDPOINT 03 / 04
GET
Download a finished auto-correct output
http://localhost:8080/pankajretestflows/auto-correct-pdf/download/:job_id

QUICKSTART

GUIDE

Quickstart

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

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

[pdf file bytes]
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

Downloads the finished auto-correct PDF output for a specific job.

Path Parameter(s)

AttributeTypeMandatoryDescription
job_idStringYesIdentifies the finished job.

Response

Returns a binary file response (string with format: binary). The success response is the downloaded auto-correct output file.

Path parameters

Name
Type
Description
job_idREQUIRED
string
▣ ENDPOINT 04 / 04
GET
Aggregate progress across auto-correct jobs
http://localhost:8080/pankajretestflows/auto-correct-pdf/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 "http://localhost:8080/pankajretestflows/auto-correct-pdf/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, 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 progress for one or more auto-correct PDF jobs. You pass the job ID list in the query string, and the response reports overall status, overall progress, and optional per-job details.

Query Parameter(s)

AttributeTypeMandatoryDescription
job_idsStringYesJob ID list to evaluate.

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, progress is an integer from 0 to 100, and the remaining fields provide per-job and file-count information when present.

AttributeTypeMandatoryDescription
statusENUMYesAggregate status. Allowed values: unknown, queued, processing, done, failed.
detailsObject ArrayNoPer-job status entries. Each item contains:<br>- job_id (String)<br>- status (String)<br>- progress (Integer)
progressIntegerYesOverall progress, from 0 to 100.
total_filesIntegerNoTotal number of files included in the aggregation.
completed_filesIntegerNoNumber of files completed in the aggregation.

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.