Skip to content

createAdminAppearanceSection

Adds a section to a theme and channel. The section is created switched off with a staged on-state, so it is drawn in the editor and its preview but not on the storefront until it has been built and published.

Content is not part of creation. Add it with createAdminAppearanceSectionDraft or updateAdminAppearanceSection afterwards.

Input fields

FieldTypeRequiredDescription
codeStringYesTheme the section belongs to.
channelIntNoChannel the section is created for. Falls back to the current channel.
nameStringYesName shown in the editor.
typeStringYesimage_carousel, product_carousel, category_carousel, footer_links, static_content or services_content.

Payload fields

The created section, same fields as adminAppearanceSection, with message set.

Use cases

  • Add a promo banner to one channel — create with type: "image_carousel", upload the slide through the REST media endpoint, stage the returned path, then publish.

Best practices

  • Do not select translations on the payload. A create mutation returns the section's own fields; its connections resolve empty. Re-query adminAppearanceSection for content.
  • status comes back 0 on purpose — a new section is off until published.
  • sortOrder is assigned, not chosen. The section is appended and the set renumbered, with footer_links kept last.
  • A channel gets one footer. A second footer_links section is rejected.

Permissions

Requires appearance.sections.create.

Released under the MIT License.