Import a zone redirect map from CSV
Replaces or extends the zone's redirect map from a CSV upload (multipart field file).
CSV columns, in order:
source(required): the exact match key as "host/path", e.g.www.example.com/old. The host is lowercased; the path is kept as-is.target(required): the redirect destination - a full URL (e.g.https://www.example.com/new), or a bare host when mode isH.mode(optional, defaultL):L= literal (target is the final URL),Q= preserve-query (the incoming query string is appended to the target),H= host-swap (keep the incoming path, swap only the host).status(optional, default301): the HTTP redirect code, one of301,302,307,308.
A leading source,target header row is ignored, as are blank lines and lines starting with #. The multipart form field mode chooses "replace" (default - the upload becomes the entire map) or "append" (the upload is merged into the existing map).
Validation before storage: rows with a missing source/target, an invalid mode, or an invalid status are skipped; duplicate sources are rejected (the first is kept); redirect chains (A to B to C) are collapsed to a single hop (A to C); and cycles (A to B to A) are rejected. Skipped or rejected rows do not fail the request - the response reports how many entries were stored (imported), how many chains were collapsed (collapsed), and a message per problem row (errors).
Authorizations
Long-lived API token created via POST /api/api-tokens (returned once in plaintext). A token created with readOnly may only perform safe requests (GET, HEAD, OPTIONS); write requests are rejected on every endpoint.
JWT access token obtained via POST /api/auth/login. Send as: Authorization: Bearer
Parameters
Path Parameters
Zone identifier
Request Body
CSV file with columns "source,target[,mode][,status]" (an optional header row is ignored). See the endpoint description for each column's allowed values and defaults.
"binary""replace" (default) overwrites the whole map with the upload; "append" merges the upload into the existing map.
"replace""append""replace"Responses
redirect-map resource created
