Add a routing rule
Adds one rule to the site, targeting a fragment of this site (a paused one is accepted). Not repeatable: the same rule again is a 409. A site holds at most 200 rules.
Authorizations
A management token: ds_mgmt_ followed by 40 lowercase hexadecimal characters, created by an owner in Settings → Management tokens. Opaque: send it as is, in the Authorization header only.
Path Parameters
The site's bare domain, normalized like the console form (trimmed, lowercase). www.news-site.example and news-site.example are two different sites. A domain that is not a site of this organisation — absent, another organisation's, or not a valid domain — is 404, except on PUT /v1/sites/{domain}, which creates the site and answers 422 for an invalid domain.
Body
Send Content-Type: application/json and a JSON object of at most 262,144 bytes.
A path. Surrounding whitespace is trimmed first; the trimmed path is at most 512 characters (UTF-16 code units), and its stored canonical form at most 200: lowercase, wrapped in /, with canonical percent-encoding. No query, hash, inner whitespace, backslash, dot segment, repeated slash or invalid percent-encoding. Anything else is refused with 422.
exact or prefix. Surrounding whitespace is ignored; any other value is refused with 422. Stored and returned without the whitespace.
"prefix"
"exact"
The reference of a fragment of this site — a paused one is accepted — as a plain JSON string, exact and case-sensitive: it is not trimmed.
^[A-Za-z0-9/_.:-]{1,200}$Response
The rule was added.
A routing rule of a site: a path and a match mode that resolve to one fragment of the site.
The rule id. PUT …/routes gives every rule a new id.
The canonical path: lowercase, starting and ending with /, each segment percent-encoded (Actualite/ is stored as /actualite/).
exact, prefix The target fragment reference, or null when that fragment has no reference.
The target fragment id (frg_…).
