˙˙Build with Craft API on Codex CLI

→ Get 40% off Craft Plus and Family

Imagine With Craft

Use Craft’s API to Build With Codex CLI

Use Craft's API to build apps on Codex CLI. Fetch your documents, sync content, and create custom tools powered by your Craft data.

Craft
Codex CLI

Enabling the API for Documents

First, you have to enable the API in order for Craft to setup an API endpoint for your documents. Then, you use the API endpoint URL to connect to the server from Codex CLI.

Step 1

Open the “Imagine” tab

Step 2

Click “Add Your First API Connection”

Step 3

Configure your API connection with a name.

Step 4

Click “Add Document” to select which documents this API connection has access to.

Step 5

The API URL that will be used to interact with your document is now displayed at the top

Step 6

Click the “Download AI Bundle” button. This will download a folder containing the API documentation and the content of your doc.

Using the API in a Codex CLI Prompt

Once the API is enabled for your Craft docs, you can now focus on writing a prompt that Codex CLI will use to generate your project.

In order for Codex CLI to see how to use the API and understand the structure of your document, you attach the AI bundle to your prompt. This bundle is a markdown document that contains the current content of your Craft doc as well as the API documentation.

Step 1

Open a terminal on your computer. Start Codex CLI in a folder which only contains the downloaded “bundle.md” file and nothing else.

Now you can add a prompt to describe the app you want to build. Here is a very general example that can be used for testing:

Please create a website that visualises the content of my connected Craft docs. You find instructions on how to access this data and its structure in the attached file.

Step 2

Hit enter and wait for Codex CLI to implement your app.

Some Ideas to Get You Started

Browse App Templates
self.__next_f.push([1,"ture\":\"Linked documents\",\"compareRow4Competitor1\":\"2–4 seconds\",\"compareRow4Competitor2\":\"1–3 seconds\",\"compareRow4Craft\":\"Under 200ms\",\"compareRow4Feature\":\"Document load time\",\"compareRow5Competitor1\":\"Yes\",\"compareRow5Competitor2\":\"Limited\",\"compareRow5Craft\":\"Yes\",\"compareRow5Feature\":\"Visual polish by default\"},\"forChurches\":{\"heroTitle\":\"Everything your church runs on, in one place.\",\"heroDescription\":\"Prep sermons in a distraction-free editor, publish bulletins and event pages your congregation opens with one link, and give every ministry team an organized home. Native on Mac, iPhone, and iPad, fully offline at the pulpit. Craft is the best productivity app on iPad.\",\"useCaseLabel\":\"Built for church teams\",\"useCaseTitle\":\"Sermons, bulletins, volunteer guides, and ministry knowledge in one place.\",\"useCase1Title\":\"Sermon preparation\",\"useCase1Description\":\"Gather the passage, commentary quotes, and your notes in one doc. Keep an offcuts doc beside it so you can cut without losing anything, check the reading time, and present from your iPad.\",\"useCase2Title\":\"Staff \u0026 volunteer hub\",\"useCase2Description\":\"Role descriptions, meeting agendas, safety plans, and onboarding guides in shared spaces. New volunteers find everything they need on day one.\",\"useCase3Title\":\"Bulletins \u0026 event pages\",\"useCase3Description\":\"Publish weekly bulletins, new-member classes, and camp info as clean web pages. Link them from your church website. Your congregation never needs an account.\",\"useCase4Title\":\"Ministry knowledge base\",\"useCase4Description\":\"Curriculum by age group, worship song libraries, vendor lists per campus. Organized in Collections and nested pages your whole team can search.\",\"featureGridTitle\":\"The tools that carry your church through the week.\",\"featureGridDescription\":\"Craft keeps your team’s writing quick to make and easy to share, so getting ready for Sunday doesn’t take all week.\",\"featurePillar1Title\":\"Publish pages your congregation opens\",\"featurePillar1Description\":\"Turn any doc into a web page. Link bulletins, class pages, and event info straight from your church website. Visitors won’t know it isn’t part of your site.\",\"featurePillar2Title\":\"Offline and iPad-first\",\"featurePillar2Description\":\"Craft is native on Mac, iPhone, and iPad, and works fully offline. Preach from the pulpit or visit a member at home, even when there’s no signal.\",\"featurePillar3Title\":\"Spaces for every ministry\",\"featurePillar3Description\":\"Give kids ministry, worship, and operations their own spaces. Leaders see everything from one place; each team sees their slice. Keep edit rights tight and let everyone comment.\",\"featurePillar4Title\":\"Collections and daily notes\",\"featurePillar4Description\":\"Track follow-ups, song libraries, and event plans in flexible Collections. Daily notes keep a running log of your conversations and your week.\",\"midCtaTitle\":\"Less time formatting. More time for your people.\",\"testimonialsLabel\":\"What users say\",\"testimonialsTitle\":\"Teams of every kind run on Craft.\",\"showcaseTitle\":\"How churches use Craft every week.\",\"showcase1Label\":\"Sunday preparation\",\"showcase1Title\":\"From study to pulpit in one doc.\",\"showcase1Description\":\"Collect your research, whittle it down to your teaching notes, and present straight from your iPad. Export a PDF for your website when you’re done.\",\"showcase1Bullet1\":\"Reading time shows how long your talk runs\",\"showcase1Bullet2\":\"Keep an offcuts doc so you can cut without fear\",\"showcase1Bullet3\":\"Export to PDF or publish study notes for your congregation\",\"showcase2Label\":\"Congregation communications\",\"showcase2Title\":\"Publish once. Reach everyone.\",\"showcase2Description\":\"Bulletins, newsletters, event pages, and class materials turn into clean web pages people open right on their phones. Nobody needs to install an app or create an account, and you can skip printing altogether.\",\"showcase2Bullet1\":\"Share links that open in any browser\",\"showcase2Bullet2\":\"Password-protect board agendas and sensitive docs\",\"showcase2Bullet3\":\"Collect feedback in comments while you "])˙˙˙˙