How to Integrate AirOps with Your Headless CMS
Connect AirOps to structured headless CMS content so SEO, content, and growth teams can run repeatable AI workflows from publish-ready data instead of copy-pasted drafts.
What is AirOps?
AirOps is an AI workflow platform used by content, SEO, and growth teams to run repeatable workflows for briefs, content refreshes, landing pages, product descriptions, and other marketing operations. Teams build AirOps workflows and apps that combine LLMs, brand guidance, data sources, human review steps, and publishing handoffs. It sits in the AI content workflow category, especially for teams that need consistent outputs at scale rather than one-off prompts.
Why integrate AirOps with a headless CMS?
AirOps works best when the inputs are clean. If your team is pasting article drafts, product fields, category pages, or SEO metadata into a workflow by hand, every run starts with a different format. One editor includes the intro, another forgets the canonical URL, and a third pastes HTML that the workflow wasn't built to read. The result is slower review, less consistent AI output, and a lot of avoidable cleanup.
Connecting AirOps to a headless CMS changes that pattern. Published content can trigger an AirOps workflow automatically, with the exact fields the workflow expects: title, slug, body blocks, author, product references, target keyword, locale, and publish date. With Sanity, that content is structured in the Content Lake as typed JSON, so AirOps doesn't need to scrape HTML or parse page blobs. GROQ selects the precise fields for each workflow, and webhooks fire as soon as content is published, updated, or deleted.
The trade-off is that you need to model the content and workflow inputs carefully up front. A vague βsend the whole pageβ integration is fast to wire together but hard to trust later. A field-mapped integration takes more planning, but it gives you repeatable AirOps runs, cleaner audit trails, and fewer surprises when you scale from 20 articles to 20,000.
Architecture overview
A typical Sanity and AirOps integration starts when an editor publishes or updates a document in Sanity Studio. The mutation lands in the Content Lake, and a Sanity webhook fires with the document ID, type, and operation. From there, you can call a Sanity Function or your own webhook listener. The function uses @sanity/client to fetch the latest published document with GROQ. Instead of sending the entire document, the query can project only the fields AirOps needs, such as title, slug, excerpt, Portable Text body, target keyword, related products, category references, and locale. That field selection matters because most AirOps workflows are designed around named inputs. The function then calls the AirOps public API, commonly by posting to an AirOps app or workflow execution endpoint with your API key, app ID, and mapped inputs. For example, a content refresh workflow might receive the article ID, current title, body text, primary keyword, and URL. AirOps runs the workflow, returns a result or run payload, and your integration can write recommendations back to Sanity, notify an editor, or hand the output to a frontend experience. If the AirOps workflow takes longer than your request timeout, save the run ID and process the result asynchronously.
Common use cases
SEO brief generation
Send target keywords, category context, and existing Sanity content to AirOps to generate structured briefs before editors start drafting.
Content refresh workflows
Trigger AirOps when an article changes, then produce refresh recommendations, missing sections, internal link ideas, and metadata updates.
Product description scaling
Use Sanity product attributes, brand voice fields, and collection references as inputs for AirOps workflows that generate channel-specific copy.
Localized content operations
Route source content, locale, glossary terms, and market notes from Sanity into AirOps workflows for translation, adaptation, and review.
Step-by-step integration
- 1
Set up AirOps access
Create or choose the AirOps workspace, build the workflow or app you want to run, expose it through the AirOps public API, and create an API key. Note the app or workflow ID, because your webhook handler will use it when it calls AirOps. AirOps can be called over HTTPS from Node 18+ with fetch, so the example below doesn't require a separate AirOps package.
- 2
Model the workflow inputs in Sanity Studio
Add the fields your AirOps workflow expects. For an SEO refresh flow, that might include title, slug, excerpt, body, targetKeyword, seoTitle, seoDescription, primaryCategory, author, locale, and lastReviewedAt. Keep AI output fields separate, such as aiRefreshNotes or aiSuggestedMetaDescription, so editors can review changes before publishing.
- 3
Create a publish webhook
In Sanity, create a webhook that triggers on create and update mutations for the document types you want to send to AirOps. Use a small projection, such as {"documentId": _id, "type": _type, "operation": delta::operation()}, so the handler receives an ID and fetches the latest content itself.
- 4
Fetch the exact content with GROQ
In your Sanity Function, Next.js route, or webhook service, use @sanity/client and GROQ to select only the fields AirOps needs. Join references in the same query, such as categories[]->title and author->name, so the AirOps workflow receives complete context in one request.
- 5
Call the AirOps API
Map the Sanity fields to the AirOps workflow inputs and POST them to the AirOps public API with your bearer token. Keep secrets in environment variables, log the AirOps run ID or response, and retry failed requests with backoff rather than running duplicate workflows.
- 6
Test the editorial loop
Publish a test document, confirm the webhook fires, inspect the payload sent to AirOps, and verify the result. If you're writing AirOps output back to Sanity, use draft fields or review-only fields first so editors approve AI-generated changes before they go live.
How Sanity + AirOps works
Build your AirOps integration on Sanity
Sanity gives you the structured content foundation, real-time event system, and flexible APIs you need to connect AirOps with your AI content operations.
Start building free βCMS approaches to AirOps
| Capability | Traditional CMS | Sanity |
|---|---|---|
| AI workflow input quality | Content is often trapped in pages, plugins, or HTML fields, so AirOps may receive messy text and missing context. | The Content Lake provides typed JSON, references, and Portable Text that can be mapped directly to AirOps workflow inputs. |
| Triggering AirOps on publish | Publish events may depend on plugins or scheduled exports, which can delay workflow runs. | Webhooks trigger on content mutations, and Functions can run the AirOps call server-side without separate infrastructure. |
| Field-level control | Integrations often send whole pages or rendered HTML, which gives AirOps more noise to sort through. | GROQ selects and joins exactly what AirOps needs, such as article fields, author data, categories, and locale metadata. |
| Editorial review of AI output | AI results are often pasted back into page fields, which makes review and rollback harder. | Sanity Studio can expose AirOps output in draft or review-only fields, alongside Comments, Tasks, and Content Releases. |
| Scaling across channels | The website is usually the primary destination, so AI workflow outputs may need separate handling for other channels. | One structured back end can feed web, mobile, AirOps, and production AI agents through APIs and Agent Context. |
Keep building
Explore related integrations to complete your content stack.
Sanity + OpenAI
Generate, transform, and classify structured content from Sanity using OpenAI models in custom AI workflows.
Sanity + Anthropic (Claude)
Use Claude with Sanity content for long-context drafting, editorial review, and structured content transformation.
Sanity + Writer
Connect governed brand writing workflows with structured Sanity content for teams that need consistent language at scale.