Une API pour lire et remplir les PDF.
Envoyez un formulaire, laissez iFillPDF détecter les champs et les personnes, puis poussez vos valeurs pour produire un PDF rempli. Même pipeline que l'éditeur, exposé proprement pour vos intégrations.
Quickstart
Utilisez une clé API d’équipe, envoyez un PDF, et laissez l’endpoint synchrone renvoyer un schéma. Pour les fichiers plus lourds ou les flux type interface, passez par le pending upload puis le flux document asynchrone.
curl -s -X POST https://www.ifillpdf.com/api/v1/documents/analyze \
-H "Authorization: Bearer ifk_live_..." \
-F "pdf=@cerfa.pdf" \
-F "description=Déclaration fiscale avec déclarant et conjoint" \
-F 'suggested_entities=[{"id":"declarant","label":"Déclarant","color":"#6D7BFF"}]'Authentification
Chaque endpoint v1 accepte Authorization: Bearer ifk_live_…. Les clés API sont à l’échelle de l’équipe. L’application web peut aussi appeler ces endpoints via son cookie de session Supabase, mais les intégrations externes doivent utiliser l’auth Bearer uniquement.
Flux d’analyse asynchrone
La route asynchrone répond immédiatement avec status: analyzing. Interrogez le document jusqu’à ce que status passe à completed ou failed.
PID=$(curl -s -X POST https://www.ifillpdf.com/api/pending-uploads \
-F "pdf=@document.pdf" | jq -r '.id')
DOC=$(curl -s -X POST https://www.ifillpdf.com/api/v1/documents \
-H "Authorization: Bearer ifk_live_..." \
-H "Content-Type: application/json" \
-d "{\"pending_upload_id\":\"$PID\",\"name\":\"Contrat client\"}" | jq -r '.document_id')
curl -s https://www.ifillpdf.com/api/v1/documents/$DOC \
-H "Authorization: Bearer ifk_live_..."Référence des endpoints
Chaque endpoint inclut ses paramètres, la forme de la requête, les réponses courantes, et un exemple curl / JS / Python. Le contrat complet lisible par machine est aussi disponible sur /openapi.json.
GET/api/v1/documentsList documents+
/api/v1/documentsPaginated document list with q, status, limit, cursor, and include_voided filters.
limitquery1-100, default 20cursorqueryCursor returned as next_cursorqquerySearch by document namestatusqueryanalyzing, completed, failed, draft, filling, …include_voidedquerytrue or falseNone.
200{ documents: DocumentSummary[], next_cursor: string | null }curl -s "https://www.ifillpdf.com/api/v1/documents?limit=20&status=completed" \
-H "Authorization: Bearer ifk_live_..."POST/api/v1/documentsCreate async analysis+
/api/v1/documentsUploads or claims a PDF, debits quota, prepares page images, starts semantic analysis, then returns 202 for polling.
No parameters.
multipart/form-data with pdf, name, description, suggested_entities; or JSON with pending_upload_id or pdf_url.
202{ document_id, status: "analyzing", page_count, quota, … }PID=$(curl -s -X POST https://www.ifillpdf.com/api/pending-uploads \
-F "pdf=@document.pdf" | jq -r '.id')
DOC=$(curl -s -X POST https://www.ifillpdf.com/api/v1/documents \
-H "Authorization: Bearer ifk_live_..." \
-H "Content-Type: application/json" \
-d "{\"pending_upload_id\":\"$PID\",\"name\":\"Contrat client\"}" | jq -r '.document_id')
curl -s https://www.ifillpdf.com/api/v1/documents/$DOC \
-H "Authorization: Bearer ifk_live_..."POST/api/v1/documents/analyzeCreate sync analysis+
/api/v1/documents/analyzeRuns analysis inline and returns the final schema. Best for short PDFs.
No parameters.
Same inputs as POST /api/v1/documents.
200{ document_id, page_count, schema, quota, … }curl -s -X POST https://www.ifillpdf.com/api/v1/documents/analyze \
-H "Authorization: Bearer ifk_live_..." \
-F "pdf=@cerfa.pdf" \
-F "description=Déclaration fiscale avec déclarant et conjoint" \
-F 'suggested_entities=[{"id":"declarant","label":"Déclarant","color":"#6D7BFF"}]'GET/api/v1/documents/{id}Get document+
/api/v1/documents/{id}Returns status, schema, entities, field list, values, preview metadata, and errors.
idpathDocument UUIDNone.
200Document with schema and values404Document not found in the authenticated team410Document is voidedcurl -s "https://www.ifillpdf.com/api/v1/documents/$DOC" \
-H "Authorization: Bearer ifk_live_..."PATCH/api/v1/documents/{id}Update document+
/api/v1/documents/{id}Renames a document, updates description/entity hints, or patches field values.
idpathDocument UUIDJSON with name, description, user_context, suggested_entities, and/or values keyed by schema field id.
200Updated document400Invalid name, context, entity hints, or values410Document is voidedcurl -s -X PATCH "https://www.ifillpdf.com/api/v1/documents/$DOC" \
-H "Authorization: Bearer ifk_live_..." \
-H "Content-Type: application/json" \
-d '{"name":"Contrat signé","values":{"field_1":"Jean Dupont"}}'DELETE/api/v1/documents/{id}Delete document+
/api/v1/documents/{id}Soft-deletes the document by moving it to state voided.
idpathDocument UUIDNone.
200{ ok: true, document_id, state: "voided" }curl -s -X DELETE "https://www.ifillpdf.com/api/v1/documents/$DOC" \
-H "Authorization: Bearer ifk_live_..."POST/api/v1/documents/{id}/reanalyzeReanalyze+
/api/v1/documents/{id}/reanalyzeReruns page rendering and AI semantic labeling with the persisted user context.
idpathDocument UUIDNone.
202Re-analysis started200Analysis was already running402Page quota exhaustedcurl -s -X POST "https://www.ifillpdf.com/api/v1/documents/$DOC/reanalyze" \
-H "Authorization: Bearer ifk_live_..."POST/api/v1/documents/{id}/fillFill PDF+
/api/v1/documents/{id}/fillApplies values and streams the PDF, or returns a signed URL with ?format=url.
idpathDocument UUIDformatquerypdf or urlJSON with values keyed by schema field id. Signatures can be { dataUrl }. watermark can force watermarking.
200application/pdf binary by default200{ url, expires_in, filled, failed } when format=url409Schema is not readycurl -s -X POST "https://www.ifillpdf.com/api/v1/documents/$DOC/fill?format=pdf" \
-H "Authorization: Bearer ifk_live_..." \
-H "Content-Type: application/json" \
-d '{"values":{"field_1":"Jean Dupont","checkbox_2":true}}' \
-o filled.pdfPOST/api/v1/uploadsRequest signed upload+
/api/v1/uploadsReturns a one-time signed PUT URL so you can upload PDFs up to 25 MB directly, bypassing the function body limit.
No parameters.
JSON with fileName (must end with .pdf), sizeBytes, and optional contentType (defaults to application/pdf).
200{ id, upload_url, token, storage_path, expires_at, max_bytes }413PDF exceeds the maximum stored size415fileName not .pdf or contentType not application/pdf# 1. request a signed URL
curl -s -X POST https://www.ifillpdf.com/api/v1/uploads \
-H "Authorization: Bearer ifk_live_..." \
-H "Content-Type: application/json" \
-d '{"fileName":"contrat.pdf","sizeBytes":1840221}'
# 2. PUT the bytes to upload_url, then analyze with pending_upload_id
curl -X PUT "<upload_url>" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/pdf" \
--data-binary @contrat.pdfGET/api/v1/templatesList templates+
/api/v1/templatesLists public-library templates (scope=public) or your own team/private templates (scope=mine). Cursor-paginated.
scopequerypublic (default) or minecategoryqueryFilter by categorylanguagequeryFilter by language code, e.g. frqquerySearch by template namelimitquery1-100, default 24cursorqueryCursor returned as next_cursorNone.
200{ templates: Template[], next_cursor: string | null }curl -s "https://www.ifillpdf.com/api/v1/templates?scope=public&q=cerfa" \
-H "Authorization: Bearer ifk_live_..."POST/api/v1/templatesCreate template+
/api/v1/templatesSnapshots an analyzed document into a reusable template. Regular keys can create private or team templates only.
No parameters.
JSON with source_document_id (required) plus optional name, description, category, tags[], language, visibility.
201{ template }400Missing source_document_id429Rate limit exceeded (60/min)curl -s -X POST "https://www.ifillpdf.com/api/v1/templates" \
-H "Authorization: Bearer ifk_live_..." \
-H "Content-Type: application/json" \
-d '{"source_document_id":"$DOC","name":"Bail meublé","visibility":"team"}'GET/api/v1/templates/{id}Get template+
/api/v1/templates/{id}Returns a single template with its field and party structure. Never returns pre-filled defaults or values.
idpathTemplate UUIDNone.
200{ template } with fields and parties404Not found or not visible to the callercurl -s "https://www.ifillpdf.com/api/v1/templates/$TPL" \
-H "Authorization: Bearer ifk_live_..."PATCH/api/v1/templates/{id}Update template+
/api/v1/templates/{id}Updates your own template metadata and visibility. Only the creator can edit. Public publishing stays admin-only.
idpathTemplate UUIDJSON with any of name, description, category, tags[], language, visibility (private | team).
200{ template }403Not the creator, or visibility set to public409Update rejected (e.g. team to private downgrade is frozen)curl -s -X PATCH "https://www.ifillpdf.com/api/v1/templates/$TPL" \
-H "Authorization: Bearer ifk_live_..." \
-H "Content-Type: application/json" \
-d '{"name":"Bail meublé 2026","visibility":"private"}'DELETE/api/v1/templates/{id}Delete template+
/api/v1/templates/{id}Permanently deletes your own template and its stored assets. Documents created from it are unaffected.
idpathTemplate UUIDNone.
200{ deleted: true, id }403Not the creatorcurl -s -X DELETE "https://www.ifillpdf.com/api/v1/templates/$TPL" \
-H "Authorization: Bearer ifk_live_..."POST/api/v1/templates/{id}/useUse template+
/api/v1/templates/{id}/useInstantiates a template into a new working document pre-filled with its frozen defaults. FREE — does not debit the page quota.
idpathTemplate UUIDNone.
201{ document_id, status: "filling" }429Too many duplications (30/min per team)curl -s -X POST "https://www.ifillpdf.com/api/v1/templates/$TPL/use" \
-H "Authorization: Bearer ifk_live_..."GET/api/v1/templates/by-slug/{slug}Resolve template by slug+
/api/v1/templates/by-slug/{slug}Public, no auth. Resolves a marketplace slug to the published public template that backs it, when a real fillable PDF exists.
slugpathMarketplace slug, e.g. cerfa-2042None.
200{ template }404No published public template with a real PDF for this slugcurl -s "https://www.ifillpdf.com/api/v1/templates/by-slug/cerfa-2042"POST/api/v1/vault/documentsAdd to vault+
/api/v1/vault/documentsUploads a personal ID or financial document (payslip, RIB, KBIS, passport) to the per-user vault for later pre-filling.
No parameters.
JSON with file_base64, file_name, mime_type (pdf/jpeg/png/webp/heic) and optional label.
200{ document }413File exceeds the vault size limit429Rate limit exceeded (30/min)curl -s -X POST "https://www.ifillpdf.com/api/v1/vault/documents" \
-H "Authorization: Bearer ifk_live_..." \
-H "Content-Type: application/json" \
-d '{"file_base64":"JVBERi0...","file_name":"rib.pdf","mime_type":"application/pdf","label":"RIB perso"}'Modèles
Snapshotez un document analysé en modèle (POST /api/v1/templates), puis instanciez-le avec POST /api/v1/templates/{id}/use — gratuit, sans débit de quota.
MCP server
Chaque endpoint est aussi exposé en Model Context Protocol pour les agents IA (Claude, ChatGPT, Cursor).
Schéma et valeurs du document
Le schéma d’analyse est volontairement simple : chaque champ a un id stable, une bounding box, un index de page et un rattachement à une entité. Utilisez ces ids comme clés pour patcher les valeurs ou remplir le PDF.
statusanalyzing | completed | failedschema.fieldschamps détectés, avec les ids utilisés par valuesschema.partiesentités telles que Déclarant, Conjoint, Hébergeurvaluesvaleurs persistées : texte, case à cocher, nombre, signaturepreview_image_urlaperçu de la première page rendue quand disponiblecurl -s -X POST "https://www.ifillpdf.com/api/v1/documents/$DOC/fill?format=pdf" \
-H "Authorization: Bearer ifk_live_..." \
-H "Content-Type: application/json" \
-d '{"values":{"field_1":"Jean Dupont","checkbox_2":true}}' \
-o filled.pdfErreurs et limites
JSON mal formé, curseur invalide, patch de valeur invalide, PDF manquant.
Token Bearer manquant ou invalide.
Quota de pages épuisé pour l’équipe.
Non créateur de la ressource, ou tentative de publier un modèle en public.
Ressource introuvable dans l’équipe authentifiée, ou non visible.
Schéma non prêt, chemin PDF manquant, ou mise à jour de modèle rejetée.
Document supprimé (état voided).
PDF ou fichier coffre dépassant la taille acceptée.
fileName d’upload non .pdf, ou contentType ≠ application/pdf.
Limite de débit dépassée. Start/fill : 60/min. Analyze/reanalyze/vault : 30/min.