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.
Create your account
Then move to the Pro or Enterprise plan: API keys can only be created on those plans.
Generate an API key
From your dashboard, in the API keys section.
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
- Sign in to your HelloStampPdf account.
- Open the API keys section.
- Click Create a key.
- Give the key a name and copy it: it is shown only once.
Authorization: Bearer YOUR_API_KEYSecurity
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)
| Parameter | Type | Description |
|---|---|---|
filesRequired | PDF file | One 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. |
configRequired | JSON text | Stamp configuration (details below). |
outputTypeOptional | text | MERGED (default): a single PDF. SEPARATE: one PDF per exhibit. |
includeBordereauOptional | true / false | true to receive the exhibit index (one extra credit). Default: false. |
caseTitleOptional | text | Case title, shown on the index. |
fileNamesOptional | JSON array | File names to use instead of the original ones, in the order the files are sent. |
Stamp configuration (config field)
| Field | Values | Description |
|---|---|---|
shape | ROUND, SQUARE, RECTANGLE | Stamp shape |
position | see below | Position on the page |
topText | text | Top text (required) |
bottomText | text | Bottom text (optional) |
fontSize | 6 to 24 | Text size |
color | #RRGGBB (hex colour) | Text colour |
startNumber | 1 or more | Number of the first exhibit, increased by 1 for each file |
width | 50 to 300 | Width, in points |
height | 30 to 200 | Height, in points |
marginX | 0 to 100 | Horizontal margin, in points |
marginY | 0 to 100 | Vertical margin, in points |
borderWidth | 0 to 10 | Border width, in points |
borderColor | #RRGGBB (hex colour) | Border colour |
stampEffect | true / false | Ink stamp effect (optional, false by default) |
{
"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
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"{
"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.
MERGEDMerged PDF
All stamped exhibits in a single file, stamped_merged.pdf. With the index, it is placed at the start of the file.
SEPARATESeparate 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.
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"{
"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..." }
]
}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"{
"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)
| Parameter | Type | Description |
|---|---|---|
piecesRequired | array | List 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. |
courtOptional | text | Court shown at the top (e.g. "Cour d'Appel de VERSAILLES"). |
caseTitleOptional | text | Optional reference shown under the court (e.g. "RG n° 24/12345"). |
fromOptional | JSON text | "Par :" block — name (required), bar, address, phone, email, toque, representing ("Avocat de …"). Only filled-in fields are shown. |
toOptional | array | "A :" blocks, one per recipient — name (required), bar, address, representing. A party without counsel: name only. |
themesOptional | array | Display order of themes (otherwise, order of first appearance). |
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" }
]
}'{
"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)
| Parameter | Type | Description |
|---|---|---|
filesRequired | PDF file | 2 to 20 files (PDF, images or Word, 50 MB each), in the desired order. One files field per file. |
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"{
"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:
| Code | Meaning |
|---|---|
400 | Invalid request: missing or incorrect parameter, file that is not a PDF, more than 20 files or a file over 50 MB |
401 | Not authenticated: missing or invalid API key |
402 | Insufficient credits |
403 | A PDF exceeds the page limit of your plan |
429 | Too many requests: try again in a moment |
500 | Internal server error |
{
"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