Help centerAPI referenceRoutes, headers & scripts
Routes, headers & scripts
Project rules (apply to every domain) and per-domain rules.
List project rules
/projects/{id}/rules/{kind}domains:readParameters
idpath · stringrequiredResource id (prj_…, dom_…)
kindpath · stringrequiredRule type: routes, headers or injections
Request
curl "https://api.tenanci.com/v2/projects/prj_8f3k2m/rules/<kind>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 200
{
"items": [
{
"id": "rte_2k9d7x",
"orgId": "org_5t1v",
"scopeType": "project",
"scopeId": "prj_8f3k2m",
"source": "/agendar",
"destination": "/booking",
"mode": "rewrite",
"enabled": true,
"position": 1,
"createdAt": "2026-10-14T12:00:00.000Z",
"updatedAt": "2026-10-14T12:00:00.000Z"
}
]
}Create a project rule
/projects/{id}/rules/{kind}domains:writeThe body depends on the type: routes {source, destination, mode}, headers {name, value, direction}, injections {content, injectAt}.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
kindpath · stringrequiredRule type: routes, headers or injections
Body
object
Request
curl -X POST "https://api.tenanci.com/v2/projects/prj_8f3k2m/rules/<kind>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"source":"/agendar","destination":"/booking","mode":"rewrite"}'Response 201
{
"id": "rte_2k9d7x",
"orgId": "org_5t1v",
"scopeType": "project",
"scopeId": "prj_8f3k2m",
"source": "/agendar",
"destination": "/booking",
"mode": "rewrite",
"enabled": true,
"position": 1,
"createdAt": "2026-10-14T12:00:00.000Z",
"updatedAt": "2026-10-14T12:00:00.000Z"
}List domain rules
/domains/{id}/rules/{kind}domains:readBy default, the rules in effect on the domain (the project's, or its own if the domain overrides). effective=false lists only the domain's own.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
kindpath · stringrequiredRule type: routes, headers or injections
effectivequery · "true" | "false"false: only the domain's own rules.
Request
curl "https://api.tenanci.com/v2/domains/dom_4h7n1q/rules/<kind>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 200
{
"items": [
{
"id": "rte_2k9d7x",
"orgId": "org_5t1v",
"scopeType": "project",
"scopeId": "prj_8f3k2m",
"source": "/agendar",
"destination": "/booking",
"mode": "rewrite",
"enabled": true,
"position": 1,
"createdAt": "2026-10-14T12:00:00.000Z",
"updatedAt": "2026-10-14T12:00:00.000Z"
}
]
}Create a domain rule
/domains/{id}/rules/{kind}domains:writeThe body depends on the type: routes {source, destination, mode}, headers {name, value, direction}, injections {content, injectAt}.
Parameters
idpath · stringrequiredResource id (prj_…, dom_…)
kindpath · stringrequiredRule type: routes, headers or injections
Body
object
Request
curl -X POST "https://api.tenanci.com/v2/domains/dom_4h7n1q/rules/<kind>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"name":"X-Frame-Options","value":"SAMEORIGIN","direction":"response"}'Response 201
{
"id": "hdr_7m2p",
"orgId": "org_5t1v",
"scopeType": "domain",
"scopeId": "dom_4h7n1q",
"enabled": true,
"position": 1,
"createdAt": "2026-10-14T12:00:00.000Z",
"updatedAt": "2026-10-14T12:00:00.000Z",
"name": "X-Frame-Options",
"value": "SAMEORIGIN",
"direction": "response"
}Update a rule
/rules/{kind}/{ruleId}domains:writeThe same fields as creation (all optional), plus enabled and position.
Parameters
kindpath · stringrequiredRule type: routes, headers or injections
ruleIdpath · stringrequiredRule id (rte_…, hdr_…, inj_…)
Body
enabledbooleanpositioninteger≥ 0, ≤ 9007199254740991
Request
curl -X PATCH "https://api.tenanci.com/v2/rules/<kind>/<ruleId>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"enabled":false}'Response 200
{
"id": "rte_2k9d7x",
"orgId": "org_5t1v",
"scopeType": "project",
"scopeId": "prj_8f3k2m",
"source": "/agendar",
"destination": "/booking",
"mode": "rewrite",
"enabled": false,
"position": 1,
"createdAt": "2026-10-14T12:00:00.000Z",
"updatedAt": "2026-10-14T12:00:00.000Z"
}Delete a rule
/rules/{kind}/{ruleId}domains:writeParameters
kindpath · stringrequiredRule type: routes, headers or injections
ruleIdpath · stringrequiredRule id (rte_…, hdr_…, inj_…)
Request
curl -X DELETE "https://api.tenanci.com/v2/rules/<kind>/<ruleId>" \
-H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"Response 204
Success

