Skip to main content
POST
/
sites
/
environments
/
{env_id}
/
redirect-rules
Update redirect rules
curl --request POST \
  --url https://api.kinsta.com/v2/sites/environments/{env_id}/redirect-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "action_type": "DELETE",
  "limit": 10,
  "offset": 3,
  "key": "domain",
  "order": "ascend",
  "search_query": "Search...",
  "regex_search": true,
  "rules_to_update": [
    {
      "domain": "kinsta.com",
      "from": "/redirect/from",
      "to": "/redirect/to",
      "type": "permanent",
      "traffic_from_city": "Nashville",
      "traffic_from_country": "US",
      "traffic_from_country_name": "United States",
      "displayed_location": "Nashvile, United States"
    }
  ],
  "new_value": {
    "domain": "kinsta.com",
    "from": "/redirect/from",
    "to": "/redirect/to",
    "type": "permanent",
    "traffic_from_city": "Nashville",
    "traffic_from_country": "US",
    "traffic_from_country_name": "United States",
    "displayed_location": "Nashvile, United States"
  }
}
'
{
  "message": "Bad request format",
  "status": 400,
  "data": "<unknown>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

env_id
string
required
Example:

"54fb80af-576c-4fdc-ba4f-b596c83f15a1"

Body

application/json
action_type
enum<string>
required
Available options:
DELETE,
DELETE_ALL,
NEW,
UPDATE
limit
number
default:10
Example:

10

offset
number
default:0
Example:

3

key
enum<string>
default:domain
Available options:
domain,
from,
to,
type
Example:

"domain"

order
enum<string>
default:ascend
Available options:
ascend,
descend
Example:

"ascend"

search_query
string
default:""
Example:

"Search..."

Available options:
true,
false
Example:

true

rules_to_update
object[]
new_value
object

Response

Successfully updated redirect rules