iAdvizeDocs

Import pages from the sitemap

Starts a sitemap import for the site and answers at once with the import. The import runs in the background: it finds the sitemap (the given address, else robots.txt, then the usual places), reads it within size bounds and adds the pages it lists as `discovered`, within the site's page limit and its exclusions. Discovered pages are read only on request or by automatic reading. Follow the import at `GET .../pages/imports/{importId}`. A sitemap address that is not on the site is refused with `sitemap_not_on_site` and no request is made to it; a second import while one runs is refused with `discovery_already_running`. The answer is `202` when the import was handed to the background, and `200` with the import closed as `failed` when it could not be started. Recorded in the audit log, attributed to the API key.

POST
/api/v1/sites/{siteId}/pages/discover

Authorization

ApiKeyAuth
AuthorizationBearer <token>

A WorkOS org-scoped API key, created from the dashboard's organization settings page. Identifies the tenant every read and write is scoped to. Missing, malformed, unknown, revoked, expired, or non-organization-owned keys all return 401 (no distinction, so the response can't be used to probe which keys or org ids exist).

In: header

Path Parameters

siteId*string

The site id (prefixed site_). A site id that isn't yours is a 404, same as any other cross-tenant id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/api/v1/sites/string/pages/discover" \  -H "Content-Type: application/json" \  -d '{    "sitemapUrl": "https://shop.example/sitemap.xml"  }'
{  "data": {    "id": "string",    "state": "running",    "outcome": "completed",    "startedBy": "member",    "sitemapGiven": true,    "counts": {      "sitemapSource": "given",      "documentsRead": 0,      "documentsFailed": {        "address_not_allowed": 0,        "not_on_site": 0,        "redirected_off_site": 0,        "too_many_redirects": 0,        "not_found": 0,        "http_error": 0,        "timed_out": 0,        "unreachable": 0,        "not_a_sitemap": 0,        "unreadable": 0      },      "found": 0,      "created": 0,      "alreadyHeld": 0,      "excluded": 0,      "refused": {        "not_a_valid_address": 0,        "contains_wildcard": 0,        "not_on_site": 0,        "too_long": 0,        "not_a_page": 0      },      "overCap": 0,      "createdByType": [        {          "key": "string",          "count": 0        }      ],      "createdByTypeRest": 0,      "createdByLanguageHint": [        {          "key": "string",          "count": 0        }      ],      "createdByLanguageHintRest": 0    },    "boundsReached": [      "max_bytes"    ],    "startedAt": "2019-08-24T14:15:22Z",    "endedAt": "2019-08-24T14:15:22Z"  }}