Tray.ai
Prerequisites
- A PolyDoc account and API key — sign up for free, no credit card required. The free plan includes 150 PDF conversions per month.
- A Tray.ai account — request a demo (enterprise pricing).
Use Case 1: Enterprise PDF Generation Pipeline
Build an enterprise-grade pipeline that generates PDFs from CRM records and delivers them via email or cloud storage.CRM connector (new record) → HTTP Client step (PolyDoc API) → Email connector
Create a new workflow
Log in to the Tray.ai platform and click Create new workflow. Give it a descriptive name (e.g. "CRM Invoice PDF Generator").
/img/guides/tray/tray-uc1-create-workflow.pngAdd a trigger connector
Add a trigger connector. Select your CRM (e.g. Salesforce, HubSpot, or Pipedrive) and configure the trigger operation — for example, New Record or Updated Record. Authenticate and select the object type (e.g. Opportunities, Deals).
/img/guides/tray/tray-uc1-trigger-connector.pngAdd an HTTP Client step for PolyDoc
Add an HTTP Client step and configure:
- URL:
https://api.polydoc.tech/pdf/convert - Method: POST
- Headers:
Authorization=Bearer YOUR_API_KEY(get from the Dashboard),Content-Type=application/json,X-Sandbox=true - Body: JSON using Tray's data mapper to reference CRM fields and populate your PolyDoc template.
/img/guides/tray/tray-uc1-http-client.pngAdd an output connector
Add an output connector — Gmail, Outlook, Amazon S3, or Google Drive. Map the PDF binary from the HTTP Client response as the attachment or file content.
/img/guides/tray/tray-uc1-output-connector.pngEnable the workflow
Click Enable workflow. Create a test record in your CRM to verify the full pipeline — from trigger through PDF generation to email delivery.
Use Case 2: Webhook-Triggered PDF
Accept incoming data via a webhook, generate a PDF, and deliver it — useful for integrations from any system that can POST JSON.Webhook trigger → HTTP Client (PolyDoc API) → Deliver PDF
Add a Webhook trigger
Add a Webhook trigger to a new workflow. Copy the generated endpoint URL — any system that can send an HTTP POST can trigger this workflow.
/img/guides/tray/tray-uc2-webhook-trigger.pngAdd an HTTP Client step for PolyDoc
Add an HTTP Client step configured for PolyDoc. Use the same URL, headers, and authentication as Use Case 1. In the JSON body, map incoming webhook fields to your PolyDoc template.
/img/guides/tray/tray-uc2-http-client.pngAdd a delivery step
Add a delivery step — an email connector, Slack connector, or cloud storage connector — to send or store the generated PDF.
/img/guides/tray/tray-uc2-delivery-step.pngTest with a sample POST request
Send a sample POST request to the webhook URL with test JSON data. Verify that the workflow runs, the PDF generates correctly, and the delivery step completes.