API: Generate Doc without Airtable

No need to implement flow in Typeflow to use this API route. You just need to send a JSON to our API route and we will process the data to generate PDFs.

`POST:https://app.typeflow.us/api/create-pdf`

Authorization

Authorization: string

Bearer authentication header of the form Bearer <token>.

Body

gdoc_id (required): The ID of the Google Docs document

document_name (optional): Name of the document

variables object(optional):

{{variable_one}} (optional): Value for example template variable/placeholder '{{variable_one}}'

{{variable_two}} (optional): Value for example template variable/placeholder '{{variable_two}}'

line_items object (optional):

loop_0 (optional): Value to detect there is a line items.

Exemple:
   "loop_0": {
            "{{start}}": [
                {
                    "value": "Data"
                },
                {
                    "value": "test"
                }
            ],
            "{{description}}": [
                {
                    "value": "oki dac"
                },
                {
                    "value": "oki doki"
                }
            ],
            "{{duration}}": [
                {
                    "value": "hum"
                },
                {
                    "value": "hum hum"
                }
            ],
            "{{aspect}}": [
                {
                    "value": "hum"
                },
                {
                    "value": "hum hum"
                }
            ]
        }

Example of body:

{
    "gdoc_id": "1...ks",
    "variables": {
        "{{trip}}": "Jean Dupont",
        "{{start_date}}": "jean@example.com",
        "{{end_date}}": "16/07/2025",
        "{{people}}": [
            "people 1",
            "people 2"
        ],
        "{{ duration}}": "15 days"
    },
    "line_items": {
        "loop_0": {
            "{{start}}": [
                {
                    "value": "Data"
                },
                {
                    "value": "test"
                }
            ],
            "{{description}}": [
                {
                    "value": "oki dac"
                },
                {
                    "value": "oki doki"
                }
            ],
            "{{duration}}": [
                {
                    "value": "hum"
                },
                {
                    "value": "hum hum"
                }
            ],
            "{{aspect}}": [
                {
                    "value": "hum"
                },
                {
                    "value": "hum hum"
                }
            ]
        }
    }
}
Was this helpful?