--- title: "API and Pipelines" slug: "xl-docs-api-and-pipelines" updated: 2026-10-09T18:09:08Z published: 2026-10-09T18:09:08Z canonical: "help.quickbase.com/xl-docs-api-and-pipelines" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.quickbase.com/llms.txt > Use this file to discover all available pages before exploring further. # API and Pipelines XL Docs has an API endpoint for callers with no browser window, such as Quickbase Pipelines or your own integrations. It takes the same parameters as a button, creates the document the same way, and returns either the file itself or a JSON result. | **Action** | **Request** | | --- | --- | | Generate a document | *POST https://.../api/generate* | Replace *https://...* with your designated XL Docs server URL, created by the installation wizard. ## Parameters Send the parameters in the query string, joined with *&*, exactly as in a button formula. See [Formula URL parameters](https://help.quickbase.com/quickbase-extensions/docs/en/xl-docs-url-parameters). The request body isn't read—don't send the parameters as JSON or as form fields. As an alternative, Base64-encode the whole parameter string and send it as a single *request* parameter: *?request=*. - The required parameters are the same as for a button: **clientid**, **appid**, **dbid**, **tpdbid**, **tpid**, **fn**, and exactly one of **msid** or **msqry**. To find your Client ID and the app, table, and field IDs, see [Find your Client ID, table IDs, and field IDs](https://help.quickbase.com/quickbase-extensions/docs/en/find-client-id-table-ids-field-ids). - Add **stream=y** to get the file back in the response. Without it, the document is only saved to the storage you specify (for example **faid**, a repository table, Amazon S3, or Dropbox). See [Output and storage](https://help.quickbase.com/quickbase-extensions/docs/en/xl-docs-output-and-storage). - With **msqry**, an API request creates up to 50 documents by default; your account's limit may differ. Use [batch processing](https://help.quickbase.com/quickbase-extensions/docs/en/xl-docs-batch-processing) for more. - **preqbaction** isn't run by the API. If you need to update the record first, do it in an earlier step (for example a Quickbase Pipelines **Update Record** step) before you call XL Docs. ## Authentication If your account uses Quickbase enhanced security, send a Quickbase user token in the *Authorization* header, in the same format as the Quickbase REST API: ``` Authorization: QB-USER-TOKEN ``` The token is used to confirm that its user has access to the record (or the records matched by **msqry**). Use a token for a user with access to the master table and to the fields and tables the document is saved to. See [Enhanced security overview](https://help.quickbase.com/quickbase-extensions/docs/en/enhanced-security-overview). If your app requires application tokens, also pass **apptoken** in the query string. ## Response The API always answers with HTTP 200—even when the request fails—so check the response body, not the status code. | **Request** | **Response** | | --- | --- | | Succeeded, with **stream=y** and one document (**msid**, or **msqry** with **sameworkbook=y**) | The file itself, with its file name as the download name. The content type matches the format: *application/pdf* for PDF (sent directly—there's no browser preview step), *text/csv* for CSV, *application/vnd.openxmlformats-officedocument.spreadsheetml.sheet* for *.xlsx*, *application/vnd.ms-excel* for *.xls*, and *application/vnd.ms-excel.sheet.macroEnabled.12* for *.xlsm*. | | Succeeded, without a file to stream | JSON: *{ "success": true, "errors": [] }* | | Failed | JSON: *{ "success": false, "errors": [ "" ] }* | - **success**—*true* if the document was created and saved. Use this to decide whether the request worked. - **errors**—the reason the request failed. Missing or malformed parameters return *Invalid parameters.* Other failures return the same message a button would show, for example: ``` { "success": false, "errors": ["The template record was not found. Please make sure that the tpid parameter field is correct."] } ``` When you ask for a file, tell a file from an error by the content type: JSON means the request failed. Messages are listed in [XL Docs messages and troubleshooting](https://help.quickbase.com/quickbase-extensions/docs/en/xl-docs-messages). ## Examples Create a PDF from template 2 for record 42 and save it in file attachment field 51: ``` curl -X POST "https://.../api/generate?clientid=Q#&appid=&dbid=&msid=42&tpdbid=&tpid=2&fn=Invoice&docfmt=pdf&faid=51" \  -H "Authorization: QB-USER-TOKEN " ``` Create the same PDF and download it to a local file: ``` curl -X POST "https://.../api/generate?clientid=Q#&appid=&dbid=
&msid=42&tpdbid=&tpid=2&fn=Invoice&docfmt=pdf&stream=y" \  -H "Authorization: QB-USER-TOKEN " \  -o Invoice_42.pdf ``` Create a CSV export of record 42 and download it: ``` curl -X POST "https://.../api/generate?clientid=Q#&appid=&dbid=
&msid=42&tpdbid=&tpid=5&fn=Export&fnrid=N&docfmt=csv&stream=y" \  -H "Authorization: QB-USER-TOKEN " \  -o Export.csv ``` Create one workbook with a tab for every record whose field 10 is *Active*, and download it (the query is URL-encoded): ``` curl -X POST "https://.../api/generate?clientid=Q#&appid=&dbid=
&msqry=%7B'10'.EX.'Active'%7D&sameworkbook=y&tpdbid=&tpid=5&fn=Active_Records&fnrid=N&docfmt=xlsx&stream=y" \  -H "Authorization: QB-USER-TOKEN " \  -o Active_Records.xlsx ``` Create a document for each related record and save each one on its record (no file in the response): ``` curl -X POST "https://.../api/generate?clientid=Q#&appid=&dbid=
&msqry=%7B'6'.EX.'7'%7D&tpdbid=&tpid=36&fn=Expenses&docfmt=xlsx&faid=62&xlddte=63" \  -H "Authorization: QB-USER-TOKEN " ``` ## Use in Quickbase Pipelines Pipelines usually work best when XL Docs saves the document to Quickbase (or cloud storage) and returns a JSON result, so leave **stream** out. 1. Add a step that sends an HTTP request—for example, the **Webhooks** channel's **Make Request** step. 2. Set the method to **POST** and the URL to the endpoint with your parameters. Use data from earlier steps for values such as the Record ID#—for example, *msid={{a.id}}*. 3. Add the header *Authorization* with the value *QB-USER-TOKEN* followed by your user token. 4. Leave the request body empty—parameters go in the URL. 5. Optionally, add a condition after the request that checks the response's **success** value, and log or notify on anything in **errors**. ## Differences from a button - No progress window or error page—results come back in the response. - A streamed PDF is returned directly as the file, not opened in a browser preview. - The user token in the *Authorization* header takes the place of the temporary token a button sends. - **preqbaction** isn't run. Questions? Submit a [technical support case](https://help.quickbase.com/docs/get-help-from-quickbase-technical-support).