Add exclusion rules
Adds path rules, at most 50 per site. Each rule removes at once every page of source `sitemap` or `tag` whose path it matches (their starter questions stay) and keeps later imports and traffic from adding such pages again. Pages added by hand are never removed. A rule the site already holds is reported in `alreadyExcluded`. A malformed rule refuses the whole request with `invalid_exclusion_rule`, and going past 50 rules with `exclusion_rule_limit_reached`; nothing is changed then. Recorded in the audit log with counts only, attributed to the API key.
Authorization
ApiKeyAuth 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
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/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/exclusions" \ -H "Content-Type: application/json" \ -d '{ "rules": [ "blogs/*" ] }'{ "data": { "added": [ { "id": "spgx_01kvnwmagvf27rc9cze5rm9e1r", "rule": "blogs/*", "pagesRemoved": 60 } ], "alreadyExcluded": [], "pagesRemoved": 60 }}List a site's exclusions
Returns what the site keeps out of discovery, newest first: the addresses of pages removed after a sitemap import or shopper traffic found them, and path rules. Exclusions never apply to pages added by hand. `meta` carries the counts by kind. `limit` is 1 to 500 (100 by default).
Delete an exclusion
Removes a rule or an excluded address. Discovery may find its pages again from the next sitemap import or traffic run; nothing is restored at once. Recorded in the audit log, attributed to the API key. Returns the id and a deleted flag.