Action registry & content admin API¶
The action registry is the forge generation recipe stored in cms_db
(ai_actions, ai_steps, ai_action_steps) and edited through this service's
/admin/v1 block. cms-api owns the CRUD and the resolve endpoint that
cms-ai-forge calls at plan time; the table schema, history mirrors, and triggers
are documented on the
cms-db action registry page.
Every route below is mounted under /admin/v1 behind a single mount-level
validate_admin dependency (a Bearer JWT resolved against a Redis session) --
see Auth flow. The actions/resolve/{name} route is the one the
forge service account calls; the rest are editorial CRUD for operators.
Action registry endpoints¶
| Method | Path | Purpose |
|---|---|---|
| GET | /admin/v1/actions |
List actions (paginated). |
| POST | /admin/v1/actions |
Create an action -- 409 on duplicate name. |
| GET | /admin/v1/actions/resolve/{name} |
Resolve the recipe -- the action plus its steps, ordered by position with definitions inlined. 404 if the action has no steps. |
| GET / PATCH / DELETE | /admin/v1/actions/{id} |
Get, update, delete a single action. |
| GET / POST | /admin/v1/actions/{id}/steps |
List / bind a step (step_id, position, chain, params). |
| PATCH / DELETE | /admin/v1/actions/{id}/steps/{action_step_id} |
Reorder / rebind / unbind. |
| GET / POST | /admin/v1/steps |
List / create a step -- 409 on duplicate slug. |
| GET / PATCH / DELETE | /admin/v1/steps/{id} |
Get, update, delete a step definition. |
The resolve contract¶
GET /admin/v1/actions/resolve/{name} returns ActionResolvedOut -- the action
plus a ai_steps array of ResolvedStepOut, each flattening the step definition
onto its ordered binding (so the forge executor needs no second call):
{
"id": 3, "name": "site_scaffold", "is_active": true,
"steps": [
{
"action_step_id": 12, "step_id": 7, "position": 0, "chain": false,
"slug": "generate_settings", "entity_type": "settings",
"output_schema": { }, "required_keys": ["meta_title", "nav"],
"prompt_template": "You are setting up ...", "provider_kind": "openai_text",
"params": null
}
]
}
Note ResolvedStepOut uses action_step_id for the binding row (the plain
ActionStepOut calls the same id id and nests the step under a step object);
the resolve endpoint flattens it and omits the step's is_active.
Content lineage & editorial endpoints (AISD-182–186)¶
Added this cycle alongside the registry work. These operate on the existing
content table's lineage columns (content_parent_id, creator_source) and the
visible_in_ui flag -- no new tables.
| Method | Path | Purpose |
|---|---|---|
| GET | /admin/v1/content?q=&include_hidden= |
List content. q is a case-insensitive substring search across title, description, and slug; only visible_in_ui = true rows are returned unless include_hidden=true (AISD-183 / 182). |
| POST | /admin/v1/content/{id}/duplicate |
Same-site editorial clone into a new draft child: new unique slug, creator_source='duplicate', content_parent_id set to the source, blocks/media copied via the create path. 404 if source missing (AISD-186). |
| GET | /admin/v1/content/{id}/children |
List rows whose content_parent_id == id; [] for a childless parent (AISD-186). |
| GET | /admin/v1/sites/{site_id}/content/slug-available |
{ available, conflicting_content_id } for a slug (with optional exclude_content_id for edit flows) (AISD-184). |
| POST | /admin/v1/auth/forgot-password · /reset-password |
No-enumeration password reset: forgot always 202; reset consumes a one-time token and sets the password, generic 400 on any bad/used/expired token (AISD-185). |
Editorial duplicate is not forge copy
POST /content/{id}/duplicate is a same-site editorial clone with
parent/child lineage. It is distinct from the forge's multi-site pipeline copy
(cms_copy / transfer_article_to_site), which stays in cms-ai-forge.
Both stores implement every endpoint above with identical signatures -- see
Store design (SQL vs memory). The visible_in_ui,
content_parent_id, and creator_source fields are exposed on ContentOut;
visible_in_ui is settable on create/update.