Developer overview
Everything you build in Devmachinist is ordinary code you can read and change, backed by APIs you can call from anywhere. This section is the reference for those APIs and tools. Each page has copy-ready examples in curl and JavaScript.
Two kinds of API #
There are two separate APIs, and they never share credentials.
| Your app's API | The platform API | |
|---|---|---|
| What it is | The backend you design in the API tab: data models, sign-in, files, payments | Devmachinist itself: your projects, files, previews, publishing, git |
| Address | https://devmachinist.com/_api/<apiId>/… | https://devmachinist.com/api/… |
| Who calls it | Your published site, your native apps, any HTTP client | Your own scripts, CI jobs and AI agents |
| Credentials | None for public data; an app sign-in token for the rest | A personal access token (Bearer dm_pat_…) or an OAuth token from an app you allowed |
| Rules | The access rules you set per model | The token's scopes and project list |
| Reference | Data API, App sign-in, Files, Payments | Platform API, MCP server |
Your app's API #
Every API you create in the API tab is served at /_api/<apiId>. It is open to other origins (CORS), uses no cookies, and enforces the read, add and edit rules you set on each model. You can call it from your published site, from a native build, from another website or from a server.
# List the rows of a public model (the model name in lower case)
curl https://devmachinist.com/_api/<apiId>/productInside a project you rarely write these requests yourself. Connecting an API writes a JavaScript client into src/api/, with a hook per model, sign-in components and upload helpers:
import { useProducts } from '../api/shop.js'
export default function ProductList() {
const { data: products, loading } = useProducts()
if (loading) return <p>Loading…</p>
return <ul>{products.map(p => <li key={p.id}>{p.name}</li>)}</ul>
}The exact names come from your models. Open the generated file, or see JavaScript client.
| Page | Covers |
|---|---|
| Data API | Reading and writing rows, filters, sorting, paging, access rules, errors |
| JavaScript client | The generated hooks, model objects, sign-in components and helpers |
| App sign-in | Register, sign in, tokens, roles, robot check, memberships, admin routes |
| App file storage | Uploads, public and private files, limits |
| Payments API | Checkout, orders, shipping, fulfillment, the store webhook |
| Webhooks and integrations | Incoming hooks (Zapier and others), posting to social apps from your app |
The platform API and agents #
Scripts and AI agents work on your projects with a personal access token. Create one under Account → Access tokens, choose its scopes (read, write, preview, publish) and, if you like, limit it to some projects.
curl https://devmachinist.com/api/projects \
-H "Authorization: Bearer dm_pat_…"The same token works with the built-in MCP server. Claude, Claude Code, Cursor and other MCP clients can then read your project map, edit files, check the build, look at pages and publish. Clients with OAuth support don't need a token at all: give them the address, and they open a Devmachinist page where you choose what they may do and press Allow.
claude mcp add --transport http devmachinist https://devmachinist.com/api/mcp
# then /mcp → devmachinist → AuthenticateIntegrations that sign other Devmachinist users in use OAuth apps.
See Platform API, MCP server and the MCP tool reference, which documents every tool with its arguments and examples. The MCP server has every tool the builder's AI chat uses, under the same names; AI chat tools explains how the chat uses them. For an introduction to agents, see Agents & MCP.
Your project as code #
A project is a standard Vite + React + Tailwind CSS v4 app. A few files are generated and kept up to date for you, like the page router, src/site.js and the clients in src/api/. Everything else is yours. Project structure explains what each file does, the site.js helpers for navigation and routes, and the rules that make code work both in the live preview and on the published site.
Conventions #
- Every response is JSON. The platform API answers
{"ok": true, …}or{"ok": false, "error": "…"}. Your app's API returns a list as{"data": […], "total", "page", "pageCount"}, a single row as the row itself, and{"error": "…"}on failure. The Data API page has the details. - Use HTTPS. Send
Content-Type: application/jsonwith JSON bodies. - Status codes mean what they usually do:
400bad input,401not signed in,403not allowed,404not found (also for anything you may not see),409a conflict,429too many requests. The platform API adds402when a plan limit or AI credits stop a request, and423while a file is locked because an AI or a build is working on it. - Ids in examples look like
<apiId>,<projectId>and<id>. Copy the real ones from the builder: the API tab shows the API id, and the address bar shows the project id (#project=…).