REST API integration
WordPress REST API integration for Draftbit
Use WordPress content through the REST API
What is WordPress?
WordPress exposes posts, pages, media, users, and custom routes through its REST API. Public content can often be read without credentials; write operations usually require HTTPS Basic auth with an application password.
Use WordPress with Draftbit
- Built-in endpoints: List posts, Get posts, Create posts, Update posts, Delete posts, List pages.
- Bind any WordPress 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 WordPress's client library.
Example
wordpress-example.ts // Example: fetch from WordPress
const response = await fetch("https://{site_domain}/wp-json/wp/v2/posts", {
headers: {
"Authorization": "Basic YOUR_WORDPRESS_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 WordPress carries it automatically — secrets stay on the server side.
Use WordPress in a Draftbit app today
Start free, connect WordPress in minutes, and ship with AI agents that know how to use it.
Frequently asked questions
What is the WordPress REST integration?
WordPress exposes posts, pages, media, users, and custom routes through its REST API. Public content can often be read without credentials; write operations usually require HTTPS Basic auth with an application password.
How do I connect WordPress to a Draftbit app?
Go to Integrations → REST APIs in your Draftbit app and pick WordPress 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 WordPress require authentication?
Most WordPress endpoints expect a key or token sent as a header. Built-in endpoints include: List posts, Get posts, Create posts, Update posts.
What can I build with WordPress and Draftbit?
Use WordPress 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.