Skip to content

Quick Start

Create and deploy a ZeroAPI backend in a few minutes.

  • Node.js 20 or newer.
  • pnpm 10 or newer.
  • A ZeroAPI Cloud account.

Install the ZeroAPI CLI package globally:

Terminal window
npm install -g zeroapicloud

This installs the zeroapi command:

Terminal window
zeroapi --help

If you do not want a global install, use pnpm zeroapi ... inside a generated project after pnpm install.

Create a backend project:

Terminal window
pnpm create zeroapi myapp
cd myapp
pnpm install

The generated project includes:

zeroapi.config.ts
zeroapi.schema.ts
zeroapi.rules.ts
zeroapi.server.ts
collections/
rules/
queries/
triggers/
crons/

It also installs zeroapicloud locally as a development dependency, so these commands work without a global CLI:

Terminal window
pnpm zeroapi init
pnpm zeroapi dev
pnpm zeroapi deploy

Link your local folder to a ZeroAPI Cloud project:

Terminal window
zeroapi init

If you did not install the CLI globally:

Terminal window
pnpm zeroapi init

The command creates or logs into your ZeroAPI account, creates or selects a project, writes .project.json, and checks that your definition files exist.

Start the local runtime:

Terminal window
zeroapi dev

Or with the local runner:

Terminal window
pnpm zeroapi dev

Open the runtime:

Terminal window
curl http://127.0.0.1:4311/

Deploy the current backend definition:

Terminal window
zeroapi deploy

Or:

Terminal window
pnpm zeroapi deploy

The 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.cloud

Non-production environments use:

https://staging--myapp.zeroapi.cloud

Register a runtime user:

Terminal window
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:

Terminal window
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:

Terminal window
curl "https://myapp.zeroapi.cloud/queries/workspace-summary?workspaceId=<WORKSPACE_ID>" \
-H "authorization: Bearer <TOKEN>" \
-H "x-workspace-id: <WORKSPACE_ID>"
  • Edit your collections in collections/.
  • Edit access behavior in rules/.
  • Add custom runtime behavior in queries/, triggers/, and crons/.
  • Deploy with zeroapi deploy or pnpm zeroapi deploy.

Define backend. ZeroAPI runs it.