Prismic logo

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.

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.

Start building free

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 → REST APIs in your Draftbit app and pick Prismic from the catalog. Paste your API key or token, set any base-URL variables (project IDs, hosts), and the endpoints become available across your screens.

Does Prismic require authentication?

Most Prismic endpoints expect a key or token sent as a header. Built-in endpoints include: Get repository, Search documents, Get documents by type.

What can I build with Prismic and Draftbit?

Use Prismic as a headless CMS for your mobile or web app: Drive a blog, news feed, or content section from a headless CMS; Let non-engineers publish app content without a release.

Related Integrations

Get started free Browse all Integrations