Create a sitemap route
Creates a route on your storefront’s Sitemap, which the API calls a theme region rule. The admin’s Sitemap page shows and edits the same rules.
To redirect a URL, create a sitemap route with route_path set to the old path (such as old-collection), region_code default, route_kind non_credit, redirect_type redirect, the destination in redirect_url, and redirect_status_code 301. The redirect then answers at /old-collection as a fallback: it applies to visitors from any country that has no matching country-specific rule on that route, and a country-specific rule still takes precedence.
A path under products/, pages/, collections/, categories/, media/,
enrollments/ or libraries/, or shop or join, is a built-in route: it can
take country rules but not a default redirect. The homepage / can’t take a
default redirect either; the API answers 422. Use this operation, not the
deprecated /api/redirects, whose redirects the Sitemap page doesn’t show.
Country routes are the per-country overrides on the Sitemap page.
A region rule controls what visitors from one region see at a storefront route:
a specific theme template (redirect_type: template), a redirect to
redirect_url (redirect), or no page at all (disabled). A redirect answers
with redirect_status_code: 301 (permanent) or 302 (temporary, the default).
Optionally point the
rule at a specific resource with resource_type and resource_id.
If application_theme_id is omitted, the rule is attached to your company’s
active theme. Requires a company admin or rep Bearer token with the
application_themes update permission.
This operation is an upsert keyed on theme, route_path, and region_code. When
no matching rule exists it creates one and returns 201. When one exists, the
request body replaces its state and the response is 200; omitted fields fall
back to their defaults (priority 0, active true, redirect_type
template). To change only some fields of an existing rule, use the update
operation instead.
curl --request POST \
--url https://api.fluid.app/api/theme_region_rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"theme_region_rule": {
"route_path": "old-copy-paper",
"region_code": "default",
"route_kind": "non_credit",
"redirect_type": "redirect",
"redirect_url": "/home/products/20lb-copy-paper",
"redirect_status_code": 301,
"description": "Old copy paper URL from the previous site"
}
}
'{
"theme_region_rule": {
"id": 48213,
"company_id": 1405,
"application_theme_id": 7312,
"application_theme_template_id": 22904,
"route_path": "products/20lb-copy-paper",
"region_code": "CA",
"priority": 10,
"active": true,
"redirect_type": "template",
"redirect_url": null,
"redirect_status_code": 302,
"description": "Canadian copy paper page with metric sheet sizes",
"resource_type": "Product",
"resource_id": 60318,
"route_kind": "credit_prefixed",
"created_at": "2026-09-08T13:15:22Z",
"updated_at": "2026-09-08T13:15:22Z"
},
"meta": {
"request_id": "5f0c9a2e-7b41-4d8e-9c36-1a2b8e4f7d90",
"timestamp": "2026-09-14T15:42:08Z"
}
}{
"theme_region_rule": {
"id": 48213,
"company_id": 1405,
"application_theme_id": 7312,
"application_theme_template_id": 22904,
"route_path": "products/20lb-copy-paper",
"region_code": "CA",
"priority": 10,
"active": true,
"redirect_type": "template",
"redirect_url": null,
"redirect_status_code": 302,
"description": "Canadian copy paper page with metric sheet sizes",
"resource_type": "Product",
"resource_id": 60318,
"route_kind": "credit_prefixed",
"created_at": "2026-09-08T13:15:22Z",
"updated_at": "2026-09-08T13:15:22Z"
},
"meta": {
"request_id": "5f0c9a2e-7b41-4d8e-9c36-1a2b8e4f7d90",
"timestamp": "2026-09-14T15:42:08Z"
}
}{
"message": "<string>"
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}curl --request POST \
--url https://api.fluid.app/api/theme_region_rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"theme_region_rule": {
"route_path": "old-copy-paper",
"region_code": "default",
"route_kind": "non_credit",
"redirect_type": "redirect",
"redirect_url": "/home/products/20lb-copy-paper",
"redirect_status_code": 301,
"description": "Old copy paper URL from the previous site"
}
}
'{
"theme_region_rule": {
"id": 48213,
"company_id": 1405,
"application_theme_id": 7312,
"application_theme_template_id": 22904,
"route_path": "products/20lb-copy-paper",
"region_code": "CA",
"priority": 10,
"active": true,
"redirect_type": "template",
"redirect_url": null,
"redirect_status_code": 302,
"description": "Canadian copy paper page with metric sheet sizes",
"resource_type": "Product",
"resource_id": 60318,
"route_kind": "credit_prefixed",
"created_at": "2026-09-08T13:15:22Z",
"updated_at": "2026-09-08T13:15:22Z"
},
"meta": {
"request_id": "5f0c9a2e-7b41-4d8e-9c36-1a2b8e4f7d90",
"timestamp": "2026-09-14T15:42:08Z"
}
}{
"theme_region_rule": {
"id": 48213,
"company_id": 1405,
"application_theme_id": 7312,
"application_theme_template_id": 22904,
"route_path": "products/20lb-copy-paper",
"region_code": "CA",
"priority": 10,
"active": true,
"redirect_type": "template",
"redirect_url": null,
"redirect_status_code": 302,
"description": "Canadian copy paper page with metric sheet sizes",
"resource_type": "Product",
"resource_id": 60318,
"route_kind": "credit_prefixed",
"created_at": "2026-09-08T13:15:22Z",
"updated_at": "2026-09-08T13:15:22Z"
},
"meta": {
"request_id": "5f0c9a2e-7b41-4d8e-9c36-1a2b8e4f7d90",
"timestamp": "2026-09-14T15:42:08Z"
}
}{
"message": "<string>"
}{
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
}