Contentful integration

Generate PDFs from Contentful

Connect Quaterio to your Contentful space, bind entries to block-based templates and render paginated PDFs at generation time. One Content Delivery token covers every entry the key can read.

The problem

Contentful is built for content reuse across web, mobile and email. PDF is the one channel it does not output. Teams end up duplicating content into Google Docs, exporting to PDF and fighting drift between what Contentful says and what the rendered document shows. Custom PDF pipelines burn engineering time and break every time the content model changes.

How Quaterio handles it

Quaterio's Contentful connector reads cdn.contentful.com with your CDA token and drops entry fields into a block-based template. Detect Fields walks the response so you can pick paths without reading API docs. Linked entries and assets resolve through the includes block. Multi-locale spaces and EU data residency are both supported by swapping the URL.

How it works

  1. 1

    Pick the Contentful preset in Connections

    Settings → Connections → New Connection → pick "Contentful" from the type dropdown. The URL, auth type and response field defaults are filled in. Replace YOUR_SPACE_ID with your real space ID.

  2. 2

    Paste your Content Delivery token

    In the Contentful web app, go to Settings → API keys and copy the Content Delivery API token from your API key. Paste it into the Token field on the Quaterio connection. Read-only, scoped to one space, safe to use.

  3. 3

    Hit Detect Fields to confirm the shape

    Quaterio fetches the entries endpoint with your CDA token and shows you the actual JSON paths available, including linked entries through the includes block. Pick the field you want to render (default is items.0.fields.body for the first entry body).

  4. 4

    Generate the PDF via the editor or API

    Export from the editor for one-offs. For batch jobs or scheduled exports, hit POST /api/v1/generate/template with the template ID. The connector re-fetches at generation time so every PDF reflects the latest Contentful content.

What the connector handles

  • Content Delivery API (cdn.contentful.com) via bearer token auth
  • Published-content reads with global CDN caching, the right API for PDF output
  • Multi-environment support: switch master for staging or any environment alias on the URL
  • EU data residency by changing the host to cdn.eu.contentful.com
  • Linked entries and assets resolved up to 10 include levels
  • Multi-locale: one connection per locale or all-locales mode with per-path overrides
  • Detect Fields button walks the JSON so you can pick paths in the editor
  • 15 second fetch timeout, cached on the block when the API is slow or unreachable
  • Refresh on demand from the editor, or via API before batch generation
  • Honest about Rich Text: returned as JSON tree, not HTML. Use Markdown fields for prose

Generate via API

# 1. Create the connection via the dashboard (one-time setup). # 2. Bind a template's Remote Content block to it. # 3. Generate a PDF that pulls live Contentful content: curl -X POST https://quaterio.com/api/v1/generate/template \ -H "Authorization: Bearer q_your_token" \ -H "Content-Type: application/json" \ -d '{ "templateId": "contentful_blog_export" }' # → { # "ok": true, # "data": { "downloadUrl": ".../blog-export_en_a7f3b2c1.pdf" } # } # The connector hits cdn.contentful.com at generation time # and renders the bound entry field into the template block.

Available on Business plan and above.

Contentful and PDF: the real questions

The Contentful preset queries the Content Delivery API (cdn.contentful.com) with your Content Delivery Token. Entries flow into Quaterio templates as JSON, with assets and linked entries resolved through the includes block. The sections below cover what the connector handles, what it does not, and the Rich Text question every team asks first.

Finding your Space ID and CDA token

Open your Contentful web app, pick the space you want to read from and go to Settings → API keys. Each API key listed there shows a Space ID and a Content Delivery API token. The Space ID goes into the URL (cdn.contentful.com/spaces/YOUR_SPACE_ID/environments/master/entries) and the CDA token goes into the Token field on the Quaterio connection.

The CDA token is read-only and scoped to one space. It is safe to paste into Quaterio. Do not paste the Content Management token by mistake, it is far more powerful, and the CDA host does not accept it anyway.

Why this uses the Content Delivery API, not Management or Preview

Three different APIs front Contentful. The CDA (cdn.contentful.com) serves published content from a global CDN. The Preview API (preview.contentful.com) serves draft content with a different token. The Management API (api.contentful.com) handles writes. Quaterio uses the CDA because PDF generation reads published content, and the CDA is cached, fast and rate-limited generously.

If you need to render drafts (review previews, editorial proofs), switch the URL host to preview.contentful.com and use a Content Preview API token instead. The request shape is identical. Quaterio does not offer this as a separate preset because draft rendering is an edge case for PDF output.

Rich Text fields come back as a JSON tree, not HTML

This is the biggest Contentful gotcha. Rich Text fields are not returned as HTML by the API. They come back as a JSON document tree with nodeType, content and marks nodes. If you bind a Rich Text field straight to a Remote Content block, your PDF will show JSON, not formatted prose.

Two workable paths today. First, model your long-form copy as a Long Text (Markdown) field instead of Rich Text. Markdown text is returned as a plain string and Quaterio renders Markdown into HTML at PDF generation time. Second, render the Rich Text JSON to HTML in your own service and store the HTML as a separate field. Native Rich Text JSON to HTML conversion inside the Quaterio connector is on the roadmap but not first-party today.

Linked entries and assets through the includes block

Contentful does not embed linked entries or assets inside the items array. They land in a separate includes block at the top level of the response (includes.Entry, includes.Asset). The default include depth is 1 level; the maximum is 10 (use ?include=N on the URL to override).

For single-field bindings this rarely matters: the default Response Field items.0.fields.body returns the field value of the first entry. For richer layouts where you need a hero image plus body plus author bio, you bind multiple Remote Content blocks to the same connection and point each one at the right path. The Detect Fields button walks the response so you can pick paths without reading API docs.

Locales and localized fields

Contentful entries can be localized per field. By default the CDA returns the default locale only (commonly en-US). To fetch a specific locale, add ?locale=sv-SE (or your locale code) to the URL. To return every locale at once, use ?locale=*; field values then become objects keyed by locale rather than scalars, and the response field path needs to include the locale (items.0.fields.body.sv-SE).

For multi-language PDF generation Quaterio supports both patterns. One connection per locale is the easiest setup. If you only need one extra locale occasionally, the all-locales request plus per-block path overrides works without creating duplicate connections.

Rate limits, caching and EU data residency

The CDA enforces 55 requests per second per access token. PDF generation runs one connector fetch per generated PDF, so 100 batch rows mean up to 100 requests. The Quaterio default batch concurrency is 5; we recommend leaving it there because the CDA cache amortizes the cost and Contentful is rarely the bottleneck.

If your space is hosted in the Contentful EU data residency region, the API host is cdn.eu.contentful.com (not cdn.contentful.com). Edit the URL on the connection accordingly. Token format and request shape are identical; only the host changes.

Environment switching (production, staging, ephemeral)

The default preset URL points at environments/master, which is the production-equivalent environment in a fresh Contentful space. Teams using staging or ephemeral environments swap master for the environment alias or environment ID (e.g. environments/staging or environments/release-2026-06).

The CDA token is scoped to the API key, not to the environment. The same token works across environments your API key has access to. If you need separate access controls per environment, create separate API keys and separate Quaterio connections.

Pricing and plan tier

CMS connections are part of the Business plan and above ($30/mo). Pro plans get the editor and basic templates but not the Remote Content block. Free and Pro users who try to add a Remote Content block see an upgrade prompt.

You pay Contentful for their workspace separately. The Contentful free Community plan (1 space, 2 locales) is enough to evaluate the Quaterio integration end to end. There is no extra per-API-call cost from Quaterio; the CDA is generous enough that PDF generation almost never hits the rate limit in practice.

Try the Contentful connector free

Set up the connection in two minutes. No credit card required to start.