Skip to content

List Sections

The sections a channel holds for a theme, in the order they are drawn, with footer_links last. Returns a plain array — the set is one channel's page layout, so it is not paginated.

Endpoint

MethodPathPurpose
GET/api/admin/appearance/themes/{code}/sectionsList the sections of a theme

Path parameters

ParameterDescription
codeTheme code, e.g. default.

Query parameters

ParameterDescription
channelChannel ID. Falls back to the current channel.
localeLocale the options are read in. Must be one the channel runs; otherwise the app locale, then the channel's first locale.

Response fields

FieldTypeDescription
idintegerSection ID.
namestringName shown in the editor.
typestringOne of the six section types.
themeCodestringTheme the section belongs to.
channelIdintegerChannel the section belongs to.
sortOrderintegerPublished position.
statusintegerPublished on/off — 1 or 0.
draftStatusboolean | nullStaged on/off, null when nothing is staged.
draftSortOrderinteger | nullStaged position, null when nothing is staged.
hasDraftbooleanWhether the section holds any staged edit.
isPinnedbooleantrue for footer_links, which is always drawn last.
createdAtstringISO 8601.
updatedAtstringISO 8601.
translationsarrayOne entry per locale that has content.
translations[].localestringLocale code.
translations[].optionsobject | nullPublished content.
translations[].draftOptionsobject | nullStaged content, null when nothing is staged.
messagestring | nullAction confirmation; null on reads.

Use cases

  • Draw the editor list — the array is already in render order, so a client renders it as returned rather than sorting by sortOrder (which would put a staged reorder in the wrong place and lift the footer).
  • Show a "you have unpublished changes" banner — true when any row has hasDraft.

Best practices

  • A section belongs to a theme and a channel together. Listing without channel returns the current channel's sections, which is rarely what a multi-channel editor wants — send the channel explicitly.
  • translations carries every locale the section has content for, not just the requested one. locale decides which locale the fields endpoint reads, not what this listing returns.

Errors

StatusWhen
404The installation has no theme with this code.

Permissions

Requires appearance.sections.

Released under the MIT License.