Replace a site's redirects
Replaces the whole table: send the version from the last read and every rule to keep, in the order they should be tried. A rule left out is removed.
Path parameters
The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.
Body
Every rule to keep, in the order they are tried. At most 2,000 rules, of which at most 500 are prefix or regex rules.
Fields of each item
Defaults to true.
The path to redirect, without a query string. For a regex rule, the pattern, at most 256 bytes. Up to 2,000 characters.
Limit the rule to some of the site's own domains. Null or left out on a new rule means every domain; left out on a saved rule keeps what it has.
A saved rule's id, to keep it. Leave it out, or send null, for a new rule. At least 1.
Whether the request's query string is carried over to the target. Send false when the target has a query string of its own. Defaults to true.
Up to 120 characters.
Defaults to 301.
301302A path or an https:// address. A regex rule may use $1 to $9. A target with a query string of its own is taken only with keep_query sent as false, and never on a prefix rule, where the rest of the path is added at its end. The limit is 2,000 bytes of the target as it is stored, not 2,000 characters as sent. The host is written in lower case and each character outside ASCII is percent-encoded, so é counts as six bytes (%C3%A9).
exactprefixregexThe version of the last read. A save with an older version is refused 409 stale. At least 0.
Returns
200 The table sent is the table the site already has. Nothing was started and operation is null.
201 The table was saved and is being applied. Follow operation.id until it completes.
Fields of the 200 answer
The change that applies the table. Null when the table sent is the one the site already has.
Fields
Whether a saved set of rules is live on the site.
Fields
Sent only by the sets that have more to say, such as HTTP authentication.
The change that is applying the set, while one is running.
Such as applied or applying.
The domains a rule can be limited to.
Fields of each item
The domain's role, such as primary or alias.
The formats import and export take.
Whether a rule can be limited to some domains at the moment.
The domains the site answers on.
Fields
Fields of each item
The domains the rule is limited to. Null for every domain.
The rule's id. Null for a rule that is not saved yet, as in an import or a test of unsaved rules.
The rule's place in the table, starting at 1. A rule whose path is the address asked for (an exact rule, or a prefix rule's own path) is taken first, whatever its position. Otherwise prefix and regex rules are tried in this order, and the first match wins. On a domain, the rules limited to it are taken this way before the rules for every domain.
The id of an earlier rule that always answers first, so this one never matches.
301302exactprefixregexFields of the 201 answer
The change that applies the table. Null when the table sent is the one the site already has.
Fields
Whether a saved set of rules is live on the site.
Fields
Sent only by the sets that have more to say, such as HTTP authentication.
The change that is applying the set, while one is running.
Such as applied or applying.
The domains a rule can be limited to.
Fields of each item
The domain's role, such as primary or alias.
The formats import and export take.
Whether a rule can be limited to some domains at the moment.
The domains the site answers on.
Fields
Fields of each item
The domains the rule is limited to. Null for every domain.
The rule's id. Null for a rule that is not saved yet, as in an import or a test of unsaved rules.
The rule's place in the table, starting at 1. A rule whose path is the address asked for (an exact rule, or a prefix rule's own path) is taken first, whatever its position. Otherwise prefix and regex rules are tried in this order, and the first match wins. On a domain, the rules limited to it are taken this way before the rules for every domain.
The id of an earlier rule that always answers first, so this one never matches.
301302exactprefixregexIf it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | feature_off | This feature is not on for your organisation yet. |
409 | busy | Another operation is running on the site. Wait for it to finish. |
409 | cluster_paused | Changes on this site are paused for planned maintenance; please try again later. |
409 | conflict | The action conflicts with the object's present state. Read the message. |
409 | deleted | The site, environment or copy has been deleted, or is being deleted. Nothing can be changed on it. Restore a deleted site first if it can still be restored. |
409 | managed_elsewhere | This site is read-only here. Change it in the control panel that manages it. |
409 | provisioning | The site is still being created. Try again in a few minutes. |
409 | removed | The site or environment is being removed, or has been. Nothing can be changed on it. |
409 | restore_running | A restore is running on the site. Wait for it to finish, then try again. |
409 | stale | What you read has changed since you read it. Read it again, then send the change with its new version or quote. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait for the seconds in Retry-After. |
502 | none | Read the message; it says what happened. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/redirects \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"rules": [
{
"enabled": true,
"from": "/about-us.html",
"id": 41,
"keep_query": true,
"note": "Old brochure page",
"status": 301,
"to": "/about",
"type": "exact"
},
{
"enabled": true,
"from": "/blog",
"hosts": [
"www.harbourandfinch.example.com"
],
"keep_query": true,
"status": 301,
"to": "/news",
"type": "prefix"
}
],
"version": 12
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->put('https://manage.corefinity.com/api/corestack/sites/1042/redirects', [
'rules' => [
[
'enabled' => true,
'from' => '/about-us.html',
'id' => 41,
'keep_query' => true,
'note' => 'Old brochure page',
'status' => 301,
'to' => '/about',
'type' => 'exact',
],
[
'enabled' => true,
'from' => '/blog',
'hosts' => [
'www.harbourandfinch.example.com',
],
'keep_query' => true,
'status' => 301,
'to' => '/news',
'type' => 'prefix',
],
],
'version' => 12,
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/redirects', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
rules: [
{
enabled: true,
from: '/about-us.html',
id: 41,
keep_query: true,
note: 'Old brochure page',
status: 301,
to: '/about',
type: 'exact',
},
{
enabled: true,
from: '/blog',
hosts: [
'www.harbourandfinch.example.com',
],
keep_query: true,
status: 301,
to: '/news',
type: 'prefix',
},
],
version: 12,
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.put(
"https://manage.corefinity.com/api/corestack/sites/1042/redirects",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"rules": [
{
"enabled": True,
"from": "/about-us.html",
"id": 41,
"keep_query": True,
"note": "Old brochure page",
"status": 301,
"to": "/about",
"type": "exact",
},
{
"enabled": True,
"from": "/blog",
"hosts": [
"www.harbourandfinch.example.com",
],
"keep_query": True,
"status": 301,
"to": "/news",
"type": "prefix",
},
],
"version": 12,
},
)
data = res.json() if res.content else None{
"operation": null,
"redirects": {
"apply": {
"applied_at": "2026-11-02T15:41:09Z",
"error": null,
"operation": null,
"state": "applied",
"state_label": "Applied"
},
"available_hosts": [
{
"host": "harbourandfinch.example.com",
"role": "primary"
},
{
"host": "www.harbourandfinch.example.com",
"role": "alias"
}
],
"formats": [
"nginx",
"apache",
"csv"
],
"host_scoping": true,
"hosts": [
"harbourandfinch.example.com",
"www.harbourandfinch.example.com"
],
"limits": {
"from_max": 2000,
"import_max_bytes": 524288,
"regex_max": 256,
"rules_max": 2000,
"to_max": 2000
},
"rules": [],
"version": 12
}
}{
"operation": {
"applied_at": null,
"can_retry": false,
"cluster": {
"id": 1017,
"name": "Northwind UK 1"
},
"committed_at": "2026-11-06T09:16:42Z",
"completed_at": null,
"created_at": "2026-11-06T09:16:40Z",
"environment": {
"env_id": "rs-harbourandfinch-example-com",
"hostname": "harbourandfinch-example-com.northwind.cfstack.example.net",
"id": 1042,
"name": "Production",
"role": "production",
"role_label": "Production",
"slug": "production"
},
"error": null,
"failure_reason": null,
"from_version": null,
"hot": true,
"id": 142,
"install": null,
"label": "Picked up by the platform",
"notes": [],
"parent_operation_id": null,
"requested_by": {
"id": 2041,
"name": "Eleanor Finch"
},
"reset_target": null,
"result": null,
"result_state": "none",
"retried_by_operation_id": null,
"retries_operation_id": null,
"retry_requires": null,
"revealed": null,
"scope": "site",
"site": {
"domain": "harbourandfinch.example.com",
"id": 1042
},
"status": "committed",
"status_label": "Waiting for the platform",
"step": "applied",
"steps": [
{
"key": "saved",
"label": "Saved",
"state": "done"
},
{
"key": "applied",
"label": "Picked up by the platform",
"state": "current"
},
{
"key": "live",
"label": "Live",
"state": "todo"
}
],
"subject": null,
"summary": "1 redirect rule",
"to_version": null,
"type": "redirects_change",
"type_label": "Redirects"
},
"redirects": {
"apply": {
"applied_at": "2026-11-02T15:41:09Z",
"error": null,
"operation": {
"id": 142,
"scope": "site",
"status": "committed",
"status_label": "Waiting for the platform",
"summary": "1 redirect rule",
"to_version": null,
"type": "redirects_change",
"type_label": "Redirects"
},
"state": "applying",
"state_label": "Applying"
},
"available_hosts": [
{
"host": "harbourandfinch.example.com",
"role": "primary"
},
{
"host": "www.harbourandfinch.example.com",
"role": "alias"
}
],
"formats": [
"nginx",
"apache",
"csv"
],
"host_scoping": true,
"hosts": [
"harbourandfinch.example.com",
"www.harbourandfinch.example.com"
],
"limits": {
"from_max": 2000,
"import_max_bytes": 524288,
"regex_max": 256,
"rules_max": 2000,
"to_max": 2000
},
"rules": [
{
"enabled": true,
"from": "/about-us.html",
"hosts": null,
"id": 41,
"keep_query": true,
"note": "Old brochure page",
"position": 1,
"shadowed_by": null,
"status": 301,
"to": "/about",
"type": "exact"
}
],
"version": 13
}
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "busy",
"message": "Another change to this site is in progress. Wait for it to finish.",
"reason": "busy"
}{
"code": "invalid",
"errors": {
"rules.1.status": [
"Rule 2: The status is 301 or 302"
]
},
"field": "rules.1.status",
"message": "Rule 2: The status is 301 or 302",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"message": "The platform returned an error (HTTP 503). Try again shortly."
}Try it is off for this endpointIt overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.