Skip to content

Create Sitemap

Creates a sitemap definition — the Create Sitemap action on the admin Marketing → Search & SEO → Sitemaps screen.

New here? Read the Sitemaps overview for what a sitemap does and how its fields behave.

Endpoint

EndpointMethod
/api/admin/marketing/sitemapsPOST

Details

  • Requires an admin Bearer token and the marketing.search_seo.sitemaps.create permission.
  • Returns the full sitemap payload.

One sitemap, one set of files per channel

A sitemap covers the channels you list, and generation writes an index plus its child files for each of them — a channel's own hostname, its root category and the products and pages assigned to it. urls returns the public index URL per channel, which is the link to submit to a search engine.

The XML is not built on save

Creating the row only registers the definition — generatedAt and generatedFiles stay empty. Call generate (POST /api/admin/marketing/sitemaps/{id}/generate) to build the XML files.

Request body

FieldTypeRequiredNotes
file_namestringyesIndex file name — letters, digits, -, _, .; must end with .xml
pathstringyesWhere the index file is written — must start and end with /, no //
channelsinteger[]yesChannel ids the sitemap covers. At least one — generation walks the channels, so a sitemap covering none produces no files

Released under the MIT License.