🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Headless CMS Premium Add-on Setup Guide

Updated 8 min read Gravity Forms Integrations A–Z
On this page
  1. Video walkthrough
  2. What you need
  3. Step 1: install and connect
  4. Which fields each provider uses
  5. Step 2: add a feed to a form
  6. The provider override
  7. The target
  8. The field mapping
  9. How an item is created
  10. Safe retries and the idempotency guard
  11. Notification events and merge tags
  12. On the entry
  13. Bulk actions and the daily cap
  14. For developers
  15. Common uses
  16. Troubleshooting
  17. Privacy and security

Video walkthrough

Gravity Forms Headless CMS Add-On Setup Guide: Entries to Strapi, Ghost & More (WordPress Side)
Video setup guide: Gravity Forms Headless CMS Watch on YouTube

The Gravity Forms Headless CMS Premium Add-on turns a form submission into a content item in your own headless CMS when a Gravity Forms form is submitted. A feed decides which provider receives the item (Strapi, Directus, Contentful, Sanity or Ghost), what the item contains (a mapping from your content model’s fields to form fields or typed values) and when it is created (conditional logic). The item is created in the background, so the visitor never waits, and the result, with the new item id, is written to the entry.

What you need

  • WordPress 5.8 or newer, PHP 7.4 or newer and Gravity Forms 2.5 or newer. Tested with Gravity Forms 3.1.2 on PHP 8.3 and Gravity Forms 2.9.8 on PHP 7.4.
  • An account with one of the five providers and a token that can create content: a Strapi API token, a Directus token, a Contentful Content Management API token, a Sanity token, or a Ghost Admin API key (as id:secret).
  • For Strapi, Directus and Ghost, the https base URL of your CMS. For Contentful, your space id and environment. For Sanity, your project id and dataset.
  • Your GravityExtra licence key. Without an active licence nothing is created and the entry gets a note that says so.

The add-on follows each provider’s own reference (read 26 October 2026): Strapi POST {base}/api/{collection}, Directus POST {base}/items/{collection}, Contentful POST /spaces/{space}/environments/{env}/entries, Sanity POST {project}.api.sanity.io/{version}/data/mutate/{dataset}, and Ghost POST {base}/ghost/api/admin/{resource}/ with a short-lived JWT built from your Admin API key. The token is only ever sent to your own host.

Step 1: install and connect

  1. Upload and activate the add-on in Plugins.
  2. Open Forms → Settings → Headless CMS and activate your licence key.
  3. Pick your Provider. This is the default for the whole site; any feed can override it.
  4. Fill in the fields your provider needs: the Base URL for Strapi, Directus or Ghost; the space id and environment for Contentful; the project id and dataset for Sanity. Enter the Token, then press Save.
  5. Press Check the connection. The add-on reads a small amount from your CMS with the saved settings. Nothing is created.
The Headless CMS settings screen in Gravity Forms: the licence box, the provider, the base URL, the encrypted token, the Contentful and Sanity fields, the daily cap and the Check the connection button
The settings: your provider, your own host and the token, stored encrypted, with the daily cap and the connection check.

The token is encrypted before it is saved, with a key made from your site’s own security salts, and it is never shown again. Leave the box empty to keep the stored token, or tick Remove the stored token when saving to delete it. A base URL must be an https address, and the add-on only ever sends the token to that host or, for Contentful and Sanity, to their own host built from your project.

Which fields each provider uses

  • Strapi and Directus: the base URL and a Bearer token. The target on the feed is the collection API id.
  • Ghost: the base URL and an Admin API key (id:secret). The add-on builds the required short-lived JWT for every request. The target is posts or pages (empty means posts).
  • Contentful: the space id, the environment (master by default), the locale (en-US by default) and a Content Management API token. The target is the content type id.
  • Sanity: the project id, the dataset (production by default), the API version (v2021-10-21 by default) and a token. The target is the document _type.

The Daily cap of items stops creating after this many items in one day (UTC), over all feeds, and writes a note; empty or 0 means no cap.

Step 2: add a feed to a form

  1. Open the form, go to Settings → Headless CMS and press Add New.
  2. Give the feed a name that says what it does, for example New story to Ghost.
  3. Leave Provider as the default, or pick another provider just for this feed.
  4. Enter the target (the collection, content type, document type or resource) and build the field mapping.
  5. Turn on the Condition if the item is only for some entries, then save.
A Headless CMS feed: the provider, the target collection or content type, the field mapping from CMS fields to form fields and the condition
A feed: the provider, the target, and the field mapping from your content model to the form.

The provider override

By default a feed uses the provider from the settings, but you can point one feed at another provider. That means a contact form can write to Strapi while a story form writes to Ghost, all on one site. The entry records which provider created the item, and the merge tag {cms_provider} carries it into notifications.

The target

The target names where the item goes. For Strapi and Directus it is the collection API id, for example articles. For Contentful it is the content type id. For Sanity it is the document _type. For Ghost it is posts or pages. If the target does not exist, the provider answers with a clear error and the add-on writes it on the entry without trying again.

The field mapping

Each row maps one field of your content model on the left to a form field or a typed value on the right. Pick a form field to copy its answer, or choose a typed value and write anything you like, with merge tags, for example a title built from several fields. A value that is a pure number is sent as a number and true or false as a boolean, so your CMS accepts number and boolean fields; everything else is sent as text. A field name that is not valid for a CMS payload is left out and the note says which one.

How an item is created

When an entry is saved, each feed whose condition matches is queued and the visitor sees the normal confirmation at once. A background job then builds the item from the field mapping and creates it in your CMS in one request, over https, with your token. The entry records the provider, the status and the new item id, and a note is added. The merge tag {cms_item_id} carries the id into notifications and later feeds.

Safe retries and the idempotency guard

If your CMS cannot be reached at all (for example a DNS failure), the add-on tries again after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours. But if a request was sent and the answer never arrived (a timeout, a server error or an answer that cannot be read), the item may already exist, so the add-on does not try again: it marks the entry unsure and asks you to check your CMS. An entry whose item is being created, was created, or is finished is never created again on its own, so a single entry can never quietly become two items.

Notification events and merge tags

The add-on adds two notification events to a form that has a feed: Headless CMS: the item was created and Headless CMS: the item could not be created. Pick one as the event of a Gravity Forms notification to email yourself or a teammate. In any notification you can use {cms_status}, {cms_item_id} and {cms_provider}, each with an optional _<feed id> suffix when a form has several feeds.

The Headless CMS box on a Gravity Forms entry: the feed name, the provider, the status, the created item id and a link to the item
The entry: the feed, the provider, the status and the created item id, with a link to the item when the provider returns one.

On the entry

Open any entry that has a feed and the Headless CMS box shows the feed name, the provider, the status and the item id, with a link to the item when the provider returns one. The notes below record every attempt: what was created and where, or why it was not. If an item was not created, use the bulk actions in the entry list to try again.

Bulk actions and the daily cap

In the entry list, select entries and choose Create CMS item (skip created) to create items for entries that have none yet, or Create CMS item again (creates another item) to create a second item for entries that already have one. The add-on works through the entries in small groups so your CMS is never flooded, and it respects the daily cap.

For developers

The filter gform_headless_cms_item runs just before the item is created and receives the provider, the target and the fields; return a changed array to add or alter fields, or a non-array to cancel the item for that entry. The action gfhc_item_created fires with the result (provider, item id and, when available, the item url) after an item is created, and gfhc_item_failed fires when it could not be created. All three are also keyed by form and feed, so you can target one form or one feed.

Common uses

A guest-post or story form can create a draft post in Ghost, ready for an editor to review. A lead or enquiry form can create an item in a Strapi or Directus collection that feeds your front end or your internal tools. An events form can create an entry in a Contentful content type, and a catalogue form can create a document in Sanity. Because the provider is set per feed, one busy site can send some forms to one system and other forms to another without any code.

Troubleshooting

  • The token was not accepted (401): check that the token can create content and, for self-hosted providers, that the base URL is correct. The note on the entry names the provider that refused it.
  • The target was not found (404): check the collection, content type, document type or resource on the feed against your content model.
  • The request was refused as invalid (400 or 422): a field in the mapping does not match your content model. The note repeats your CMS’s own words, so you can see which field.
  • The entry is marked unsure: the request was sent but the answer never arrived. Look in your CMS for an item from that entry before using Create CMS item again, so you do not create a duplicate.
  • Nothing happens: check that the licence is active, that a feed exists and that its condition matches the entry. The entry notes explain every case.

Privacy and security

The token is stored encrypted with your site’s own salts and is only ever sent to your own host. The mapped form values are sent to your CMS to create the item; that CMS processes the data under its own terms. Error messages from your CMS are cleaned of the token before they are written to an entry note, so a secret never ends up in the entry history.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr