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

# Using Contentful in Agents

After connecting your Contentful account, the following actions become available as Agent steps. Each step requires you to select a connected **Contentful Account** from a dropdown.

<Tabs>
  <Tab title="Create entry" icon="file-plus">
    #### **Create Entry**

    Create a new entry in your Contentful space.

    **Required inputs**

    * **Contentful Account**
    * **Space**
    * **Environment**
    * **Content Type**
    * **Fields** (dynamic based on content type schema)

    **Optional inputs**

    * **Locale** (defaults to space's default locale)
    * **Publish** (publish immediately or save as draft)

    The entry is created based on your content type's schema. Rich text fields accept Markdown which is automatically converted to Contentful's rich text format.

    <Callout icon="lightbulb" color="#376CFF">
      **Tip:** Leave **Publish** unchecked to create drafts for review before publishing.
    </Callout>
  </Tab>

  <Tab title="Update entry" icon="pencil">
    #### **Update Entry**

    Update an existing entry in your Contentful space.

    **Required inputs**

    * **Contentful Account**
    * **Space**
    * **Environment**
    * **Entry ID**

    **Optional inputs**

    * **Fields** (only fields you want to update)
    * **Locale** (defaults to space's default locale)
    * **Publish** (publish changes immediately)

    <Callout icon="lightbulb" color="#376CFF">
      **Important:** Only the fields you provide will be modified; all other fields remain unchanged.
    </Callout>
  </Tab>

  <Tab title="Get entry" icon="file">
    #### **Get Entry**

    Retrieve a single entry by ID.

    **Required inputs**

    * **Contentful Account**
    * **Space**
    * **Environment**
    * **Entry ID**

    The output includes the entry's full content with all fields and metadata.
  </Tab>

  <Tab title="List entries" icon="list">
    #### **List Entries**

    Retrieve a list of entries from your Contentful space.

    **Required inputs**

    * **Contentful Account**
    * **Space**
    * **Environment**

    **Optional inputs**

    * **Content Type** (filter by content type)
    * **Limit** (number of entries to return)
    * **Skip** (pagination offset)

    The output is a structured list of entries that can be used in downstream Agent steps.
  </Tab>
</Tabs>

***

## Supported Field Types

Contentful's dynamic schema means Profound automatically adapts to your content model. All field types are supported:

| Field Type      | Description            | Input Format              |
| --------------- | ---------------------- | ------------------------- |
| **Short text**  | Single-line text       | Plain text                |
| **Long text**   | Multi-line text        | Plain text                |
| **Rich text**   | Formatted content      | Markdown (auto-converted) |
| **Number**      | Decimal numbers        | Number                    |
| **Integer**     | Whole numbers          | Integer                   |
| **Boolean**     | True/false             | Boolean                   |
| **Date & time** | ISO 8601 dates         | Date string               |
| **Location**    | Geographic coordinates | `{lat, lon}` object       |
| **JSON object** | Arbitrary JSON         | JSON object               |
| **Media**       | Asset references       | Asset ID                  |
| **Reference**   | Entry references       | Entry ID or array of IDs  |

***

## Working with Rich Text

Rich text fields in Contentful use a structured document format (AST). Profound accepts **Markdown**, **HTML**, or **Contentful's native rich text JSON** format.

**Supported Markdown:**

* Headings (`# H1` through `###### H6`)
* Paragraphs
* **Bold**, *italic*, and other formatting
* Bullet and numbered lists
* Blockquotes
* Code blocks
* Links

**Supported HTML:**

* `<h1>` through `<h6>` headings
* `<p>` paragraphs
* `<strong>`, `<em>`, `<u>` formatting
* `<ul>`, `<ol>`, `<li>` lists
* `<blockquote>` blockquotes
* `<code>`, `<pre>` code blocks
* `<a>` links

**Native Rich Text JSON:**

If you already have Contentful rich text documents, you can pass them directly:

```json theme={null}
{
  "nodeType": "document",
  "data": {},
  "content": [
    {
      "nodeType": "paragraph",
      "data": {},
      "content": [
        { "nodeType": "text", "value": "Hello world", "marks": [] }
      ]
    }
  ]
}
```

<Callout icon="lightbulb" color="#376CFF">
  **Tip:** Use whichever format is most convenient for your workflow. Markdown, HTML, and native rich text JSON all work seamlessly.
</Callout>

***

## Working with References

Reference fields link entries together. You can provide:

* **Single reference**: Just the entry ID as a string
* **Multiple references**: An array of entry IDs

Profound automatically compiles these into Contentful's required link format.

***

## Understanding Locales

Contentful uses a locale-based content model where every field value is keyed by locale (e.g., `en-US`, `fr-FR`). Profound handles this automatically:

* **Default behavior**: If you don't specify a locale, Profound uses your space's default locale
* **Single locale**: Specify a locale to write content in that language
* **Multi-locale**: Use the raw JSON format to write multiple locales at once

<Accordion title="How locale wrapping works">
  When you provide a simple field value like:

  ```json theme={null}
  {
    "title": "My Blog Post"
  }
  ```

  Profound automatically wraps it for Contentful's API:

  ```json theme={null}
  {
    "title": {
      "en-US": "My Blog Post"
    }
  }
  ```

  This locale wrapping happens for all fields before submission to Contentful.
</Accordion>

***

## Input Formats

Profound accepts two input formats for creating and updating entries:

<Tabs>
  <Tab title="Simple format">
    The simple format is human-friendly and handles locale wrapping automatically:

    ```json theme={null}
    {
      "space": "your-space-id",
      "environment": "master",
      "content_type_id": "blogPost",
      "locale": "en-US",
      "fields": {
        "title": "My Blog Post",
        "body": "# Hello\n\nThis is **markdown**.",
        "heroImage": "asset-123",
        "relatedPosts": ["post-1", "post-2"]
      },
      "publish": false
    }
    ```

    **Features:**

    * Flat field structure (no locale nesting)
    * Simple string IDs for references
    * Markdown for rich text fields
    * Automatic locale wrapping
  </Tab>

  <Tab title="Raw JSON format">
    The raw format gives you full control over locale-specific content:

    ```json theme={null}
    {
      "space": "your-space-id",
      "environment": "master",
      "content_type_id": "blogPost",
      "fields": {
        "title": {
          "en-US": "My Blog Post",
          "fr-FR": "Mon Article de Blog"
        },
        "body": {
          "en-US": "# Hello\n\nEnglish content.",
          "fr-FR": "# Bonjour\n\nContenu français."
        }
      },
      "publish": false
    }
    ```

    **Use this format when:**

    * Writing content in multiple locales simultaneously
    * You need precise control over locale-specific values
    * Migrating content from another system
  </Tab>
</Tabs>

***

## Common Use Cases

* **Content Publishing**: Generate and publish blog posts, articles, or product descriptions
* **Content Updates**: Bulk update existing entries with new information
* **Content Migration**: Move content between environments or spaces
* **Automated Workflows**: Create entries based on external triggers or data sources

***

## Additional Resources

Learn more about Contentful's content model and API:

* [Contentful Content Model Concepts](https://www.contentful.com/developers/docs/concepts/data-model/) - Understanding spaces, environments, and content types
* [Contentful Localization](https://www.contentful.com/developers/docs/concepts/locales/) - How locales work in Contentful
* [Rich Text Field Type](https://www.contentful.com/developers/docs/concepts/rich-text/) - Understanding Contentful's rich text format
* [Content Management API](https://www.contentful.com/developers/docs/references/content-management-api/) - Full API reference
