REST API integration
Prismic REST API integration for Draftbit
Query Prismic documents over REST
What is Prismic?
Prismic's REST API lets apps fetch repository metadata, refs, and published documents. Use the repository API endpoint first to choose the current ref, then query documents by type or UID.
Use Prismic with Draftbit
- Built-in endpoints: Get repository, Search documents, Get documents by type.
- Bind any Prismic endpoint to a screen, list, form, or AI agent action.
- Authentication is configured once per app — secrets stay on the server.
- Add custom request and response transforms without forking Prismic's client library.
More ways to connect Prismic
Prefer GraphQL? Connect to the Prismic GraphQL integration instead.
Example
prismic-example.ts // Example: fetch from Prismic
const response = await fetch("https://{repository_name}.cdn.prismic.io/api/v2/", {
headers: {
"Authorization": "Bearer YOUR_PRISMIC_TOKEN",
},
});
const data = await response.json();Use cases
- Drive a blog, news feed, or content section from a headless CMS
- Let non-engineers publish app content without a release
- Localize copy and assets without code changes
Authentication
Authentication uses the `Authorization` header. Paste your key once in Draftbit and every request to Prismic carries it automatically — secrets stay on the server side.
Use Prismic in a Draftbit app today
Start free, connect Prismic in minutes, and ship with AI agents that know how to use it.
Frequently asked questions
What is the Prismic REST integration?
Prismic's REST API lets apps fetch repository metadata, refs, and published documents. Use the repository API endpoint first to choose the current ref, then query documents by type or UID.
How do I connect Prismic to a Draftbit app?
Go to Integrations and then REST APIs in your Draftbit app and pick Prismic from the catalog. Paste your API key or token and fill in any base URL variables, such as a project ID or host. The endpoints are then available across your screens and to the AI agents while you build.
Does Prismic require authentication?
Most Prismic endpoints expect a key or token sent as a header. The preconfigured endpoints include Get repository, Search documents, Get documents by type.
What can I build with Prismic and Draftbit?
Most teams use Prismic as a headless CMS for a mobile or web app. You might use Prismic to drive a blog, news feed, or content section from a headless CMS, or to let non-engineers publish app content without a release.