Skip to main content
POST
Add Section
Adds a section to a template, with the section’s preset (or default) settings and blocks. Requires the write_themes scope.

Request

Path Parameters

string
required
The theme id.
string
required
The template to add to. Templates are named as in the theme’s templates/ folder: index, product, product.alternate, customers/account (URL-encode the / in a path segment), and section groups such as header-group. A path such as templates/index.json is accepted too.

Body Parameters

string
required
The section to add: a file name in the theme’s sections/ folder, without the extension (e.g. rich-text). Which section types exist depends on the theme — list them with Theme Assets.
integer
Zero-based position in the template’s section order. Omit to add the section at the end.

Response

201 Created with the new section’s id under data.sectionId. Use it with Update Section Settings and Delete Section.

Error Codes