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.

Creating does not build the XML

Saving the row only stores the definition. To write the actual XML files, call the generate mutation explicitly — generatedAt and generatedFiles stay empty until then.

One sitemap, one set of files per channel

A sitemap covers the channels listed in channels, and generation writes an index plus its child files for each of them, using that channel's own hostname. urls returns the public index URL per channel, which is the link to submit to a search engine.

Operation

OperationTypePurpose
createAdminMarketingSitemapMutationCreate a sitemap definition

Details

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

Input fields

FieldTypeRequiredNotes
fileNameStringYesIndex file name — letters, digits, -, _, .; must end with .xml
pathStringYesDirectory the index file lives in — must start and end with /, no //
channels[Int]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.