API Overview
The Glyph API provides programmatic access to document generation and AI-powered customization. Use it to build custom integrations, automate document workflows, or create your own editor experiences.
Quick Reference: Which Endpoint Should I Use?
Section titled “Quick Reference: Which Endpoint Should I Use?”| Endpoint | Input | Returns | Use Case |
|---|---|---|---|
/v1/create | data, html, or url | JSON with hosted URL + metadata | Recommended for integrations (Airtable, Zapier, n8n) |
/v1/generate | html + optional sessionId | Binary PDF/PNG stream | Low-level, for streaming or direct file download |
/v1/preview + /v1/modify + /v1/generate | template + data | Binary PDF | Interactive editing flow with AI modifications |
Base URL
Section titled “Base URL”https://api.glyph.youFor self-hosted deployments, use your own domain.
API Version
Section titled “API Version”The current API version is v1. All endpoints are prefixed with /v1/.
Authentication
Section titled “Authentication”All API requests require authentication via API key:
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": {...}}'See Authentication for details.
Core Endpoints
Section titled “Core Endpoints”| Endpoint | Description |
|---|---|
POST /v1/create | One-call PDF generation: Send data, HTML, or URL - get PDF with hosted URL |
POST /v1/preview | Render template with data, get HTML and session ID |
POST /v1/modify | Apply AI modifications to a session |
POST /v1/generate | Generate PDF or PNG from HTML (returns binary stream) |
POST /v1/batch/generate | Generate up to 10 PDFs in one request |
GET /v1/templates | List available templates with schemas |
POST /v1/airtable/connect | Connect Airtable and fetch records for PDFs |
POST /v1/auth/signup | Self-service signup, get a free API key |
Typical Workflow
Section titled “Typical Workflow”| Step | Request | Response |
|---|---|---|
| 1. Preview | Client → POST /v1/preview (template + data) → API | API → HTML + sessionId → Client |
| 2. Modify | Client → POST /v1/modify (sessionId + prompt) → API → Claude AI | Claude AI → Modified HTML → API → New HTML + changes → Client |
| 3. Generate | Client → POST /v1/generate (sessionId) → API | API → PDF file → Client |
Request Format
Section titled “Request Format”All POST requests accept JSON:
{ "template": "quote-modern", "data": { "client": { "name": "John Smith" }, "lineItems": [...], "totals": { "subtotal": 1000, "total": 1000 } }}Response Format
Section titled “Response Format”Successful responses return JSON:
{ "html": "<html>...</html>", "sessionId": "550e8400-e29b-41d4-a716-446655440000"}Error responses include an error code:
{ "error": "Validation failed", "code": "VALIDATION_ERROR", "details": [...]}Rate Limiting
Section titled “Rate Limiting”All endpoints are rate-limited based on your tier:
| Tier | Requests/Minute |
|---|---|
| Free | 10 |
| Pro | 60 |
| Scale | 120 |
| Enterprise | 300 |
See Rate Limits for details.
Health Check
Section titled “Health Check”Check API availability:
curl https://api.glyph.you/healthResponse:
{ "status": "ok", "version": "0.49.0", "timestamp": "2026-02-07T12:00:00.000Z"}While you can use the API directly, we provide SDKs for easier integration:
- JavaScript/TypeScript:
@glyphpdf/sdk- Includes the<glyph-editor>web component - Python: Interested? Let us know at hello@glyph.you
- Ruby: Interested? Let us know at hello@glyph.you
Next Steps
Section titled “Next Steps”- POST /v1/create - Recommended: One-call PDF generation with hosted URL
- Self-Service Auth - Sign up and get an API key programmatically
- Authentication - API key usage and security
- POST /v1/preview - Generate document previews (for interactive editing)
- POST /v1/modify - AI-powered modifications
- POST /v1/generate - Low-level PDF generation (binary stream)
- Airtable API - Connect Airtable bases and generate PDFs from records
- Templates API - Browse and create templates