Devmachinist /Docs
Sign in Start
All docs

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 APIThe platform API
What it isThe backend you design in the API tab: data models, sign-in, files, paymentsDevmachinist itself: your projects, files, previews, publishing, git
Addresshttps://devmachinist.com/_api/<apiId>/…https://devmachinist.com/api/…
Who calls itYour published site, your native apps, any HTTP clientYour own scripts, CI jobs and AI agents
CredentialsNone for public data; an app sign-in token for the restA personal access token (Bearer dm_pat_…) or an OAuth token from an app you allowed
RulesThe access rules you set per modelThe token's scopes and project list
ReferenceData API, App sign-in, Files, PaymentsPlatform API, MCP server
The people who sign in to your app are your app's users, stored in your API. They are not Devmachinist accounts, and an app token can never reach the platform API. A personal access token can never act as one of your app's users either.

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.

bash
# List the rows of a public model (the model name in lower case)
curl https://devmachinist.com/_api/<apiId>/product

Inside 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:

jsx
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.

PageCovers
Data APIReading and writing rows, filters, sorting, paging, access rules, errors
JavaScript clientThe generated hooks, model objects, sign-in components and helpers
App sign-inRegister, sign in, tokens, roles, robot check, memberships, admin routes
App file storageUploads, public and private files, limits
Payments APICheckout, orders, shipping, fulfillment, the store webhook
Webhooks and integrationsIncoming 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.

bash
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.

bash
claude mcp add --transport http devmachinist https://devmachinist.com/api/mcp
# then /mcp → devmachinist → Authenticate

Integrations 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/json with JSON bodies.
  • Status codes mean what they usually do: 400 bad input, 401 not signed in, 403 not allowed, 404 not found (also for anything you may not see), 409 a conflict, 429 too many requests. The platform API adds 402 when a plan limit or AI credits stop a request, and 423 while 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=…).