API & Webhook Integration
Generate Documents using Webhooks & APIs
Docupilot allows you to simplify your document generation process by integrating with other systems through Unauthenticated API endpoints which can also be configured as Webhooks in other applications.
Creating an API Endpoint
To create an API Endpoint, follow these steps:
Click on the Create tab to access the Create Document view and select API Integrations from the left sidebar.

Click on Create API Endpoint button to create the Url for document generation.

When data is sent to the API Endpoint, it generates a Document and sends it to configured delivery locations. If no deliveries are configured, then it will return a secure file URL to download the generated document. This secure URL is valid for 24 hours by default which can be customized under Data Retention Preferences.
If you want to download the generated document along with triggering deliveries you need to append download=true query parameter in the URL.
If you want to receive the generated document as a file in response, append download=file query parameter in the URL. This will include the secure file URL in the Content-Location response header. If you do not prefer the secure file URL to be created, send an additional query parameter includeUrl=false. This will not return the Content-Location header in the response.
Using the API Endpoint
The API Endpoint can be configured in various locations – Ex: Configure it as a Webhook in your CRM, or configure it as a Webhook in your the Forms/Survey software you use, or configure this URL inside your custom built application, and send data to it.
For example, if this is your template:
You should send a POST request to the API Endpoint, with Content-Type as application/json and body with JSON payload structured like in the example below:
Please note that the tokens (merge fields) defined in the template should match the keys in the webhook data.
Sample response when at-least 1 delivery configured:
Sample response with no deliveries configured -or- with download=true query parameter
Sample response when download=file query parameter is appended


To avoid creating the Secure file URL, add the includeUrl=false parameter to the API Endpoint, which will remove the Content-Location from the API response header.
Quickstart with a CURL Script
The API Integration tab shows an example CURL request for the respective template.

Python
Deleting the API Endpoint
To delete the API Endpoint, click the Delete button available on the right side of the API Integrations section.

To create or delete these links, users must have Manage or Write permissions on the templates. Please note that deleting the API Endpoint link will also remove the link created for Data Capture Form.
Last updated