🔌 Endpoints
Base : https://print.synapx.fr — toutes les routes /v1/* exigent l'en-tête X-API-Key.
| Méthode | Chemin | Auth | Description |
|---|---|---|---|
| GET | /healthz | non | Sonde de santé. |
| GET | /v1/info | oui | Tenant identifié, moteurs et thèmes disponibles. |
| GET | /v1/themes | oui | Liste des thèmes CSS embarqués. |
| POST | /v1/render | oui | Génère un PDF ou un DOCX selon format. |
⚡ Démarrage rapide
curl -X POST https://print.synapx.fr/v1/render \
-H "X-API-Key: synapx-XXXX" \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Hello\n\nUn PDF en 10 lignes.",
"options": {"page_size":"A4","margin":"20mm"}
}' \
-o test.pdf
curl -X POST https://print.synapx.fr/v1/render \
-H "X-API-Key: synapx-XXXX" \
-H "Content-Type: application/json" \
-d '{
"format": "docx",
"markdown": "# Mon contrat\n\n## Article 1\nTexte…",
"docx_options": {
"title": "Contrat",
"footer": "CONTRAT-2026-001",
"cover": true
}
}' \
-o contrat.docx
const r = await fetch('https://print.synapx.fr/v1/render', {
method: 'POST',
headers: {
'X-API-Key': 'synapx-XXXX',
'Content-Type': 'application/json',
},
body: JSON.stringify({
markdown: '# Hello\n\nUn PDF.',
options: { page_size: 'A4' },
}),
});
const blob = await r.blob(); // → application/pdf
📖 Corps de requête (POST /v1/render)
| Champ | Type | Défaut | Description |
|---|---|---|---|
format | string | "pdf" | "pdf" ou "docx" |
markdown | string | — | Contenu source en Markdown |
html | string | — | Contenu HTML (PDF uniquement) — alternative à markdown |
theme | string | "neutral" | Thème embarqué (cf. /v1/themes) |
css | string | — | CSS additionnel, appliqué après le thème (PDF) |
base_url | string | — | Résolution des images relatives |
options | object | — | PDF : page_size, margin, landscape |
docx_options | object | — | DOCX : title, subtitle, footer, cover |
Note :
html n'est accepté que pour le format PDF. Le DOCX se génère exclusivement depuis du Markdown.
🎨 Thèmes
Des feuilles CSS prêtes à l'emploi sont embarquées ; le nom du fichier devient le nom du thème.
- neutral — sobre, sans page de garde, pied de page
Page x / y. Défaut. - proxipause — style commercial : page de garde (
<div class="cover">), en-tête courant, encadrés.recap-box, badges, grille KPI.
La liste complète et à jour est renvoyée par GET /v1/themes.
🧩 Cas d'usage
Factures & devis
Générez des PDF print-ready depuis vos gabarits Markdown — thème et pied de page personnalisés.
Contrats éditables
Sortie DOCX avec page de garde — le destinataire peut relire et amender dans Word.
Rapports automatisés
Branché sur un cron ou un workflow, produit des comptes-rendus PDF/DOCX à la volée.