Replace all routing rules
Replaces every rule of the site with the list sent. Rules missing from the list are deleted; {"routes": []} deletes them all. Read the current rules first.
The whole list is checked first — at most 200 rules, each path and match mode, each reference (a fragment of this site; a paused one is accepted), duplicates after canonicalization — then applied at once: on any error nothing changes. Every rule gets a new id; site and fragment ids never change.
The replacement is atomic within this request only. Nothing protects it from another client replacing the rules at the same time: the last write wins.
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.
The complete list of the site's rules. [] deletes them all. The same path and match mode may appear once, compared after canonicalization.
200Response
The site's rules after the replacement.
