REST API

API documentation

Build PDF stamping and exhibit indexes into your applications with our REST API.

The API is included with the Pro and Enterprise plans.

Quick start

Three steps to your first call.

  1. Create your account

    Then move to the Pro or Enterprise plan: API keys can only be created on those plans.

  2. Generate an API key

    From your dashboard, in the API keys section.

  3. Make your first call

    Send your PDFs: they come back stamped, with the index if you ask for it.

Authentication

Every request must carry your API key in the Authorization header.

Get an API key

  1. Sign in to your HelloStampPdf account.
  2. Open the API keys section.
  3. Click Create a key.
  4. Give the key a name and copy it: it is shown only once.
Authentication header
Authorization: Bearer YOUR_API_KEY

Security

Never share your API key and never put it in code that runs in a browser. Keep it in your server's environment variables.

POST/api/v1/stamp

Stamp PDFs

Stamps one or more PDFs with continuous numbering and returns the files encoded in base64.

Parameters (multipart/form-data)

ParameterTypeDescription
files
Required
PDF fileOne or more files: PDF, images (JPG, PNG, WEBP, GIF, TIFF, AVIF) or Word (DOC, DOCX). Up to 20 files, 50 MB each. An image is centred on an A4 page (landscape if wider than tall) and scaled down to keep the corners free for the stamp; a Word document is converted to PDF. One files field per file.
config
Required
JSON textStamp configuration (details below).
outputType
Optional
textMERGED (default): a single PDF. SEPARATE: one PDF per exhibit.
includeBordereau
Optional
true / falsetrue to receive the exhibit index (one extra credit). Default: false.
caseTitle
Optional
textCase title, shown on the index.
fileNames
Optional
JSON arrayFile names to use instead of the original ones, in the order the files are sent.

Stamp configuration (config field)

FieldValuesDescription
shapeROUND, SQUARE, RECTANGLEStamp shape
positionsee belowPosition on the page
topTexttextTop text (required)
bottomTexttextBottom text (optional)
fontSize6 to 24Text size
color#RRGGBB (hex colour)Text colour
startNumber1 or moreNumber of the first exhibit, increased by 1 for each file
width50 to 300Width, in points
height30 to 200Height, in points
marginX0 to 100Horizontal margin, in points
marginY0 to 100Vertical margin, in points
borderWidth0 to 10Border width, in points
borderColor#RRGGBB (hex colour)Border colour
stampEffecttrue / falseInk stamp effect (optional, false by default)
config
{
  "shape": "RECTANGLE",
  "position": "TOP_RIGHT",
  "topText": "PIECE N°",
  "bottomText": "Dossier X",
  "fontSize": 12,
  "color": "#000000",
  "startNumber": 1,
  "width": 120,
  "height": 60,
  "marginX": 20,
  "marginY": 20,
  "borderWidth": 2,
  "borderColor": "#000000",
  "stampEffect": false
}

Available positions

  • TOP_LEFT
  • TOP_CENTER
  • TOP_RIGHT
  • CENTER_LEFT
  • CENTER
  • CENTER_RIGHT
  • BOTTOM_LEFT
  • BOTTOM_CENTER
  • BOTTOM_RIGHT
Example request
curl -X POST https://www.hellostamppdf.com/api/v1/stamp \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "files=@document1.pdf" \
  -F "files=@document2.pdf" \
  -F 'config={"shape":"RECTANGLE","position":"TOP_RIGHT","topText":"PIECE N°","bottomText":"Affaire Martin","fontSize":12,"color":"#000000","startNumber":1,"width":120,"height":60,"marginX":20,"marginY":20,"borderWidth":2,"borderColor":"#000000","stampEffect":false}' \
  -F "outputType=MERGED" \
  -F "includeBordereau=true" \
  -F "caseTitle=Dossier Martin c/ Dupont"
Response (200 OK)
{
  "success": true,
  "jobId": "clxxx...",
  "totalPages": 10,
  "creditsUsed": 11,
  "creditsRemaining": 89,
  "processingTime": 1234,
  "files": [
    {
      "name": "stamped_merged.pdf",
      "data": "base64_encoded_pdf..."
    }
  ]
}

Each returned file is listed in files, its content encoded in base64 in data.

Output formats and index

Choose the shape of the returned files and add the summary index if you need it.

MERGED

Merged PDF

All stamped exhibits in a single file, stamped_merged.pdf. With the index, it is placed at the start of the file.

SEPARATE

Separate PDFs

One file per exhibit, under its original name (or the one given in fileNames). The index, if requested, is returned on its own, first, as bordereau.pdf.

Summary index

Add includeBordereau=true to receive the index: number, name and page count of each exhibit.

Credits

One credit per stamped page, plus one credit for the index. Example: 20 pages with the index = 21 credits.

Example: separate PDFs with index
curl -X POST https://www.hellostamppdf.com/api/v1/stamp \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "files=@contrat.pdf" \
  -F "files=@annexe.pdf" \
  -F "files=@conditions.pdf" \
  -F 'config={"shape":"ROUND","position":"TOP_RIGHT","topText":"PIECE N°","bottomText":"Cabinet Martin","fontSize":12,"color":"#9F1239","startNumber":1,"width":100,"height":100,"marginX":20,"marginY":20,"borderWidth":2,"borderColor":"#9F1239","stampEffect":true}' \
  -F "outputType=SEPARATE" \
  -F "includeBordereau=true" \
  -F "caseTitle=Affaire Martin c/ Dupont - TJ Paris"
Response (SEPARATE with index)
{
  "success": true,
  "jobId": "clxxx...",
  "totalPages": 20,
  "creditsUsed": 21,
  "creditsRemaining": 79,
  "processingTime": 2456,
  "files": [
    { "name": "bordereau.pdf", "data": "base64_encoded_pdf..." },
    { "name": "contrat.pdf", "data": "base64_encoded_pdf..." },
    { "name": "annexe.pdf", "data": "base64_encoded_pdf..." },
    { "name": "conditions.pdf", "data": "base64_encoded_pdf..." }
  ]
}
Example: merged PDF with index
curl -X POST https://www.hellostamppdf.com/api/v1/stamp \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "files=@contrat.pdf" \
  -F "files=@annexe.pdf" \
  -F "files=@conditions.pdf" \
  -F 'config={"shape":"RECTANGLE","position":"TOP_RIGHT","topText":"PIECE N°","fontSize":12,"color":"#000000","startNumber":1,"width":120,"height":60,"marginX":20,"marginY":20,"borderWidth":2,"borderColor":"#000000","stampEffect":false}' \
  -F "outputType=MERGED" \
  -F "includeBordereau=true" \
  -F "caseTitle=Affaire Martin c/ Dupont"
Response (MERGED with index)
{
  "success": true,
  "jobId": "clxxx...",
  "totalPages": 20,
  "creditsUsed": 21,
  "creditsRemaining": 79,
  "processingTime": 2123,
  "files": [
    { "name": "stamped_merged.pdf", "data": "base64_encoded_pdf..." }
  ]
}

POST/api/v1/bordereau

Generate the index only

Generates the PDF index without stamping any file: only the exhibit details are sent, as JSON.

Use case

For applications that stamp PDFs on their side and only need the index. Also useful to avoid uploading large files.

Parameters (application/json)

ParameterTypeDescription
pieces
Required
arrayList of exhibits, at least one: number and name (title). Optional: communicatedAt (first communication: YYYY-MM-DD date or ISO 8601 date-time, defaults to now; exhibits are grouped by exact value, a date-time keeps two indexes of the same day apart) and theme (optional subheading, numbering does not change). pageCount is accepted but no longer displayed.
court
Optional
textCourt shown at the top (e.g. "Cour d'Appel de VERSAILLES").
caseTitle
Optional
textOptional reference shown under the court (e.g. "RG n° 24/12345").
from
Optional
JSON text"Par :" block — name (required), bar, address, phone, email, toque, representing ("Avocat de …"). Only filled-in fields are shown.
to
Optional
array"A :" blocks, one per recipient — name (required), bar, address, representing. A party without counsel: name only.
themes
Optional
arrayDisplay order of themes (otherwise, order of first appearance).
Example request
curl -X POST https://www.hellostamppdf.com/api/v1/bordereau \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "court": "Cour d’Appel de VERSAILLES",
    "from": {
      "name": "Maître Samya BOUICHE",
      "bar": "Paris",
      "address": "10 rue des Halles - 75001 PARIS",
      "phone": "01.42.60.09.00",
      "email": "s.bouiche@cabinet.fr",
      "toque": "G 0479",
      "representing": "Madame Hayat ASSERMOUH"
    },
    "to": [
      { "name": "Maître Audrey HINOUX", "bar": "Paris", "representing": "la société UPM FRANCE" }
    ],
    "themes": ["Correspondances"],
    "pieces": [
      { "number": 1, "name": "Contrat de travail du 3 avril 2018", "communicatedAt": "2024-10-01" },
      { "number": 2, "name": "E-mail de Madame ASSERMOUH du 25 décembre 2019", "communicatedAt": "2024-10-01", "theme": "Correspondances" },
      { "number": 3, "name": "Attestation Pôle Emploi du 16 février 2023" }
    ]
  }'
Response (200 OK)
{
  "success": true,
  "creditsUsed": 1,
  "creditsRemaining": 99,
  "processingTime": 234,
  "file": {
    "name": "bordereau.pdf",
    "data": "base64_encoded_pdf..."
  }
}

Cost: one credit. No PDF is uploaded; the index comes back in file, encoded in base64.

POST/api/v1/merge

Merge files

Combines several files into one PDF, in the order sent, to make a single exhibit before stamping (e.g. an email and its attachments).

Parameters (multipart/form-data)

ParameterTypeDescription
files
Required
PDF file2 to 20 files (PDF, images or Word, 50 MB each), in the desired order. One files field per file.
Example request
curl -X POST https://www.hellostamppdf.com/api/v1/merge \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "files=@email.pdf" \
  -F "files=@capture-ecran.png" \
  -F "files=@piece-jointe.docx"
Response (200 OK)
{
  "success": true,
  "pageCount": 4,
  "file": { "name": "merged.pdf", "data": "base64_encoded_pdf..." }
}

Free: only stamping uses credits. The PDF comes back in file, base64-encoded.

Error codes

When something goes wrong, the response holds a message and a code:

CodeMeaning
400Invalid request: missing or incorrect parameter, file that is not a PDF, more than 20 files or a file over 50 MB
401Not authenticated: missing or invalid API key
402Insufficient credits
403A PDF exceeds the page limit of your plan
429Too many requests: try again in a moment
500Internal server error
402
{
  "error": "Insufficient credits. You need 21 credits but have 12.",
  "code": "ERR_402"
}

Limits

  • 50 MB maximum per PDF file
  • 20 files maximum per request
  • 200 requests per minute per API key
  • Pages per PDF depend on your plan

Ready to start?

The API is included with the Pro and Enterprise plans.

API documentation | HelloStampPdf