Docupilot
HomeLoginSignup
  • Docupilot Help Documentation
  • Getting Started
  • Building Templates
    • Tokens (Merge Field)
    • Document Builder
    • AI-Powered Template Builder
    • Word Document (DOCX) & PowerPoint (PPTX)
    • Excel (XLSX)
    • Fillable PDF
    • Template Preferences
    • Formatting Your Data
    • Numerical Calculations
    • Advanced usage
  • Test your document template
  • Deliveries
    • Email
    • Webhook
    • Dropbox
    • Google Drive
    • One Drive
    • DropboxSign (formerly Hellosign)
    • DocuSign
    • SignNow
    • Xodo sign (formerly Eversign)
    • Signable
    • Yousign
    • Amazon S3
    • SFTP
  • Create document
    • Data Capture Form
    • API & Webhook Integration
    • Bulk Create
    • Integrate with Zapier
    • Integrate with Make
    • Integrate with Zoho Flow
    • Integrate with Integrately
  • Integrations
    • Google Forms
    • Google Sheets
    • Airtable Extension
    • Docupilot Add in for Microsoft Word
  • Collaborating with multiple users
    • Invite users
    • Manage & delete users
  • Reports
  • Settings
    • Workspace
    • API Settings
    • Manage Subscription
    • Linked Accounts
  • Folders & Templates management
    • Manage Folders
    • Manage Templates
    • Share Templates & Folders
  • Profile & Account Security
  • Frequently Asked Questions (FAQs)
  • Developers
    • API Overview
    • Templates API
    • Folders API
  • Updates
    • Scheduled Downtime Notification
Powered by GitBook
On this page
  • Webhook Integration
  • Webhook Endpoint
  • API Integration
  • CURL
  • Python
  • API Response

Was this helpful?

  1. Create document

API & Webhook Integration

Generate Documents using Webhooks & APIs

Webhook Integration

You can configure webhook in your CRM, Forms to send data to Docupilot to create your document.

Webhook Endpoint

Http Method : POST

Content-Type : application/json

https://api.docupilot.app/documents/create/{org_unique}/{document_unique}

Sample Endpoint
https://api.docupilot.app/documents/create/46ac75c3/5e7d03ec

You can find this URL in Create section in template's details page.
Sample Template
Hello {{name}},

{{email}}
{{address}} {{state}} {{country}}
sample data in JSON format
{
"name":"John",
"email":"johj@example.com",
"address":"XYZ Street",
"state":"CA",
"country":"USA"
}

Please note that the tokens(merge fields) defined in the template should match the keys in the webhook data.

API Integration

If you want to download the created document along with triggering deliveries you need to append download=true parameter in the URL. A secure file url with 24 hour expiry is provided to download the document.

https://api.docupilot.app/documents/create/{org_unique}/{template_unique}?download=true

If you want to download the created document directly along with triggering deliveries you need to append download=file parameter in the URL. The created document is returned in the API response.

https://api.docupilot.app/documents/create/{org_unique}/{template_unique}?download=file

CURL

curl -X POST \
  https://api.docupilot.app/documents/create/46ac75c3/5e7d03ec \
  -H 'Content-Type: application/json' \
  -d '{
"customer_name":"John",
"customer_email":"john@example.com",
"line_items":[
    {
        "description":"Design",
        "quantity":1,
        "price":"230"
    },
    {
        "description":"Development",
        "quantity":4,
        "price":"130"
    }
]
}'

Python

import requests

url = "https://api.docupilot.app/documents/create/46ac75c3/5e7d03ec"

payload = {
"customer_name":"John",
"customer_email":"john@example.com",
"line_items":[
    {
        "description":"Design",
        "quantity":1,
        "price":"230"
    },
    {
        "description":"Development",
        "quantity":4,
        "price":"130"
    }
]
}
headers = {
    'Content-Type': "application/json"
    }

response = requests.post(url, data=payload, headers=headers)

print(response.text)

API Response

API response with download parameter or no deliveries configured.

{
    "status": "success",
    "data": {
        "file_url": "https://docupilot-documents.s3.amazonaws.com/temp/1a2cadd4-33f7-4f0c-9d9a-3e87803d3e7b/contract.pdf?AWSAccessKeyId=AKIAJTKZBQI56EOPGLFQ&Signature=BHG3mejXO3f1ymBcZVjMB04Sr6U%3D&Expires=1530277229",
        "file_name": "contract.pdf"
    }
}
API response with deliveries configured.

{
    "status": "success",
    "data": null
}

PreviousData Capture FormNextBulk Create

Last updated 9 months ago

Was this helpful?