Skip to main content

updateSitemap

Regenerate the project's sitemap.

Description​

Regenerates the project's sitemap from the base URLs in body.baseUrls, one per language. Resolves to the URLs of the generated sitemap files (string[]).

Every key in baseUrls must be an active project locale; otherwise the call resolves to a 400 error and nothing is changed. Always include en_US: its base URL is used for each <loc>, and the other locales are added as hreflang alternates. The other ISitemapQuery fields (url, lastmod, changefreq, priority) are ignored. The sitemap lists every page that has a URL, plus each product under every catalog page it belongs to, split into files of up to 50,000 URLs. Each call deletes the previously generated files before writing new ones.

.updateSitemap(

);

Parameters schema​

Schema

body(required): ISitemapQuery
Sitemap parameters, for example { baseUrls: { en_US: "https://…" } }.

body.baseUrls: Record<string, string>
Base URLs per language for sitemap generation.
example:

{ "en_US": "https://example.com/" }

body.url: string
URL of a single sitemap entry.

body.lastmod: string
Last modification date of the entry.

body.changefreq: string
How often the entry changes.

body.priority: number
Sitemap priority of the entry.

Examples​

Minimal example​


const body = {
: {
en_US: "https://example.com/",
},
};

const response = await Sitemap.updateSitemap(body);

Example response​

[
"https://your-project.oneentry.cloud/cloud-static/files/project/sitemap/sitemap-000.xml"
]

Response schema​

Schema: string[]