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.
CLI Pro Required: APIs require a CLI Pro token or Platform Plan.
Setup
The following credentials are accepted:
Secrets:
access_token(required) -> Your Contentful Content Delivery API access token
Inputs:
space_id(required) -> Your Contentful Space IDenvironment_id(optional, defaults tomaster) -> The environment to queryanchor_date(optional, defaults to 1 year ago) -> Starting date for first incremental sync (ISO 8601 format)
Getting Your API Credentials
Log in to Contentful
Navigate to Settings β API keys
Click Add API key (or use an existing one)
Copy the Space ID and Content Delivery API - access token
Important: The Content Delivery API token provides read-only access to published content. Keep your token secure and never share it publicly.
Using sling conns
sling connsHere 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
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_dateinput)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], on discord or open a Github Issue here.
Last updated
Was this helpful?