Quick Start
Create and deploy a ZeroAPI backend in a few minutes.
Prerequisites
Section titled “Prerequisites”- Node.js 20 or newer.
- pnpm 10 or newer.
- A ZeroAPI Cloud account.
1. Install The CLI
Section titled “1. Install The CLI”Install the ZeroAPI CLI package globally:
npm install -g zeroapicloudThis installs the zeroapi command:
zeroapi --helpIf you do not want a global install, use pnpm zeroapi ... inside a generated project after pnpm install.
2. Create Your Project
Section titled “2. Create Your Project”Create a backend project:
pnpm create zeroapi myappcd myapppnpm installThe generated project includes:
zeroapi.config.tszeroapi.schema.tszeroapi.rules.tszeroapi.server.tscollections/rules/queries/triggers/crons/It also installs zeroapicloud locally as a development dependency, so these commands work without a global CLI:
pnpm zeroapi initpnpm zeroapi devpnpm zeroapi deploy3. Initialize The Project
Section titled “3. Initialize The Project”Link your local folder to a ZeroAPI Cloud project:
zeroapi initIf you did not install the CLI globally:
pnpm zeroapi initThe command creates or logs into your ZeroAPI account, creates or selects a project, writes .project.json, and checks that your definition files exist.
4. Run Locally
Section titled “4. Run Locally”Start the local runtime:
zeroapi devOr with the local runner:
pnpm zeroapi devOpen the runtime:
curl http://127.0.0.1:4311/5. Deploy
Section titled “5. Deploy”Deploy the current backend definition:
zeroapi deployOr:
pnpm zeroapi deployThe CLI validates zeroapi.config.ts, zeroapi.schema.ts, zeroapi.rules.ts, and zeroapi.server.ts, then deploys to the selected environment.
Production runtimes use:
https://myapp.zeroapi.cloudNon-production environments use:
https://staging--myapp.zeroapi.cloud6. Explore Your API
Section titled “6. Explore Your API”Register a runtime user:
curl -X POST https://myapp.zeroapi.cloud/_zeroapi/auth/register \ -H "content-type: application/json" \ -d '{"email":"demo@example.com","password":"password123","name":"Demo"}'Create a workspace:
curl -X POST https://myapp.zeroapi.cloud/workspaces \ -H "content-type: application/json" \ -H "authorization: Bearer <TOKEN>" \ -d '{"name":"Acme","slug":"acme"}'Run a custom query:
curl "https://myapp.zeroapi.cloud/queries/workspace-summary?workspaceId=<WORKSPACE_ID>" \ -H "authorization: Bearer <TOKEN>" \ -H "x-workspace-id: <WORKSPACE_ID>"7. Next Steps
Section titled “7. Next Steps”- Edit your collections in
collections/. - Edit access behavior in
rules/. - Add custom runtime behavior in
queries/,triggers/, andcrons/. - Deploy with
zeroapi deployorpnpm zeroapi deploy.
Define backend. ZeroAPI runs it.