Créer un document avec l'API PandaDoc

Crée un document à partir d'un modèle (template_uuid) ou d'un PDF public (url et name). Il reste en document.uploaded quelques secondes puis passe en document.draft. Rien n'est envoyé : appelez Send document quand Get document status affiche document.draft.

Identifiant
pandadoc_create_document

L'appel

POST https://connect.reportei.com/api/tools/pandadoc_create_document/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "recipients": []
  }
}

Votre système envoie l'id de la connexion de votre client et les arguments de la tool. Les headers sont les mêmes que pour toute l'API Connect : le token de votre produit et celui de votre client.

Paramètres

Les descriptions des paramètres suivent la documentation officielle de l'app, en anglais.

ParamètreTypeObligatoireDescription
template_uuidstringNonId of the template, from List templates. Send it or url, never both.
urlstringNonPublic HTTPS URL of a PDF to build the document from, instead of a template. Requires name. The signers fill the fields marked in the PDF with PandaDoc field tags, or its own form fields when parse_form_fields is true.
parse_form_fieldsbooleanNonOnly with url: true when the PDF has form fields, false when it uses PandaDoc field tags.
namestringNonName of the document. Required with url.
recipientsarrayOuiPeople who receive the document. Each one needs email or phone.
tokensarrayNonValues of the template variables, as listed by Get template.
fieldsobjectNonValues of the fields by field name, as listed by Get template. Each value is an object with value (text, number, boolean or an RFC 3339 date) and, optionally, the role it belongs to, like {"Company": {"value": "Acme"}}. Signature fields cannot be filled.
textsarrayNonContent for the text blocks of the template, by block name, as listed by Get template.
pricing_tablesarrayNonContent for the pricing tables of the template, by table name, as listed by Get template. Send every product of a table, because the table is rebuilt from what you send.
folder_uuidstringNonFolder for the document, with the uuid from List document folders. Omit it for the root folder.
metadataobjectNonYour own key-value data stored with the document, like the id of the deal in your system.
tagsarrayNonTags of the document.

Connexions possibles

Votre client connecte son compte PandaDoc une seule fois, avec l'un des modes ci-dessous. La même connexion sert à toutes les tools du toolkit.

Clé d'API

Votre client colle la clé de l'app sur un écran de Connect, ou votre système envoie la clé avec POST /api/customer-toolkits, sans écran.

OAuth avec l'app de votre produit

Vous enregistrez une fois l'app OAuth de votre produit, avec POST /api/merchants/credentials/pandadoc, et votre client autorise le compte sur un écran de consentement. Connect renouvelle le token avant son expiration.

La réponse

En cas de succès, Connect conserve le statut et le corps de la réponse de l'app. Les erreurs HTTP renvoyées par l'app utilisent l'objet {error, api_error} ; l'authentification ou la validation peuvent échouer avant l'exécution. Le header X-Toolkit-Execution-Id identifie l'exécution enregistrée, consultable avec GET /api/tools/executions/{uuid}.

Prête pour les agents IA

L'input de cette tool est un JSON Schema, disponible via GET /api/tools/pandadoc_create_document. Il devient la définition de tool de votre agent sans conversion.

Autres tools PandaDoc

Voir les 12 tools

Toolkits de la même catégorie

Voir les 100 toolkits

Voyez Connect appliqué à votre produit.

Essayez-le pendant 15 jours sans carte, ou présentez votre cas à notre équipe.