Skip to content

Webhooks & Automation

Connect Glyph to your automation workflows and generate PDFs from any platform that supports HTTP requests. No code required.

With Glyph webhooks, you can automatically generate PDFs when:

  • New form submission - Generate quotes from Typeform, JotForm, or Google Forms
  • CRM deal closed - Create invoices from HubSpot, Salesforce, or Pipedrive
  • Order placed - Generate packing slips from Shopify or WooCommerce
  • Approval workflow - Create contracts when proposals are approved
  • Scheduled reports - Generate weekly/monthly reports on a timer

Zapier

5,000+ app integrations with visual workflow builder

Make.com

Advanced scenarios with data transformation

n8n

Self-hosted automation with full control

Any Platform

Works with any tool that can make HTTP requests

Before you begin, you’ll need:

  1. A Glyph API key - Get one at dashboard.glyph.you
  2. An account on your automation platform (Zapier, Make.com, etc.)

Every Glyph PDF generation follows the same pattern:

1. Preview → 2. Modify (optional) → 3. Generate
  1. POST /v1/preview - Create a session with your template and data

    • Returns a sessionId you’ll use in subsequent steps
  2. POST /v1/modify (optional) - Apply AI-powered customizations

    • Use natural language to style or adjust the document
  3. POST /v1/generate - Convert the session to PDF

    • Returns the PDF file or a download URL

  1. Create a new Zap in your Zapier account

  2. Choose your Trigger (e.g., “New Form Submission in Typeform”)

  3. Add an Action - Search for “Webhooks by Zapier”

  4. Select Custom Request

  5. Configure Step 1: Create Preview

Step 1: Create Preview (Webhooks by Zapier)

Section titled “Step 1: Create Preview (Webhooks by Zapier)”

Configure the HTTP request:

FieldValue
MethodPOST
URLhttps://api.glyph.you/v1/preview
Data Pass-ThroughNo

Headers:

KeyValue
AuthorizationBearer gk_your_api_key
Content-Typeapplication/json

Body:

{
"template": "quote-modern",
"data": {
"client": {
"name": "{{trigger_field_name}}",
"company": "{{trigger_field_company}}",
"email": "{{trigger_field_email}}"
},
"lineItems": [
{
"description": "{{trigger_field_service}}",
"quantity": 1,
"unitPrice": {{trigger_field_price}},
"total": {{trigger_field_price}}
}
],
"totals": {
"subtotal": {{trigger_field_price}},
"total": {{trigger_field_price}}
},
"meta": {
"quoteNumber": "Q-{{zap_meta_id}}",
"date": "{{zap_meta_human_date}}"
}
}
}

Add another Webhooks by Zapier action:

FieldValue
MethodPOST
URLhttps://api.glyph.you/v1/generate

Headers:

KeyValue
AuthorizationBearer gk_your_api_key
Content-Typeapplication/json
Acceptapplication/json

Body:

{
"sessionId": "{{step1_sessionId}}",
"format": "pdf"
}

The response includes a base64-encoded PDF that you can:

  • Send via email (using Gmail, Outlook, etc.)
  • Upload to cloud storage (Google Drive, Dropbox)
  • Add to your CRM as an attachment

Trigger: New submission in Typeform

Actions:

  1. Webhooks by Zapier → POST to /v1/preview
  2. Webhooks by Zapier → POST to /v1/generate
  3. Gmail → Send email with PDF attachment

Make.com (formerly Integromat) offers more advanced data manipulation. Here’s how to set up a scenario.

  1. Create a new Scenario in Make.com

  2. Add your trigger module (e.g., “Watch New Submissions” in Google Forms)

  3. Add an HTTP module → Make a request

Configuration:

FieldValue
URLhttps://api.glyph.you/v1/preview
MethodPOST
Body typeRaw
Content typeJSON (application/json)

Headers:

Add a new header:

  • Name: Authorization
  • Value: Bearer gk_your_api_key

Request content (JSON):

{
"template": "quote-modern",
"data": {
"client": {
"name": "{{1.answers.name}}",
"company": "{{1.answers.company}}",
"email": "{{1.answers.email}}"
},
"lineItems": {{toJSON(1.answers.items)}},
"totals": {
"subtotal": {{1.answers.subtotal}},
"tax": {{1.answers.tax}},
"total": {{1.answers.total}}
},
"meta": {
"quoteNumber": "Q-{{formatDate(now; 'YYYYMMDD')}}-{{1.responseId}}",
"date": "{{formatDate(now; 'MMMM D, YYYY')}}"
}
}
}

Parse response: Yes

Add another HTTP module:

FieldValue
URLhttps://api.glyph.you/v1/generate
MethodPOST
Body typeRaw
Content typeJSON (application/json)

Headers:

  • Authorization: Bearer gk_your_api_key
  • Accept: application/json

Request content:

{
"sessionId": "{{2.data.sessionId}}",
"format": "pdf"
}

Insert an HTTP module between preview and generate:

FieldValue
URLhttps://api.glyph.you/v1/modify
MethodPOST

Request content:

{
"sessionId": "{{2.data.sessionId}}",
"prompt": "Apply professional navy blue styling to the header"
}

For any platform that supports HTTP requests (n8n, Pipedream, Power Automate, custom scripts), here’s the complete API flow.

StepMethodEndpointPurpose
1POSThttps://api.glyph.you/v1/previewCreate session with data
2POSThttps://api.glyph.you/v1/modifyAI modifications (optional)
3POSThttps://api.glyph.you/v1/generateGenerate PDF

All requests must include:

Authorization: Bearer gk_your_api_key
Content-Type: application/json

Request:

Terminal window
curl -X POST https://api.glyph.you/v1/preview \
-H "Authorization: Bearer gk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"template": "quote-modern",
"data": {
"client": {
"name": "Acme Corporation",
"email": "billing@acme.com",
"company": "Acme Corp"
},
"lineItems": [
{
"description": "Consulting Services",
"quantity": 10,
"unitPrice": 150,
"total": 1500
}
],
"totals": {
"subtotal": 1500,
"tax": 120,
"total": 1620
},
"meta": {
"quoteNumber": "Q-2024-001",
"date": "January 22, 2024"
}
}
}'

Response:

{
"html": "<!DOCTYPE html><html>...</html>",
"sessionId": "550e8400-e29b-41d4-a716-446655440000"
}

Request:

Terminal window
curl -X POST https://api.glyph.you/v1/modify \
-H "Authorization: Bearer gk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "550e8400-e29b-41d4-a716-446655440000",
"prompt": "Add a professional watermark with our company name"
}'

Response:

{
"html": "<!DOCTYPE html><html>...</html>",
"changes": ["Added watermark with company name"]
}

Request (returns binary PDF):

Terminal window
curl -X POST https://api.glyph.you/v1/generate \
-H "Authorization: Bearer gk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "550e8400-e29b-41d4-a716-446655440000",
"format": "pdf"
}' \
--output document.pdf

Request (returns JSON with base64):

Terminal window
curl -X POST https://api.glyph.you/v1/generate \
-H "Authorization: Bearer gk_your_api_key" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"sessionId": "550e8400-e29b-41d4-a716-446655440000",
"format": "pdf"
}'

Response:

{
"url": "data:application/pdf;base64,JVBERi0xLjQK...",
"format": "pdf",
"size": 45678
}

Use the HTTP Request node with these settings:

Node 1: Create Preview

  • Method: POST
  • URL: https://api.glyph.you/v1/preview
  • Authentication: Header Auth
    • Name: Authorization
    • Value: Bearer gk_your_api_key
  • Body: JSON with your data

Node 2: Generate PDF

  • Method: POST
  • URL: https://api.glyph.you/v1/generate
  • Body: { "sessionId": "{{ $json.sessionId }}", "format": "pdf" }
// Step 1: Create Preview
const previewResponse = await axios.post(
'https://api.glyph.you/v1/preview',
{
template: 'quote-modern',
data: {
client: steps.trigger.event.data,
lineItems: steps.trigger.event.items,
totals: steps.trigger.event.totals
}
},
{
headers: {
'Authorization': `Bearer ${process.env.GLYPH_API_KEY}`,
'Content-Type': 'application/json'
}
}
);
// Step 2: Generate PDF
const pdfResponse = await axios.post(
'https://api.glyph.you/v1/generate',
{
sessionId: previewResponse.data.sessionId,
format: 'pdf'
},
{
headers: {
'Authorization': `Bearer ${process.env.GLYPH_API_KEY}`,
'Content-Type': 'application/json',
'Accept': 'application/json'
}
}
);
return pdfResponse.data;
  1. Add HTTP action for preview:

    • Method: POST
    • URI: https://api.glyph.you/v1/preview
    • Headers: Authorization: Bearer gk_your_api_key
    • Body: Your JSON data
  2. Add Parse JSON action on the response

  3. Add another HTTP action for generate using the parsed sessionId


Template IDBest For
quote-modernClean, minimal quotes and invoices
quote-professionalTraditional business documents
quote-boldHigh-impact modern designs
{
"client": {
"name": "Required - Client name",
"company": "Optional - Company name",
"email": "Optional - Email address",
"address": "Optional - Mailing address"
},
"lineItems": [
{
"description": "Service or product name",
"details": "Optional - Additional details",
"quantity": 1,
"unitPrice": 100,
"total": 100
}
],
"totals": {
"subtotal": 100,
"discount": 0,
"tax": 8,
"taxRate": 8,
"total": 108
},
"meta": {
"quoteNumber": "Q-2024-001",
"date": "January 22, 2024",
"validUntil": "February 22, 2024",
"notes": "Optional notes"
},
"branding": {
"logoUrl": "https://example.com/logo.png",
"companyName": "Your Company",
"companyAddress": "123 Main St"
}
}

CodeMeaningSolution
401Invalid API keyCheck your Authorization header
400Invalid request dataVerify your JSON structure
404Session not foundSession may have expired (1 hour limit)
429Rate limit exceededWait and retry, or upgrade your plan
500Server errorRetry the request

For automation workflows, implement exponential backoff:

// Pseudocode for retry logic
async function makeRequestWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
const response = await fetch(url, options);
if (response.ok) return response;
if (response.status === 429) {
// Rate limited - wait and retry
await sleep(Math.pow(2, i) * 1000);
continue;
}
throw new Error(`HTTP ${response.status}`);
} catch (error) {
if (i === maxRetries - 1) throw error;
await sleep(Math.pow(2, i) * 1000);
}
}
}

  • Never expose your API key in client-side code or public repositories
  • Use environment variables or secrets management in your automation platform
  • Rotate API keys periodically via the dashboard
  • Sessions expire after 1 hour - Generate PDFs soon after creating the preview
  • Skip the modify step if you don’t need AI customization
  • Cache generated PDFs when possible to avoid regenerating the same document
  • Check the response status code for each request
  • Log errors for debugging
  • Set up alerts in your automation platform for failed workflows

The session has expired (sessions last 1 hour). Solutions:

  • Generate PDF immediately after preview
  • If running batch jobs, create preview and generate in quick succession
  • Verify the key starts with gk_
  • Check for extra spaces in the Authorization header
  • Ensure the key is active in your dashboard
  • Check the html field in the preview response is valid
  • Verify your data doesn’t contain invalid characters
  • Test with minimal data first, then add complexity