> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lovable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect your app to Contentstack

> Connect your app to Contentstack, a headless CMS, to deliver published entries and assets or create, update, and publish content from your Lovable app.

[Contentstack](https://www.contentstack.com/) is a headless CMS where editors manage structured content in stacks, separate from the sites and apps that display it. The Contentstack connector lets your Lovable app read published entries and assets from a stack, or create, update, and publish entries.

Contentstack is available as an [app + chat connector](https://docs.lovable.dev/integrations/app-connectors.md): one shared connection that works in [Chats](https://docs.lovable.dev/features/chats.md), in the project chat while you build, and in your published apps.

With Contentstack, your app can:

* Fetch published entries and assets through the Content Delivery API
* Filter and paginate entries by content type, locale, or field values, and include referenced entries
* Read content type schemas and unpublished entries through the Content Management API
* Create, update, publish, and delete entries through the Content Management API

A Content Delivery API connection is read-only. A Content Management API connection can change content in the stack, unless its management token is read-only.

## Common use cases and example apps

These examples show what you can build with Contentstack, each with a prompt to start from.

| Example app | Example prompt | Description |
| :- | :- | :- |
| **Marketing site** | *Use Contentstack and build a marketing site that loads landing pages and navigation from my Contentstack stack.* | **Render marketing pages from content managed in Contentstack.** The app fetches page entries by URL and renders them so editors can update pages without code changes. |
| **Blog or editorial site** | *Use Contentstack and build a blog that lists articles by category and shows each article with its author and images.* | **Build a reading experience driven by Contentstack entries.** The app paginates article entries, filters by category, and includes the referenced author entries and images. |
| **Product catalog** | *Use Contentstack and build a product catalog with category filters from the products in my Contentstack stack.* | **Display product listings editors maintain in Contentstack.** The app fetches product entries, filters them on fields, and links to a detail page for each product. |
| **Multilingual site** | *Use Contentstack and build a site that shows content in the visitor's language using my Contentstack locales.* | **Serve localized content from one stack.** The app requests entries in the visitor's locale and renders the translated fields. |
| **Content submission form** | *Use Contentstack and build a form where my team submits event listings that become entries in Contentstack.* | **Turn form submissions into Contentstack entries.** The app reads the content type schema, creates an entry from each submission, and leaves it unpublished for an editor to review. |
| **Publishing console** | *Use Contentstack and build an internal tool that lists unpublished entries and publishes the ones an editor approves.* | **Manage publishing from your own app.** The app reads entries through the Content Management API and publishes approved entries to the environments and locales you choose. |

## How to connect Contentstack

Who can create Contentstack connections depends on your plan and workspace settings. App + chat connectors are available by default. On Business and Enterprise plans, [Who can create connections and clients](https://docs.lovable.dev/integrations/admin-controls.md#who-can-create-connections-and-clients) starts at **Admins**. Some Enterprise workspaces start at **No one**, which disables the connector. An admin or owner changes it in **Connectors → Admin settings → App + chat connectors**.

Contentstack has two APIs, and you choose one when you add a connection:

* **Content Delivery API**: read-only access to published content, with a delivery token. An environment is a named target that editors publish entries to, such as `production` or `staging`.
* **Content Management API**: access to published and unpublished content with a management token, including writes when the token allows them

You can create multiple Contentstack connections, which is useful for connecting several stacks, separating environments, or using both APIs in one project.

When the connection is created, you can [link it to the projects](https://docs.lovable.dev/integrations/app-connectors.md#link-a-connection-to-a-project) where you want to use it. Anyone building in a project can ask Lovable in the project chat to link their project to it. Linking follows the connection's access rules.

### Prerequisites

Before connecting Contentstack, make sure you have:

* A Contentstack account with access to the stack you want to connect
* The region that hosts your Contentstack organization. The address of the Contentstack app shows it, for example `eu-app.contentstack.com` for AWS Europe.
* For the **Content Delivery API**: the **Owner**, **Admin**, or **Developer** role in the stack, to create a delivery token
* For the **Content Management API**: the **Owner** or **Admin** role in the stack, to create a management token
* Permission to **create connections** in your Lovable workspace (see [Who can create connections and clients](https://docs.lovable.dev/integrations/admin-controls.md#who-can-create-connections-and-clients))

> [!NOTE]
>
> All API requests made through this connector count toward your Contentstack plan. Billing and usage limits are handled directly by Contentstack, not Lovable.

Follow the setup steps below based on which API you need.

> [tab] Content Delivery API (read-only)
>
> The Content Delivery API returns published content from the environments your delivery token can access. Choose this when your app displays Contentstack content.
>
> ### Step 1: Get a Contentstack delivery token
>
> A delivery token lets your Lovable app read the content published to the environments you select for it.
>
> To create a delivery token:
>
> **1. Open your stack**
>
> Sign in to Contentstack at your region's address, for example [app.contentstack.com](https://app.contentstack.com/) for AWS North America, and open the stack you want to connect.
>
> **2. Open tokens**
>
> Click the **Settings** icon, then click **Tokens**.
>
> **3. Create the token**
>
> Click **+ Delivery Token**. Enter a descriptive name, for example `Lovable integration`. Under **Publishing Environments**, select the environments your app reads, including the one you enter in Lovable. Click **Generate Token** and copy the delivery token.
>
> **4. Copy the stack API key**
>
> Click the **Settings** icon and find the stack **API Key** under **API Credentials**. Copy it.
>
> > [!WARNING]
> >
> > Your delivery token functions like a password. Keep it secure and never share it publicly. You'll need it in the next step.
>
> See Contentstack documentation for more: [About delivery tokens](https://www.contentstack.com/docs/developers/create-tokens/about-delivery-tokens).
>
> ### Step 2: Connect the Content Delivery API to Lovable
>
> With the delivery token and the stack API key ready, add the connection in Lovable.
>
> **1. Open Contentstack in Connectors**
>
> Open [Connectors](https://lovable.dev/dashboard?connectors) and select **Contentstack**. For the other places to open the catalog from, see [Where to find connectors](https://docs.lovable.dev/integrations/introduction#where-to-find-connectors).
>
> **2. Add a connection**
>
> Click **Connect** on the connector page. The form is split into collapsible sections, **Details**, **Configure connection**, and **Sharing**.
>
> **3. Name the connection**
>
> Under **Details**, Lovable fills in a name for the connection, which you can change. The name is only used inside Lovable to identify the connection.
>
> **4. Choose Content Delivery API**
>
> Under **Configure connection**, select **Content Delivery API**.
>
> **5. Configure the connection**
>
> Under **Configure connection**, enter:
>
> 1. **Region**: select the region whose Contentstack app address matches yours:
>    * **AWS North America** (default), for `app.contentstack.com`
>    * **AWS Europe**, for `eu-app.contentstack.com`
>    * **AWS Australia**, for `au-app.contentstack.com`
>    * **Azure North America**, for `azure-na-app.contentstack.com`
>    * **Azure Europe**, for `azure-eu-app.contentstack.com`
>    * **GCP North America**, for `gcp-na-app.contentstack.com`
>    * **GCP Europe**, for `gcp-eu-app.contentstack.com`
> 2. **Stack API key**: paste the API key of your stack.
> 3. **Delivery token**: paste the delivery token from Step 1.
> 4. **Environment**: enter the publishing environment your app reads by default, for example `production`. The delivery token must have access to it.
>
> **6. Choose who can use this connection**
>
> Under **Sharing**, the connection is private to you by default and shows a **Private** label. To share it, click **Share with others**. Then add workspace members by email, or click **Invite entire workspace** to make the connection available to everyone in your Lovable workspace.
>
> See [Who can use connections and clients](https://docs.lovable.dev/integrations/admin-controls.md#who-can-use-connections-and-clients) for more information.
>
> **7. Connect**
>
> Click **Connect** at the bottom of the form. Lovable verifies the delivery token against the Contentstack Content Delivery API for the selected region and environment before saving the connection. If Contentstack rejects the details, Lovable shows an error and does not save the connection. Check that the region matches the address of your Contentstack app and that the token can access the environment.

> [tab] Content Management API (read, or read and write)
>
> The Content Management API reads published and unpublished content and, with a read-write management token, creates, updates, and publishes entries. Choose this when your app manages content, not only displays it.
>
> ### Step 1: Get a Contentstack management token
>
> A management token gives your Lovable app access to one stack, with the permissions you choose for the token.
>
> To create a management token:
>
> **1. Open your stack**
>
> Sign in to Contentstack at your region's address, for example [app.contentstack.com](https://app.contentstack.com/) for AWS North America, and open the stack you want to connect.
>
> **2. Open management tokens**
>
> Click the **Settings** icon, click **Tokens**, and open the **Management Tokens** tab.
>
> **3. Create the token**
>
> Click **+ Management Token**. Enter a descriptive name, for example `Lovable integration`. Under **Scope**, choose the branches the token can access, then select its permissions:
>
> * **Read**: your app can read content but cannot create, update, or publish it.
> * **Read** and **Write**: your app can also create, update, publish, and delete entries.
>
> Under **Expiry**, choose **Never** or a date. When the token expires, requests through the connection fail.
>
> **4. Copy the token and the stack API key**
>
> Click **Generate Token**. The confirmation window shows the **Stack API Key** and the **Management Token**. Copy both before you close the window. Contentstack does not show the token again.
>
> To replace an expired token, generate a new one, then open the connection in Connectors. Under **Configure connection**, click **Edit** beside **Management token**, paste the new token, and click **Update**.
>
> > [!WARNING]
> >
> > Your management token functions like a password. Keep it secure and never share it publicly. You'll need it in the next step.
>
> See Contentstack documentation for more: [About management tokens](https://www.contentstack.com/docs/developers/create-tokens/about-management-tokens).
>
> ### Step 2: Connect the Content Management API to Lovable
>
> With the management token and the stack API key ready, add the connection in Lovable.
>
> **1. Open Contentstack in Connectors**
>
> Open [Connectors](https://lovable.dev/dashboard?connectors) and select **Contentstack**. For the other places to open the catalog from, see [Where to find connectors](https://docs.lovable.dev/integrations/introduction#where-to-find-connectors).
>
> **2. Add a connection**
>
> Click **Connect** on the connector page. The form is split into collapsible sections, **Details**, **Configure connection**, and **Sharing**.
>
> **3. Name the connection**
>
> Under **Details**, Lovable fills in a name for the connection, which you can change. The name is only used inside Lovable to identify the connection.
>
> **4. Choose Content Management API**
>
> Under **Configure connection**, select **Content Management API**.
>
> **5. Configure the connection**
>
> Under **Configure connection**, enter:
>
> 1. **Region**: select the region whose Contentstack app address matches yours:
>    * **AWS North America** (default), for `app.contentstack.com`
>    * **AWS Europe**, for `eu-app.contentstack.com`
>    * **AWS Australia**, for `au-app.contentstack.com`
>    * **Azure North America**, for `azure-na-app.contentstack.com`
>    * **Azure Europe**, for `azure-eu-app.contentstack.com`
>    * **GCP North America**, for `gcp-na-app.contentstack.com`
>    * **GCP Europe**, for `gcp-eu-app.contentstack.com`
> 2. **Stack API key**: paste the stack API key from Step 1.
> 3. **Management token**: paste the management token from Step 1.
>
> **6. Choose who can use this connection**
>
> Under **Sharing**, the connection is private to you by default and shows a **Private** label. To share it, click **Share with others**. Then add workspace members by email, or click **Invite entire workspace** to make the connection available to everyone in your Lovable workspace.
>
> See [Who can use connections and clients](https://docs.lovable.dev/integrations/admin-controls.md#who-can-use-connections-and-clients) for more information.
>
> **7. Connect**
>
> Click **Connect** at the bottom of the form. Lovable verifies the management token against the Contentstack Content Management API for the selected region before saving the connection. If Contentstack rejects the details, Lovable shows an error and does not save the connection. Check that the region matches the address of your Contentstack app.

When connected, anyone building in a project can ask Lovable in the project chat to link their project to Contentstack. Linking follows the connection's access rules. Your Lovable apps can then read or manage content in the stack.

## Limitations

The Contentstack connector cannot:

* Create, read, or change webhooks, tokens, stack settings, or users. Set those up in Contentstack.
* Use the GraphQL Content Delivery API or the Live Preview API. To read unpublished content, use a Content Management API connection.
* Use more than one stack or region per connection. Each connection uses the stack API key and region you enter.
* Support per-end-user Contentstack login. Each connection represents a single Contentstack token shared across all projects linked to it.

## Manage your Contentstack connection

Connections are managed from [**Connectors**](https://lovable.dev/dashboard?connectors): select **Contentstack**, then open the connection.

* **Unlink projects** to remove Contentstack access from specific projects while keeping the connection available for others. See [Unlink projects from a connection](https://docs.lovable.dev/integrations/app-connectors.md#unlink-projects-from-a-connection) for the steps.
* **Delete the connection** to remove it from the workspace entirely. Deleting is permanent. It removes the credentials from all linked projects, and app features that use Contentstack stop working until a new connection is added. See [Delete a connection](https://docs.lovable.dev/integrations/app-connectors.md#delete-a-connection) for the steps and who can delete.
