REST API integration
Directus REST API integration for Draftbit
Read and manage Directus collections
What is Directus?
Directus generates REST endpoints for collections in your project. Use your Directus host and optionally a static token or access token for private collections.
Use Directus with Draftbit
- Built-in endpoints: List items, Get items, Create items, Update items, Delete items.
- Bind any Directus 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 Directus's client library.
Example
directus-example.ts // Example: fetch from Directus
const response = await fetch("https://{directus_host}/items/{collection}", {
headers: {
"Authorization": "Bearer YOUR_DIRECTUS_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 Directus carries it automatically — secrets stay on the server side.
Use Directus in a Draftbit app today
Start free, connect Directus in minutes, and ship with AI agents that know how to use it.
Frequently asked questions
What is the Directus REST integration?
Directus generates REST endpoints for collections in your project. Use your Directus host and optionally a static token or access token for private collections.
How do I connect Directus to a Draftbit app?
Go to Integrations → REST APIs in your Draftbit app and pick Directus 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 Directus require authentication?
Most Directus endpoints expect a key or token sent as a header. Built-in endpoints include: List items, Get items, Create items, Update items.
What can I build with Directus and Draftbit?
Use Directus 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.