create_content
Create a new page, block, or global as a draft in Paperboy CMS, optionally under a parent. Pass field data in one call to fill it, or omit data for an empty shell.
Instructions
Create a new content item (page/block/global) as a draft. Pass the field content in data (field name → value, same shapes as update_content) to fill the page in ONE call — strongly preferred for a one-shot create. If you omit data it creates an EMPTY shell (name + auto slug only) that you MUST then fill with update_content/set_field, or the page stays blank. Either way: get_content_type first to learn the field names/shapes for this type. IMPORTANT: pages almost always belong UNDER an existing parent — a page's position decides its URL and which template the frontend renders it with (a blog post created at root gets a generic layout and looks empty when published). Call tree first and pass the right parentId (e.g. blog posts/articles go under their blog/list page). Omit parentId ONLY for genuinely top-level pages like the site's main sections. Under a LIST PAGE, the type must match what that page lists (its listedType): OMIT type to inherit it, or a mismatch is refused (the content would publish but never appear on the list).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | Initial field values (field name → value), same shapes as update_content. Provide this to create a FILLED draft in one call. Call get_content_type first for the field names/shapes. | |
| name | Yes | Display name of the item (also the source of a page's auto slug), e.g. 'Summer sale 2026'. | |
| site | No | Site slug or id to act in (multisite). Omit to use this server's default site. Call list_sites to see what exists — an empty tree or search usually means the wrong site, not missing content. | |
| slug | No | URL slug for a page. Omit to auto-derive from the name. | |
| type | No | Content type name. Under a list-page parent, OMIT to inherit the type that page lists; a mismatch is refused unless allowTypeMismatch. | |
| locale | No | The LANGUAGE BRANCH for this content — MATCH the language you are writing (Norwegian content → 'nb', English → 'en'). Call list_locales to see the site's branches. Defaults to the site default locale, which is usually English. | |
| parentId | No | documentId of the parent page. Required in practice for pages — find it with `tree`. Omit only for top-level pages. | |
| allowTypeMismatch | No | Set true ONLY for a deliberate sub-page whose type differs from the parent list page's listedType | |
| allowLanguageMismatch | No | Set true ONLY to deliberately create text whose language differs from the locale branch (the guard otherwise refuses, so e.g. Norwegian text can't silently land on the 'en' branch) |