Skip to main content
PUT
/
v1
/
sites
/
{site_id}
/
pricing
curl -X PUT https://xenarch.dev/v1/sites/b2c3d4e5.../pricing \
  -H "Authorization: Bearer xk_pub_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "default_price_usd": "0.003",
    "rules": [
      {"path_pattern": "/premium/*", "price_usd": "0.01"},
      {"path_pattern": "/api/*", "price_usd": "0.05"},
      {"path_pattern": "/public/*", "price_usd": "0"}
    ]
  }'
{
  "rules_applied": 123
}
curl -X PUT https://xenarch.dev/v1/sites/b2c3d4e5.../pricing \
  -H "Authorization: Bearer xk_pub_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "default_price_usd": "0.003",
    "rules": [
      {"path_pattern": "/premium/*", "price_usd": "0.01"},
      {"path_pattern": "/api/*", "price_usd": "0.05"},
      {"path_pattern": "/public/*", "price_usd": "0"}
    ]
  }'

Notes

  • path_pattern uses fnmatch-style globs: * matches a single segment, ** is not supported at the API level
  • Rules are evaluated in order — first match wins
  • A price of "0" makes the path free for bots
  • Replaces all existing rules for the site

Headers

authorization
string
required

Path Parameters

site_id
string<uuid>
required

Body

application/json
default_price_usd
required
Required range: 0 <= x <= 1
rules
PriceRuleItem · object[]

Response

Successful Response

rules_applied
integer
required