> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# SubmitSitemap

# Package: bingWebmasterTools

# Namespace: BwtService

# Method link: https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/submit-sitemap.md

## Permission Scopes:
Manage SEO Settings: SCOPE.PROMOTE.MANAGE-SEO

## Introduction

Submits the site's sitemap to Bing Webmaster Tools.

Wix generates and hosts the site's sitemap; this method submits its URL
to the connected Bing account. Bing processes sitemaps asynchronously.
Check processing state with List Sitemaps.

Requires the site to be published, have a connected domain, and allow
search-engine indexing; otherwise fails with `FAILED_PRECONDITION`.

---

## REST API

### Schema

```
 Method: submitSitemap
 Description: Submits the site's sitemap to Bing Webmaster Tools.  Wix generates and hosts the site's sitemap; this method submits its URL to the connected Bing account. Bing processes sitemaps asynchronously. Check processing state with List Sitemaps.  Requires the site to be published, have a connected domain, and allow search-engine indexing; otherwise fails with `FAILED_PRECONDITION`.
 URL: https://www.wixapis.com/gsc/connection/v1/bing/submit-sitemap
 Method: POST
 Return type: SubmitSitemapResponse
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: SITE_NOT_INDEXABLE | Description: The site does not allow search-engine indexing.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: DOMAIN_NOT_CONNECTED | Description: The site has no connected domain.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: SITE_NOT_PUBLISHED | Description: The site is not published.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: SITE_PROPERTY_NOT_OWNED | Description: Reserved: not returned for a Wix site.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MISSING_TOKEN | Description: No Bing account is connected for this site. Connect one with the BWT Connection API first.
   HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: BING_QUOTA_EXCEEDED | Description: Bing throttled the request. Retry after the throttling window.
   HTTP Code: 503 | Status Code: UNAVAILABLE | Application Code: BING_UNAVAILABLE | Description: Bing answered with a temporary server error. Retry with backoff.


```

### Examples

### Submit Sitemap
```curl
curl -X POST \
'https://www.wixapis.com/bwt/v1/bing/submit-sitemap' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.bwt.siteReadiness.submitSitemap()
 Description: Submits the site's sitemap to Bing Webmaster Tools.  Wix generates and hosts the site's sitemap; this method submits its URL to the connected Bing account. Bing processes sitemaps asynchronously. Check processing state with List Sitemaps.  Requires the site to be published, have a connected domain, and allow search-engine indexing; otherwise fails with `FAILED_PRECONDITION`.
 Return type: PROMISE<SubmitSitemapResponse>
  EMPTY-OBJECT {}

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: SITE_NOT_INDEXABLE | Description: The site does not allow search-engine indexing.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: DOMAIN_NOT_CONNECTED | Description: The site has no connected domain.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: SITE_NOT_PUBLISHED | Description: The site is not published.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: SITE_PROPERTY_NOT_OWNED | Description: Reserved: not returned for a Wix site.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: MISSING_TOKEN | Description: No Bing account is connected for this site. Connect one with the BWT Connection API first.
   HTTP Code: 429 | Status Code: RESOURCE_EXHAUSTED | Application Code: BING_QUOTA_EXCEEDED | Description: Bing throttled the request. Retry after the throttling window.
   HTTP Code: 503 | Status Code: UNAVAILABLE | Application Code: BING_UNAVAILABLE | Description: Bing answered with a temporary server error. Retry with backoff.


```

### Examples

### Submit the site's sitemap to Bing Webmaster Tools
```javascript
import { siteReadiness } from "@wix/bwt";

async function submitSitemap() {
  await siteReadiness.submitSitemap();
}

```

### submitSitemap (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { siteReadiness } from '@wix/bwt';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { siteReadiness },
  // Include the auth strategy and host as relevant
});


async function submitSitemap() {
  const response = await myWixClient.siteReadiness.submitSitemap();
};
```

---