Skip to content

Section Fields ​

The field set a section's type is built from, together with the values it currently holds. This is what makes a client-side editor possible without knowing the six types in advance: render the schema, fill it from options, and post the result back to Stage edits.

Endpoint ​

MethodPathPurpose
GET/api/admin/appearance/sections/{id}/fieldsGet the editable fields of a section

Path parameters ​

ParameterDescription
idSection ID.

Query parameters ​

ParameterDescription
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
sectionIdintegerSection the fields belong to.
typestringSection type the schema describes.
localestringLocale the options were read in.
schemaarrayThe field set for the type. Shape is decided by the type.
optionsobjectValues currently held — staged when there are any, otherwise published. Empty object for a section with no content yet.

Use cases ​

  • Render an editor for any section type — one code path handles all six, because the schema describes the fields and options supplies the values.
  • Round-trip an edit — read options here, change what the merchant edited, post the whole object to the draft endpoint.

Best practices ​

  • options resolves staged over published. A section holding a draft returns the draft, which is what the editor should show; read Get section when you specifically need the published values.
  • Ask per locale. The response covers the one locale requested, so a translation editor calls this once per locale rather than expecting them all at once.

Errors ​

StatusWhen
404No section with this ID.

Permissions ​

Requires appearance.sections.

Released under the MIT License.