Create theme region rule
Create a new theme region rule
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). 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": "products/20lb-copy-paper",
"region_code": "CA",
"application_theme_id": 7312,
"application_theme_template_id": 22904,
"priority": 10,
"active": true,
"redirect_type": "template",
"description": "Canadian copy paper page with metric sheet sizes",
"resource_type": "Product",
"resource_id": 60318
}
}
'import requests
url = "https://api.fluid.app/api/theme_region_rules"
payload = { "theme_region_rule": {
"route_path": "products/20lb-copy-paper",
"region_code": "CA",
"application_theme_id": 7312,
"application_theme_template_id": 22904,
"priority": 10,
"active": True,
"redirect_type": "template",
"description": "Canadian copy paper page with metric sheet sizes",
"resource_type": "Product",
"resource_id": 60318
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
theme_region_rule: {
route_path: 'products/20lb-copy-paper',
region_code: 'CA',
application_theme_id: 7312,
application_theme_template_id: 22904,
priority: 10,
active: true,
redirect_type: 'template',
description: 'Canadian copy paper page with metric sheet sizes',
resource_type: 'Product',
resource_id: 60318
}
})
};
fetch('https://api.fluid.app/api/theme_region_rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/theme_region_rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'theme_region_rule' => [
'route_path' => 'products/20lb-copy-paper',
'region_code' => 'CA',
'application_theme_id' => 7312,
'application_theme_template_id' => 22904,
'priority' => 10,
'active' => true,
'redirect_type' => 'template',
'description' => 'Canadian copy paper page with metric sheet sizes',
'resource_type' => 'Product',
'resource_id' => 60318
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/theme_region_rules"
payload := strings.NewReader("{\n \"theme_region_rule\": {\n \"route_path\": \"products/20lb-copy-paper\",\n \"region_code\": \"CA\",\n \"application_theme_id\": 7312,\n \"application_theme_template_id\": 22904,\n \"priority\": 10,\n \"active\": true,\n \"redirect_type\": \"template\",\n \"description\": \"Canadian copy paper page with metric sheet sizes\",\n \"resource_type\": \"Product\",\n \"resource_id\": 60318\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/theme_region_rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"theme_region_rule\": {\n \"route_path\": \"products/20lb-copy-paper\",\n \"region_code\": \"CA\",\n \"application_theme_id\": 7312,\n \"application_theme_template_id\": 22904,\n \"priority\": 10,\n \"active\": true,\n \"redirect_type\": \"template\",\n \"description\": \"Canadian copy paper page with metric sheet sizes\",\n \"resource_type\": \"Product\",\n \"resource_id\": 60318\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/theme_region_rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"theme_region_rule\": {\n \"route_path\": \"products/20lb-copy-paper\",\n \"region_code\": \"CA\",\n \"application_theme_id\": 7312,\n \"application_theme_template_id\": 22904,\n \"priority\": 10,\n \"active\": true,\n \"redirect_type\": \"template\",\n \"description\": \"Canadian copy paper page with metric sheet sizes\",\n \"resource_type\": \"Product\",\n \"resource_id\": 60318\n }\n}"
response = http.request(request)
puts response.read_body{
"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,
"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,
"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>"
}Authorizations
Bearer token authentication
Body
Show child attributes
Show child attributes
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": "products/20lb-copy-paper",
"region_code": "CA",
"application_theme_id": 7312,
"application_theme_template_id": 22904,
"priority": 10,
"active": true,
"redirect_type": "template",
"description": "Canadian copy paper page with metric sheet sizes",
"resource_type": "Product",
"resource_id": 60318
}
}
'import requests
url = "https://api.fluid.app/api/theme_region_rules"
payload = { "theme_region_rule": {
"route_path": "products/20lb-copy-paper",
"region_code": "CA",
"application_theme_id": 7312,
"application_theme_template_id": 22904,
"priority": 10,
"active": True,
"redirect_type": "template",
"description": "Canadian copy paper page with metric sheet sizes",
"resource_type": "Product",
"resource_id": 60318
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
theme_region_rule: {
route_path: 'products/20lb-copy-paper',
region_code: 'CA',
application_theme_id: 7312,
application_theme_template_id: 22904,
priority: 10,
active: true,
redirect_type: 'template',
description: 'Canadian copy paper page with metric sheet sizes',
resource_type: 'Product',
resource_id: 60318
}
})
};
fetch('https://api.fluid.app/api/theme_region_rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/theme_region_rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'theme_region_rule' => [
'route_path' => 'products/20lb-copy-paper',
'region_code' => 'CA',
'application_theme_id' => 7312,
'application_theme_template_id' => 22904,
'priority' => 10,
'active' => true,
'redirect_type' => 'template',
'description' => 'Canadian copy paper page with metric sheet sizes',
'resource_type' => 'Product',
'resource_id' => 60318
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/theme_region_rules"
payload := strings.NewReader("{\n \"theme_region_rule\": {\n \"route_path\": \"products/20lb-copy-paper\",\n \"region_code\": \"CA\",\n \"application_theme_id\": 7312,\n \"application_theme_template_id\": 22904,\n \"priority\": 10,\n \"active\": true,\n \"redirect_type\": \"template\",\n \"description\": \"Canadian copy paper page with metric sheet sizes\",\n \"resource_type\": \"Product\",\n \"resource_id\": 60318\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/theme_region_rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"theme_region_rule\": {\n \"route_path\": \"products/20lb-copy-paper\",\n \"region_code\": \"CA\",\n \"application_theme_id\": 7312,\n \"application_theme_template_id\": 22904,\n \"priority\": 10,\n \"active\": true,\n \"redirect_type\": \"template\",\n \"description\": \"Canadian copy paper page with metric sheet sizes\",\n \"resource_type\": \"Product\",\n \"resource_id\": 60318\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/theme_region_rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"theme_region_rule\": {\n \"route_path\": \"products/20lb-copy-paper\",\n \"region_code\": \"CA\",\n \"application_theme_id\": 7312,\n \"application_theme_template_id\": 22904,\n \"priority\": 10,\n \"active\": true,\n \"redirect_type\": \"template\",\n \"description\": \"Canadian copy paper page with metric sheet sizes\",\n \"resource_type\": \"Product\",\n \"resource_id\": 60318\n }\n}"
response = http.request(request)
puts response.read_body{
"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,
"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,
"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>"
}