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

# API

> How to connect and publish to Contentful

# Contentful API Integration

Docswrite allows you to publish Google Docs directly to your Contentful space using Contentful's APIs. This guide explains how to connect your Contentful account and use the API for seamless publishing.

## What Credentials Do You Need?

To connect Docswrite to your Contentful space, you'll need the following credentials:

* **Space ID:**\
  This identifies your Contentful space. You can find it in Contentful under *Settings → General Settings*.

* **Content Delivery API Access Token:**\
  This token allows Docswrite to read published content from your space. Generate it in *Settings → API keys* in Contentful.

* **Content Management API (CMA) Token:**\
  This token allows Docswrite to create and update content in your space. Generate it in *Settings → CMA Tokens* in Contentful.

> 📝 *Docswrite provides tooltips and help links for each field if you’re unsure where to find them.*

***

## How to Connect Contentful to Docswrite

<img src="https://mintcdn.com/docswrite/UNjFhoGpPQ1s-BX2/images/new/dashboard/contentful-api-connection.png?fit=max&auto=format&n=UNjFhoGpPQ1s-BX2&q=85&s=879987a379ecfa32b9597122e2c1a963" alt="Connect Contentful to Docswrite" width="3616" height="2008" data-path="images/new/dashboard/contentful-api-connection.png" />

1. **Go to the [Docswrite Dashboard](https://docswrite.com/dashboard).**\
   (Note: To connect multiple sites, you’ll need to be on the Business plan.)

2. **Add a new site and choose Contentful** as the platform.

3. **Enter the required Contentful credentials:**

   * **Space ID:**\
     Find this in Contentful under *Settings → General Settings*. Copy and paste it into Docswrite.
   * **Content Delivery API Access Token:**\
     Go to *Settings → API keys* in Contentful, generate a new API key, and copy the Content Delivery API token.
     <img src="https://mintcdn.com/docswrite/UNjFhoGpPQ1s-BX2/images/new/dashboard/contentful-api-key.png?fit=max&auto=format&n=UNjFhoGpPQ1s-BX2&q=85&s=e34a17b3d082950c6af4d46e10514a3c" alt="API Key" width="3616" height="2008" data-path="images/new/dashboard/contentful-api-key.png" />
   * **Content Management API (CMA) Token:**\
     In Contentful, go to *Settings → CMA Tokens*, then create a new Management Token (CMA token) and copy it.
     <img src="https://mintcdn.com/docswrite/UNjFhoGpPQ1s-BX2/images/new/dashboard/contentful-cma-tokens.png?fit=max&auto=format&n=UNjFhoGpPQ1s-BX2&q=85&s=3e24d6bc8a3bc79621e3a412f992c696" alt="CMA" width="3616" height="2008" data-path="images/new/dashboard/contentful-cma-tokens.png" />

4. **Connect!**\
   Once you’ve entered all the info, click to connect. If everything is correct, your Contentful site will be linked to Docswrite.
