Skip to Content
DocumentationExtend with CodeHeadless · Momen BaaS

Headless · Momen BaaS

Momen gives you an integrated no-code experience covering UI, data modeling, business logic and deployment. If you would rather build the frontend in your own stack, you can use a Momen project as a backend service: database, Actionflows, AI Agents, user permissions and media are all exposed through the Runtime API.

This page covers what the Momen backend provides, how it is exposed, and how to connect your frontend to it — with an AI coding tool or by hand.

Understand the headless architecture

In a headless architecture, the external frontend and Momen backend are developed and deployed separately, then connected through the Runtime API:

  • External frontend: Lives in your codebase and handles the interface, interactions, and client state. Deploy it to your own environment or through Momen — see Deploy the frontend.
  • Momen backend: Provides managed database, Actionflow, AI Agent, user and permission management, and file and media services.
  • Runtime API: Provides HTTP and WebSocket interfaces for the external frontend to call deployed backend services.

What services the Momen backend provides

Core services

Momen provides the following services through one managed backend:

ServiceWhat it provides
DatabasePostgreSQL tables with relations, constraints, indexes, aggregations, and computed fields
ActionflowsSynchronous or asynchronous server-side business logic composed from nodes
AI AgentsOne-off tasks and multi-turn conversations using knowledge bases, tools, and context
Third-party APIsExternal APIs imported and called through the Momen backend
PaymentsStripe and Airwallex payment capabilities
Users and authenticationUser accounts, sign-in, and sessions
PermissionsRole, data, and action permissions that control access to services and data
Files and mediaImage, video, and file upload and management
Real-time dataUpdates pushed to clients when data changes

How services are exposed

Momen generates a Runtime GraphQL API from the project configuration. The GraphQL schema describes the fields, arguments, and return types available in the current project.

HTTP endpoint for queries and mutations:

https://villa.momen.app/zero/{projectExId}/api/graphql-v2

WebSocket endpoint for subscriptions:

wss://villa.momen.app/zero/{projectExId}/api/graphql-subscription

projectExId is the unique identifier of the project. Copy the URLs from Developer access instead of constructing them manually.

The Runtime API applies project permissions according to the request identity:

  • A request without an Authorization header runs as a guest.
  • A request with Authorization: Bearer <jwt> runs with that user’s roles and permissions.
  • A request with Authorization: Bearer <admin_token> runs as a project administrator and is intended only for local development, scripts, or trusted servers.
⚠️

Never include an Admin Bearer Token in a website, mobile app, public repository, or any other code delivered to end users.

See the Runtime API Reference for complete request formats and API details.

Use the Momen backend

Through the Momen Plugin

Install the Momen Plugin in an AI coding tool such as Claude Code, Codex, or Cursor. The Plugin ships the Runtime API integration conventions: the AI reads the project’s current schema and writes the code in your codebase that calls the Momen backend, without inventing endpoints.

Once it is installed, tell the AI which Momen project to connect and what to build. For example:

Connect the current frontend to the Momen project "Order Management" and use its backend to implement the order list, order details, and order submission.

Call the Runtime API by hand

Open Developer access from the Momen top navigation to copy the project endpoints and Admin Bearer Token, then use the built-in GraphiQL panel to write and test requests against the current schema.

The following example reads records from a post table. Replace the table and field names with those in the current project schema.

query ListPosts { post(limit: 10, order_by: { created_at: desc }) { id title } }

Base subsequent queries and calls on the current GraphQL schema shown in Developer access. Backend changes appear in the schema only after they are synced. For per-endpoint request formats, authentication, error codes and transaction semantics, see the Runtime API Reference.

Deploy the frontend

Deploy the frontend to your own environment, or install the Momen Plugin and have the AI deploy a web frontend to Momen: build it, deploy it to the preview site, then to production once it checks out. A production deploy waits for you to type the project ID into a confirmation dialog, and Free projects cannot publish to production.

Make sure the backend changes are synced before you deploy.

Last updated on