Site ↗
Documentation sections
About the project · 0.8.1

Local generator API

Generator UI requests and revision checks for integrating your own editor tool.

On this page

This API changes the project model: entities, fields, relationships and generation settings. It does not operate on application article/product records. Use it for editor-tool integration; regular work uses Generator UI and automation uses CLI.

Generator UI usage

Edit Project settings and Content, saving through Finish. The UI sends the current model revision to avoid overwriting newer changes. A stale state produces a conflict.

In Generate, Preview changes shows future changes, Generate applies them, and History stores results.

Startup and session

Start the local server through serve or start. Its session is separate from generated-admin accounts.

admingen-cli --path ./docs-demo serve --addr 127.0.0.1:8080
curl --fail http://127.0.0.1:8080/healthz

/healthz confirms generator-server availability, not generated-application readiness. The UI opens a local session through POST /api/session; protected requests send its Bearer token.

Reading models and settings

Method and path Result
GET /api/project Current project model.
PUT /api/project Save valid project settings.
GET /api/entities Entity list.
GET /api/model-editor Editor-formatted model data.
GET /api/modules Module list.
GET /api/modules/{moduleName} One module's data.
GET /api/plan Generation plan.
GET /api/history Result history.

Changing individual model parts

Method and path Action
POST /api/modules Create a module.
PUT/DELETE /api/modules/{moduleName} Edit/delete a module.
POST /api/entities/entity-draft Create an entity with revision checks.
PUT /api/entities/{entityName}/settings Change settings without replacing fields/relationships.
DELETE /api/entities/{entityName}/entity-draft Delete an entity.
POST /api/entities/{entityName}/field-draft Create a field with coordinated settings.
PUT/DELETE /api/entities/{entityName}/field-draft/{fieldName} Edit/delete a field.
POST /api/entities/{entityName}/relation-draft Create a relationship through the current editor.
POST /api/entities/{entityName}/collection-draft Create a collection.
PUT/DELETE /api/entities/{entityName}/collection-draft/{relationName} Edit/delete a collection.
PUT /api/entities/{entityName}/projection-fields Save virtual selections separately from other settings.

Lower-level routes also exist: POST /api/entities/{entityName}/fields, PUT/DELETE .../fields/{fieldName}, POST .../relations, PUT/DELETE .../relations/{relationName}. The current UI uses action-specific commands. Do not replace them with a complete stale entity copy, which can lose other changes.

Generation, recovery and renaming

POST /api/diff builds differences; POST /api/generate applies generation. GET /api/manifest-rollback previews restoration of the saved model; POST to the same address confirms it.

Rename through POST .../fields/{fieldName}/rename-preview and POST .../fields/{fieldName}/rename. These check expected revisions.

Request bodies must match handlers: arbitrary JSON PATCH cannot replace model/revision data. Reload the model after a stale-revision error. If an earlier request's result is unknown, Refresh state first. Recreating without checking may repeat an already-completed change.

HTTP errors contain message and an additional contractError; the format differs from CLI.

Choosing an interface

Use Generator UI manually and CLI for repeatable actions; it loads the model and constructs valid changes. Choose local HTTP API when integrating specifically with the editor, rather than the generated application's external API.