> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/contentful.md).

# Contentful

Connect to Contentful headless CMS to manage entries, assets, and content types via the Content Management API.

* Knowledge base source

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector                          | Authentication        |
| ---------------------------------- | --------------------- |
| Contentful (Personal Access Token) | Personal Access Token |
| Contentful (OAuth)                 | OAuth sign-in         |

#### Contentful (Personal Access Token)

Connect to Contentful using a Content Management API Personal Access Token. The token grants full access to your Contentful account.

**Set up in Contentful**

1. Sign in to Contentful and open Settings from the main navigation.
2. Select CMA tokens (Personal Access Tokens), then click Create personal access token.
3. Give the token a name and create it, then copy the token immediately; it is shown only once.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Contentful (Personal Access Token)**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field         | Required | What to enter                                                                                                                                                                                |
| --------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Personal Access Token | Yes      | Your Contentful Content Management API Personal Access Token. Grants full access to your Contentful account. [Provider instructions](https://app.contentful.com/account/profile/cma_tokens). |

**Provider documentation:** [Setup reference](https://www.contentful.com/help/token-management/personal-access-tokens/).

#### Contentful (OAuth)

Connect to Contentful using OAuth 2.0. Requires an OAuth application registered in your Contentful account.

**Set up in Contentful**

1. In Contentful, register an OAuth application (Settings then OAuth applications) and note its client credentials and redirect URL if required.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Contentful (OAuth)**.
2. Complete the connector configuration below. If you do not have access to these settings, ask your StackAI administrator to configure the connector.
3. Select **Connect**, sign in to the provider account, and review the requested access. Complete authorization to return to StackAI.
4. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connector configuration**

| StackAI field | Required  | What to enter                                                                                                                                                                                                                          |
| ------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OAuth Scopes  | Read-only | OAuth scopes for Contentful Content Management API access. Use 'content\_management\_manage' for full access or 'content\_management\_read' for read-only access. This value is shown for reference; it is not an editable credential. |
| Client ID     | Yes       | OAuth 2.0 Client ID from your Contentful OAuth application. Create one under Account Settings > OAuth applications. [Provider instructions](https://app.contentful.com/account/profile/developers/applications).                       |
| Client Secret | Yes       | OAuth 2.0 Client Secret from your Contentful OAuth application.                                                                                                                                                                        |
| Redirect URI  | Read-only | Use this redirect URI when configuring your OAuth application. This value is shown for reference; it is not an editable credential.                                                                                                    |

**Provider documentation:** [Setup reference](https://www.contentful.com/developers/docs/extensibility/oauth/).

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **Contentful** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### Search Entries

Search and list entries in a Contentful space.

**Inputs**

| Field        | Type            | Required | Description                                                                                         |
| ------------ | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space        | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment  | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Content Type | select (string) | No       | Optional content type to filter entries by. Options load from the selected connection.              |
| Search Query | string          | No       | Optional full-text search across all entry fields.                                                  |
| Order        | string          | No       | Field to order results by. Prefix with '-' for descending.                                          |
| Limit        | integer         | No       | Maximum entries to return (max 1000). Default: 100.                                                 |
| Skip         | integer         | No       | Number of entries to skip for pagination. Default: 0.                                               |

**Outputs**

| Field   | Type          | Description                                 |
| ------- | ------------- | ------------------------------------------- |
| Entries | object\_array | The returned entries.                       |
| Total   | integer       | Total number of entries matching the query. |

#### Get Entry

Get a single entry from Contentful by its ID.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Entry ID    | string          | Yes      | The ID of the entry to retrieve.                                                                    |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Entry             | object  | The requested entry.                                                     |
| Entry ID          | string  | The ID of the entry.                                                     |
| Version           | integer | Current version number of the entry.                                     |
| Published Version | integer | Version at which the entry was last published, or null if not published. |
| Is Published      | boolean | Whether the entry is currently published.                                |

#### Create Entry

Create a new draft entry in Contentful.

**Inputs**

| Field        | Type            | Required | Description                                                                                         |
| ------------ | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space        | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment  | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Content Type | select (string) | Yes      | The content type (model) for the entry. Options load from the selected connection.                  |
| Fields       | object          | Yes      | Entry fields as a JSON object. Each field value must be keyed by locale (for example 'en-US').      |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Entry             | object  | The created entry.                                                       |
| Entry ID          | string  | The ID of the created entry.                                             |
| Version           | integer | Current version number of the entry.                                     |
| Published Version | integer | Version at which the entry was last published, or null if not published. |
| Is Published      | boolean | Whether the entry is currently published.                                |

#### Update Entry

Update an existing Contentful entry.

**Inputs**

| Field              | Type            | Required | Description                                                                                                                                                                            |
| ------------------ | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Space              | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                                                                                                                  |
| Environment        | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master.                                                                                    |
| Entry ID           | string          | Yes      | The ID of the entry to update.                                                                                                                                                         |
| Fields             | object          | Yes      | Fields to update as a JSON object. Each field value must be keyed by locale (for example 'en-US'). By default, only the fields you provide are changed; existing fields are preserved. |
| Replace All Fields | boolean         | No       | If true, overwrite the entry with exactly the fields provided. Any existing fields not in the payload are dropped. Default: false.                                                     |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Entry             | object  | The updated entry.                                                       |
| Entry ID          | string  | The ID of the entry.                                                     |
| Version           | integer | Current version number of the entry.                                     |
| Published Version | integer | Version at which the entry was last published, or null if not published. |
| Is Published      | boolean | Whether the entry is currently published.                                |

#### Publish Entry

Publish a Contentful entry to make it live.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Entry ID    | string          | Yes      | The ID of the entry to publish.                                                                     |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Entry             | object  | The published entry.                                                     |
| Entry ID          | string  | The ID of the entry.                                                     |
| Version           | integer | Current version number of the entry.                                     |
| Published Version | integer | Version at which the entry was last published, or null if not published. |
| Is Published      | boolean | Whether the entry is currently published.                                |

#### Delete Entry

Delete a Contentful entry. Published entries are unpublished first.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Entry ID    | string          | Yes      | The ID of the entry to delete.                                                                      |

**Outputs**

| Field    | Type   | Description                  |
| -------- | ------ | ---------------------------- |
| Entry ID | string | The ID of the deleted entry. |
| Message  | string | Confirmation message.        |

#### List Content Types

List content type schemas for a Contentful space.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Limit       | number          | No       | Maximum content types to return (max 1000). Default: 100.                                           |
| Skip        | number          | No       | Number of content types to skip for pagination. Default: 0.                                         |

**Outputs**

| Field         | Type          | Description                                             |
| ------------- | ------------- | ------------------------------------------------------- |
| Content Types | object\_array | The content types defined in the space and environment. |
| Total         | integer       | Total number of content types in the environment.       |

#### Get Content Type

Get the schema definition of a single content type.

**Inputs**

| Field        | Type            | Required | Description                                                                                         |
| ------------ | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space        | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment  | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Content Type | select (string) | Yes      | The content type (model) for the entry. Options load from the selected connection.                  |

**Outputs**

| Field           | Type   | Description                 |
| --------------- | ------ | --------------------------- |
| Content Type    | object | The content type schema.    |
| Content Type ID | string | The ID of the content type. |

#### Search Assets

Search and list assets (images, files, media) in a Contentful space.

**Inputs**

| Field           | Type            | Required | Description                                                                                                                                                 |
| --------------- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Space           | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                                                                                       |
| Environment     | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master.                                                         |
| Search Query    | string          | No       | Optional full-text search across asset fields.                                                                                                              |
| MIME Type Group | string          | No       | Optional filter by MIME type group (e.g. 'image', 'video', 'audio', 'richtext', 'presentation', 'spreadsheet', 'pdfdocument', 'archive', 'code', 'markup'). |
| Order           | string          | No       | Field to order results by. Prefix with '-' for descending.                                                                                                  |
| Limit           | number          | No       | Maximum assets to return (max 1000). Default: 100.                                                                                                          |
| Skip            | number          | No       | Number of assets to skip for pagination. Default: 0.                                                                                                        |

**Outputs**

| Field  | Type          | Description                                |
| ------ | ------------- | ------------------------------------------ |
| Assets | object\_array | The returned assets.                       |
| Total  | integer       | Total number of assets matching the query. |

#### Upload Asset

Upload a file to Contentful from a public URL. Contentful downloads the file, processes it, and optionally publishes it.

**Inputs**

| Field                        | Type            | Required | Description                                                                                                                                                      |
| ---------------------------- | --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Space                        | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                                                                                            |
| Environment                  | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master.                                                              |
| Title                        | string          | Yes      | Title displayed for the asset.                                                                                                                                   |
| File URL                     | string          | Yes      | Public URL that Contentful will download the file from.                                                                                                          |
| MIME Type                    | string          | Yes      | The MIME type of the file (e.g. image/jpeg, application/pdf).                                                                                                    |
| File Name                    | string          | No       | File name to store in Contentful. Defaults to the URL's last segment.                                                                                            |
| Description                  | string          | No       | Optional description of the asset.                                                                                                                               |
| Locale                       | string          | No       | Locale code for the asset fields. Defaults to the environment's default locale.                                                                                  |
| Publish Immediately          | boolean         | No       | Publish the asset after processing completes. Default: false.                                                                                                    |
| Processing Timeout (seconds) | integer         | No       | How long to wait for Contentful to finish processing the uploaded file (default: 120s, max: 600s). Large videos or images may need a higher value. Default: 120. |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Asset             | object  | The uploaded asset.                                                      |
| Asset ID          | string  | The ID of the uploaded asset.                                            |
| Version           | integer | Current version number of the asset.                                     |
| Published Version | integer | Version at which the asset was last published, or null if not published. |
| Is Published      | boolean | Whether the asset is currently published.                                |

#### Get Asset

Get a single asset from Contentful by its ID.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Asset ID    | string          | Yes      | The ID of the asset to retrieve.                                                                    |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Asset             | object  | The requested asset.                                                     |
| Asset ID          | string  | The ID of the asset.                                                     |
| Version           | integer | Current version number of the asset.                                     |
| Published Version | integer | Version at which the asset was last published, or null if not published. |
| Is Published      | boolean | Whether the asset is currently published.                                |

#### Publish Asset

Publish a Contentful asset to make it live.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Asset ID    | string          | Yes      | The ID of the asset to publish.                                                                     |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Asset             | object  | The published asset.                                                     |
| Asset ID          | string  | The ID of the asset.                                                     |
| Version           | integer | Current version number of the asset.                                     |
| Published Version | integer | Version at which the asset was last published, or null if not published. |
| Is Published      | boolean | Whether the asset is currently published.                                |

#### Unpublish Asset

Unpublish a Contentful asset so it is no longer live.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Asset ID    | string          | Yes      | The ID of the asset to unpublish.                                                                   |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Asset             | object  | The unpublished asset.                                                   |
| Asset ID          | string  | The ID of the asset.                                                     |
| Version           | integer | Current version number of the asset.                                     |
| Published Version | integer | Version at which the asset was last published, or null if not published. |
| Is Published      | boolean | Whether the asset is currently published.                                |

#### Delete Asset

Delete a Contentful asset. Published assets are unpublished first.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Asset ID    | string          | Yes      | The ID of the asset to delete.                                                                      |

**Outputs**

| Field    | Type   | Description                  |
| -------- | ------ | ---------------------------- |
| Asset ID | string | The ID of the deleted asset. |
| Message  | string | Confirmation message.        |

#### Unpublish Entry

Unpublish a Contentful entry so it is no longer live.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Entry ID    | string          | Yes      | The ID of the entry to unpublish.                                                                   |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Entry             | object  | The unpublished entry.                                                   |
| Entry ID          | string  | The ID of the entry.                                                     |
| Version           | integer | Current version number of the entry.                                     |
| Published Version | integer | Version at which the entry was last published, or null if not published. |
| Is Published      | boolean | Whether the entry is currently published.                                |

#### Archive Entry

Archive a Contentful entry so it is hidden from standard listings.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Entry ID    | string          | Yes      | The ID of the entry to archive.                                                                     |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Entry             | object  | The archived entry.                                                      |
| Entry ID          | string  | The ID of the entry.                                                     |
| Version           | integer | Current version number of the entry.                                     |
| Published Version | integer | Version at which the entry was last published, or null if not published. |
| Is Published      | boolean | Whether the entry is currently published.                                |

#### Unarchive Entry

Unarchive a Contentful entry so it reappears in listings.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |
| Entry ID    | string          | Yes      | The ID of the entry to unarchive.                                                                   |

**Outputs**

| Field             | Type    | Description                                                              |
| ----------------- | ------- | ------------------------------------------------------------------------ |
| Entry             | object  | The unarchived entry.                                                    |
| Entry ID          | string  | The ID of the entry.                                                     |
| Version           | integer | Current version number of the entry.                                     |
| Published Version | integer | Version at which the entry was last published, or null if not published. |
| Is Published      | boolean | Whether the entry is currently published.                                |

#### List Spaces

List every Contentful space the connection has access to.

**Inputs**

No input fields are required in this catalog entry.

**Outputs**

| Field  | Type          | Description                                   |
| ------ | ------------- | --------------------------------------------- |
| Spaces | object\_array | The spaces the authenticated user can access. |
| Total  | integer       | Total number of spaces the token can access.  |

#### List Environments

List every environment defined in a Contentful space.

**Inputs**

| Field | Type            | Required | Description                                                           |
| ----- | --------------- | -------- | --------------------------------------------------------------------- |
| Space | select (string) | Yes      | Select a Contentful space. Options load from the selected connection. |
| Limit | number          | No       | Maximum environments to return (max 1000). Default: 100.              |
| Skip  | number          | No       | Number of environments to skip for pagination. Default: 0.            |

**Outputs**

| Field        | Type          | Description                                |
| ------------ | ------------- | ------------------------------------------ |
| Environments | object\_array | The environments defined in the space.     |
| Total        | integer       | Total number of environments in the space. |

#### List Locales

List locales configured in a Contentful environment.

**Inputs**

| Field       | Type            | Required | Description                                                                                         |
| ----------- | --------------- | -------- | --------------------------------------------------------------------------------------------------- |
| Space       | select (string) | Yes      | Select a Contentful space. Options load from the selected connection.                               |
| Environment | select (string) | Yes      | Select an environment within the space. Options load from the selected connection. Default: master. |

**Outputs**

| Field          | Type          | Description                                   |
| -------------- | ------------- | --------------------------------------------- |
| Locales        | object\_array | Locales defined in the environment.           |
| Default Locale | string        | The code of the environment's default locale. |

### Important behavior

If an operation is denied, check the connection’s granted permissions and the account’s access in the provider. Reauthorize the connection when it needs additional permissions.

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/contentful.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
