SEO

PUT Upload a custom sitemap and trigger sitemap generation process.

PUT /organizations/{organizationId}/sitemap

Operation ID: uploadCustomSitemapAndTriggerSitemapGeneration. Security: AmOAuth2 (sfcc.seo.rw).

This API uploads a custom sitemap and triggers the sitemap generation process.

Parameters

  • organizationId (path, OrganizationId, required) An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character realm identifier and a 3-character instance type identifier.

    Example

    f_ecom_zzxy_prd
  • siteId (query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.

    Example: SiteId

    RefArch

Request body (required)

Media type: multipart/form-data. Schema: SitemapRequest.

Example: sitemapRequestBody

{
  "customSitemapFile": "sitemap.xml",
  "hostname": "secure.sitegenesis.com"
}

Responses

  • 202 The site generation process runs asynchronously and takes a few minutes to complete. The generated sitemap is available at the location specified in the location header.

    Headers:

    • Location (Location) The generated sitemap location url
  • 400 Bad request

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: putSitemap400

    {
      "title": "Bad Request",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/validation",
      "detail": "The custom sitemap must be an XML file."
    }
  • 404 The given hostname was not found in the alias file.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: putSitemap404

    {
      "title": "The given hostname was not found in the alias file.",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors",
      "detail": "The hostname was not found in the alias file.",
      "hostname": "www.abc.com"
    }
  • 409 The requested action could not be completed because the job is currently running and its state is being updated.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: putSitemap409

    {
      "title": "Sitemap Generation In Progress",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/validation",
      "detail": "The previous generate sitemap request has not completed."
    }