Contentful

Connect & Ingest data from Contentful

Contentful is a headless content management system (CMS) that provides a content infrastructure for digital teams to power websites, apps, and devices. The Sling Contentful connector extracts data from the Contentful Content Delivery API (CDA), supporting content types, entries, assets, locales, and tags.

circle-check

Setup

The following credentials are accepted:

Secrets:

  • access_token (required) -> Your Contentful Content Delivery API access token

Inputs:

  • space_id (required) -> Your Contentful Space ID

  • environment_id (optional, defaults to master) -> The environment to query

  • anchor_date (optional, defaults to 1 year ago) -> Starting date for first incremental sync (ISO 8601 format)

Getting Your API Credentials

  1. Navigate to Settings β†’ API keys

  2. Click Add API key (or use an existing one)

  3. Copy the Space ID and Content Delivery API - access token

circle-exclamation

Using sling conns

Here are examples of setting a connection named CONTENTFUL. We must provide the type=api property:

Environment Variable

See here to learn more about the .env.sling file.

Sling Env File YAML

See here to learn more about the sling env.yaml file.

Replication

Here's an example replication configuration to sync Contentful data to a PostgreSQL database:

Incremental sync for entries and assets:

Endpoints

Endpoint
Description
Incremental
Depends On

content_types

All content type definitions in the space

No

β€”

entries

All published entries across all content types

Yes

β€”

assets

All published assets (images, files, media)

Yes

β€”

locales

All locales configured in the space

No

β€”

tags

All content tags in the space

No

β€”

To discover available endpoints:

Endpoint Details

content_types β€” Returns all content type definitions including field schemas, display field configuration, and revision history. Useful for understanding the content model of your Contentful space.

entries β€” Returns all published entries across all content types with their fields, metadata, and content type association. Supports incremental sync via sys.updatedAt filtering, so subsequent runs only fetch entries modified since the last sync.

assets β€” Returns all published assets including file metadata (URL, dimensions, content type), title, and description. Supports incremental sync via sys.updatedAt filtering.

locales β€” Returns all locales configured in the space, including locale codes, fallback settings, and whether each locale is the default.

tags β€” Returns all content tags defined in the space, which can be used to organize and filter content.

Incremental Sync

The entries and assets endpoints support incremental sync using the sys.updatedAt filter:

  • First run: Fetches all records updated within the configured lookback window (default: 1 year, configurable via anchor_date input)

  • Subsequent runs: Only fetches records updated after the last sync timestamp

All other endpoints (content_types, locales, tags) run in full-refresh mode since they typically contain small amounts of configuration data.

Configuring the Lookback Window

You can customize how far back the first incremental sync reaches by setting the anchor_date input:

Rate Limiting

The Contentful Content Delivery API enforces rate limits:

  • Free plan: 78 requests per second

  • Paid plans: Higher limits

The connector automatically:

  • Uses rate limiting (10 requests/second with concurrency of 3)

  • Retries with exponential backoff on 429 (rate limit) responses

  • Allows up to 5 retry attempts

  • Continues gracefully on 404 responses

Common Use Cases

Sync All Contentful Data

Sync Entries and Assets Incrementally

Extract Content Model Only

If you are facing issues connecting, please reach out to us at [email protected]envelope, on discordarrow-up-right or open a Github Issue herearrow-up-right.

Last updated

Was this helpful?