Skip to content

Content injection (SECTION elements)

The inject_page_section tool calls Duda’s Page Elements Create endpoint with type: "SECTION". The Duda app calls this content injection — useful for sticking reusable hero sections, CTAs, or footers onto pages programmatically.

inject_page_section
site_id="<duda-site-id>"
page_id="<page-uuid>"
element_source_id="<section-site-alias>"
next_sibling_id="<existing-element-id>" // optional — insert before this element
parent_element_id="<existing-container-id>" // optional — insert inside this container

Returns { type: "SECTION", element_id: "<new-id>", element_source_id, next_sibling_id }.

This is the site alias of a SECTION you’ve defined in the Duda dashboard. Find it by:

  1. Open the Duda editor
  2. Right-click on a SECTION (purple-bordered block)
  3. Set Site Alias → name it (eg hero-with-cta)
  4. Use that alias as element_source_id in MCP calls

Without a site alias, the section cannot be injected via API.

  • Default (no next_sibling_id or parent_element_id): appended to end of page body
  • With parent_element_id: appended inside that container
  • With next_sibling_id: inserted before that element
  • Currently only type: "SECTION" is supported by Duda — no widget-level injection
  • Injection is page-state-aware: if the page is PUBLISHED, the new section ends up STAGED until next site publish (this is Duda’s behaviour, not the worker’s)

The injection itself doesn’t publish anything — the page stays in whatever state it was. To take the change live: publish manually in Duda dashboard or flip the page to STAGED_DRAFT via update_page_draft.