Docs/APIs/PDF Page Numbers

PDF Page Numbers

Add page numbers to a PDF

OperationalCredits 10 per callp50 98msDocumentsStar

Overview

Numbers are drawn in Helvetica as real PDF text, so the rest of the document is untouched. Rotated pages are handled, so the number sits in the chosen corner the right way up as the page is displayed. Each call accepts one PDF of up to 10 MB and 300 pages.

Live Test PDF Page Numbers API →

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

POSThttps://api.apiverve.com/v1/pdfpagenumbers
curl -X POST https://api.apiverve.com/v1/pdfpagenumbers \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "format": "Page {page} of {total}",
  "pdf": "https://raw.githubusercontent.com/mozilla/pdf.js/master/test/pdfs/rotation.pdf"
}'

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent as JSON in the request body. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
pdfOptionalstringThe PDF file to number (up to 10 MB and 300 pages), or a public PDF URL
url
positionOptionalstringWhere to place the number
bottom-centerbottom-rightbottom-lefttop-centertop-righttop-left
default bottom-center
fontSizeOptionalnumberFont size in points, from 6 to 36
default 10 · range 6–36
formatOptionalPremiumstringLabel template containing {page}, and optionally {total}, such as Page {page} of {total}
startAtOptionalPremiumintegerNumber for the first numbered page
range 0–100000
skipFirstOptionalPremiumbooleanLeave the first page (a cover) unnumbered

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "pdfName": "5c9f95f9-9719-47c3-a923-be3bc1f1dc91.pdf",
    "pageCount": 2,
    "numberedPages": 2,
    "position": "bottom-center",
    "format": "Page {page} of {total}",
    "startAt": 1,
    "lastLabel": "Page 2 of 2",
    "size": 6218,
    "expires": 1792230037933,
    "downloadURL": "https://storage.googleapis.com/apiverve/APIData/pdfpagenumbers/5c9f95f9-9719-47c3-a923-be3bc1f1dc91.pdf?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1792230037&Signature…"
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
pdfNamestring"5c9f95f9-9719-47c3-a923-be3bc1f1dc91.pdf"File name of the numbered PDF
pageCountnumber2Pages in the PDF
numberedPagesnumber2Pages that received a number
positionstring"bottom-center"Where the numbers were placed
formatstring"Page {page} of {total}"The label template used
startAtnumber1The number given to the first numbered page
lastLabelstring"Page 2 of 2"The label on the last page, such as Page 12 of 12
sizenumber6218Size of the numbered PDF in bytes
expiresnumber1792230037933When the download link expires (Unix time in milliseconds)
downloadURLstring"https://storage.googleapis.com/apiverve/APIData/pdfpagenumbers/5c9f95f9-9719-47c3-a923-be3bc1f1dc91.…"Signed link to download the numbered PDF, valid for 2 days

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Use cases

Generated Reports
Number the pages of reports and exports produced by other tools that leave them unnumbered.
Legal and Compliance
Add Page X of Y labels to contracts and filings before they are signed or submitted.
Merged Documents
Number a document after merging several PDFs so the combined file reads as one.
Print and Publishing
Paginate manuscripts, handouts and booklets, skipping the cover page.

Other ways to use PDF Page Numbers

Set up PDF Page Numbers on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKit →Reference →

More in Documents:

Was this page helpful?