Skip to main content

Start document runs from your own system

The Public API starts a document's run from anywhere that can make an HTTP request, with the rows read from your connected source or sent with the request. Runs are asynchronous, safe to retry with an idempotency key, and report their outcome by polling or by a workspace webhook. The n8n node and the MCP server are built on the same API.

You design the template and set up the document in the app once. After that, the API is how your own system says “generate it now”, for one client or all of them, with the data it already has.

How a call works

  1. 01

    Create a token

    A workspace owner or admin creates an API token in the app. It starts with wsk_, is shown once, and works for that workspace only.

  2. 02

    Start the document's run

    One request starts a run of a document you set up in the app. Rows are read from its connected source, or sent with the request for each data set.

  3. 03

    It returns at once

    The run is queued and processed in the background, one file or a whole split batch.

  4. 04

    Get the outcome

    Poll the run, or register a workspace webhook that posts the result as soon as it is known, with any warnings.

  5. 05

    Files are in Drive

    Each run delivers to the document's Google Drive destinations, with a PDF alongside on single runs if you switched it on.

curl -X POST "https://app.sourcetodocs.com/api/public/v1/documents/$DOCUMENT_ID/runs" \
  -H "Authorization: Bearer $SOURCETODOCS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "idempotency_key": "acme-report-2026-11" }'

Built to be called by machines

  • Idempotency keys. Send the same key twice and you get the first run back instead of a second set of files, so a retry after a timeout never double-sends a client report.
  • Rows inline or from the source. Send the rows your system already holds, mapped by column name to the document’s data sets, or let the run read the connected Airtable base, sheet or CSV.
  • Webhooks for succeeded, failed and partial runs, carrying the run’s warnings.
  • Clear limits: 60 requests a minute per token (a 429 with Retry-After beyond that), and request bodies up to 2 MiB.

Not a programmer? Same API, no code

The n8n node wraps these calls in a configured step with dropdowns for project and document. The MCP server lets an AI agent set up documents and start runs from a conversation. Both use the same Public API and the same token model.

Honest limits

  • The API runs documents; it doesn’t design them. Templates, data sets and destinations are set up in the app or over MCP.
  • Included from the Pro plan up, along with the n8n node. See pricing.
  • Delivery is to Google Drive. Your system gets the run’s file links back; sending them on is up to it.

Related reading