Contentful
Read content models and entries, create or update drafts, and publish entries from a Swarmz project
Connect Contentful when a project needs to work with one Contentful space and environment. The AI can inspect the real content model before it builds queries or editing screens, so generated code does not have to guess field names.
Contentful uses a shared project connection. Everyone using the published app acts through the same Contentful identity and environment.
Availability
A Swarmz administrator must show Contentful under Platform config > Integrations. Contentful does not need a Swarmz OAuth app. A workspace member supplies a Content Management API token when they add the connection.
Before you connect
Collect these values from Contentful:
- A personal Content Management API token with
content_management_readfor reads orcontent_management_managefor writes. Contentful explains how to create and scope a token. - The Space ID.
- The Environment ID, such as
masteror a separate staging environment. - The Region:
globaloreu.
Use a dedicated token with the smallest required scope. Contentful grants the token the access of its owner, so do not reuse an unrestricted personal token when a narrower token will work.
Connect Contentful
- In the project, open Settings > Integrations and select Contentful.
- Select Add connection.
- Enter a display name, Space ID, Environment ID, and Region.
- Paste the Content Management API token into API key.
- Select Save connection. Swarmz checks the token against the selected environment before storing it.
The token is encrypted and stays behind the Swarmz connector gateway. It is not written to project files or returned to generated browser code.
Available operations
| Operation | What it does | Limit per minute |
|---|---|---|
list_content_types | Lists content types in the configured environment | 30 |
list_entries | Lists entries, optionally for one content type | 30 |
get_entry | Gets one entry and its current version | 30 |
create_entry | Creates a draft entry with localized fields | 10 |
update_entry | Replaces all fields on an entry using its current version | 10 |
publish_entry | Publishes the current entry version | 10 |
update_entry expects the complete localized fields object. Read the entry first, preserve fields that should remain, then submit the replacement. Contentful rejects an update or publish when another editor has changed the entry version.
Ask the AI to use Contentful
Name the content and the result you want. The AI requests the connection when the task needs live Contentful data.
- “Build a resource library from the
articleentries in Contentful. Read the content type first and use the real field names.” - “Create a draft product announcement in our Contentful staging environment. Do not publish it.”
- “Add a review screen that loads a draft entry, lets an editor change the title, and publishes only after confirmation.”
Generated server routes call the connector gateway. A published site can list or render entries, while an internal editor can create drafts and publish them if the connected token permits it.
Verify Contentful
- Ask the AI to list content types and confirm one known type.
- List entries for that type and open one known entry.
- In a non-production environment, create a draft with a unique test title.
- Read the draft back and compare its localized fields in Contentful.
- Publish only if the test environment allows it, then archive or delete the test entry in Contentful.
Troubleshoot and recover
If setup reports Contentful space configuration rejected, check the space, environment, region, and token access together. A valid token can still fail against an environment it cannot open.
If an update reports a version conflict, read the entry again, merge the intended change with the current fields, and retry with the new version. Do not repeat the stale update unchanged.
To rotate the token, create a replacement in Contentful, open the connection in Settings > Integrations, enter the new token, and select Save changes. Verify a read before revoking the old token. To remove access, select Remove in Swarmz and revoke the token in Contentful.