> 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

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/introduction.md

## Article Content:

# About the BWT Site Readiness API

The BWT Site Readiness API manages a site's presence in [Bing Webmaster Tools](https://www.bing.com/webmasters/about): it adds the site to the connected Bing account, verifies the site's ownership with Bing, submits its sitemap, and reads Bing's processing details for the submitted sitemaps. It acts through the Microsoft account linked to the site with the [BWT Connection API](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/connection-v1/introduction.md).

Every method works on the Wix site the call is made on, and everything needed is derived from that site. A site has a single readiness state, so no method takes an ID.

With the BWT Site Readiness API, you can:

- Check how far along the site is in Bing Webmaster Tools setup, and which step is still missing.
- Complete the setup steps: add the site to the connected Bing account, verify its ownership, and submit its sitemap.
- List the sitemaps submitted for the site, with Bing's processing details for each.
- Retrieve one submitted sitemap, and the sitemaps it lists when it's a sitemap index.
- Remove the verification tag that Wix placed on the site.

## How Bing Webmaster Tools setup works

A site becomes fully set up in Bing Webmaster Tools in this order:

1. Connect a Microsoft account, with the [BWT Connection API](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/connection-v1/introduction.md).
2. [Add Site](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/add-site.md): the site is added to the connected Bing account. Bing verifies only sites that are already in the account, so this step comes before verification.
3. [Verify Site](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/verify-site.md): the site's ownership is proven to Bing. This needs nothing from the Wix user: Wix places the `msvalidate.01` meta tag on every page of the site, then asks Bing to confirm it.
4. [Submit Sitemap](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/submit-sitemap.md): the sitemap, which is generated and hosted by Wix, is submitted to the connected Bing account.

[Get Site Readiness](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/get-site-readiness.md) reports whether steps 1 to 3 are in place, and if not, the first step that's still blocking. It checks, in order: the connection (`NOT_CONNECTED`), that the site is published (`SITE_NOT_PUBLISHED`), that it has a connected domain (`DOMAIN_NOT_CONNECTED`), that the site is in the Bing account (`SITE_NOT_ADDED`), and that its ownership is verified (`SITE_OWNER_NOT_VERIFIED`). It doesn't track the sitemap step, so call Submit Sitemap yourself once the site is `READY`.

## Verification tag

Verify Site places the `msvalidate.01` meta tag on the site and keeps it there, because Bing rechecks it. [Get Verification Token](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/get-verification-token.md) returns the same tag, for display only. The tag is issued for the connected Bing account.

[Clear Verification](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/clear-verification.md) removes the tag that Wix placed and also disconnects the site from its Bing account, so the site's blocking reason becomes `NOT_CONNECTED`. Other sites connected with the same Bing account stay connected. Neither Clear Verification nor Disconnect removes the site from Bing Webmaster Tools.

## Before you begin

It's important to note the following points before starting to code:

- A Microsoft account must be connected to the site first, with the [BWT Connection API](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/connection-v1/introduction.md). Until the site is connected, Add Site, Verify Site, Get Verification Token, Submit Sitemap, List Sitemaps, and Get Sitemap fail with `FAILED_PRECONDITION` (`MISSING_TOKEN`). Get Site Readiness doesn't fail: it returns `NOT_READY` with `NOT_CONNECTED`.
- The setup methods that write to Bing Webmaster Tools (Add Site, Verify Site, Submit Sitemap) require the site to be published, have a connected domain, and allow search-engine indexing. Otherwise they fail with `FAILED_PRECONDITION` (`SITE_NOT_PUBLISHED`, `DOMAIN_NOT_CONNECTED`, or `SITE_NOT_INDEXABLE`). Get Site Readiness doesn't report search-engine indexing, so a site can be `NOT_READY` with `SITE_NOT_ADDED` while Add Site fails with `SITE_NOT_INDEXABLE`.
- Calls that reach Bing are subject to Bing's throttling. A `RESOURCE_EXHAUSTED` (`BING_QUOTA_EXCEEDED`) error is safe to retry after the throttling window, and an `UNAVAILABLE` (`BING_UNAVAILABLE`) error is a temporary Bing failure that's safe to retry with backoff.
- Add Site, Verify Site, Clear Verification, and Disconnect in the BWT Connection API change the site's Bing connection or setup, so only one of them runs on a site at a time. One that overlaps another fails with `UNAVAILABLE` (`BWT_SITE_BUSY`). A Verify Site or Clear Verification that overlaps another change to the site's meta tags fails with `UNAVAILABLE` (`META_TAGS_WRITE_CONFLICT`). Both are safe to retry. The read methods and Submit Sitemap don't return `BWT_SITE_BUSY`.
- List Sitemaps reads the site's sitemaps from the connected Bing account, so it fails with `FAILED_PRECONDITION` (`SITE_PROPERTY_NOT_OWNED`) when the account hasn't added and verified the site.
- Sitemap details come from Bing as Bing reports them. `type` and `status` use Bing's vocabulary, for example `Sitemap Index` and `Success`, and a field Bing doesn't report is left unset rather than set to zero or `false`.

## Use cases

- [Set up a site in Bing Webmaster Tools](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/sample-flows.md#set-up-a-site-in-bing-webmaster-tools)
- [Show the site's sitemaps](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/sample-flows.md#show-the-sites-sitemaps)
- [Remove the site's Bing verification](https://dev.wix.com/docs/api-reference/business-management/seo/bing-webmaster-tools/site-readiness-v1/sample-flows.md#remove-the-sites-bing-verification)

## Terminology

- **Bing account**: The Bing Webmaster Tools account of the Microsoft account connected to the site. Add Site adds the site to it.
- **Site readiness**: The site's standing in Bing Webmaster Tools setup, as a computed status: `READY` when setup is complete, or `NOT_READY` with the first blocking step.
- **Sitemap index**: A sitemap that lists other sitemaps. Get Sitemap returns the sitemaps it lists in `childSitemaps`.
- **Verification token**: The value of the `msvalidate.01` meta tag that proves ownership of a site to Bing. Wix places it on the site when Verify Site runs.

@sdk_package_setup