curl --request PUT \
--url https://api.1club.ai/v1/platform/website/redirects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redirects": [
{
"from": "<string>",
"to": "<string>"
}
]
}
'import requests
url = "https://api.1club.ai/v1/platform/website/redirects"
payload = { "redirects": [
{
"from": "<string>",
"to": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({redirects: [{from: '<string>', to: '<string>'}]})
};
fetch('https://api.1club.ai/v1/platform/website/redirects', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/website/redirects",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'redirects' => [
[
'from' => '<string>',
'to' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/website/redirects"
payload := strings.NewReader("{\n \"redirects\": [\n {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.1club.ai/v1/platform/website/redirects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"redirects\": [\n {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/website/redirects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"redirects\": [\n {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"redirects": [
{
"from": "<string>",
"to": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Replace the website's redirects
Sets the whole redirect list, replacing it - read GET /redirects first and send everything back with your changes. Edits the draft; publish the website to put the redirects live.
from is the old address: a path (/about-us.html), a path with its query (/index.php?page_id=12), a prefix ending in /* (/blog/*), or the old page’s full URL, whose host is dropped. It is matched without regard to case or a trailing slash, and in every language the site publishes. to is a path on the website (/about) or a full https:// URL; a prefix’s target may end in /* to carry the rest of the address over. The visitor’s query string travels on.
Refused: an address the website still answers (the homepage, one of its pages, or a built-in page such as /plans), the same address twice, and a loop. A chain is stored pointing straight at where it ends.
curl --request PUT \
--url https://api.1club.ai/v1/platform/website/redirects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redirects": [
{
"from": "<string>",
"to": "<string>"
}
]
}
'import requests
url = "https://api.1club.ai/v1/platform/website/redirects"
payload = { "redirects": [
{
"from": "<string>",
"to": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({redirects: [{from: '<string>', to: '<string>'}]})
};
fetch('https://api.1club.ai/v1/platform/website/redirects', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/website/redirects",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'redirects' => [
[
'from' => '<string>',
'to' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/website/redirects"
payload := strings.NewReader("{\n \"redirects\": [\n {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.1club.ai/v1/platform/website/redirects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"redirects\": [\n {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/website/redirects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"redirects\": [\n {\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"redirects": [
{
"from": "<string>",
"to": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Body
Was this page helpful?