> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.gorilladash.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.gorilladash.com/_mcp/server.

# Bulk Upsert Redirects

PUT https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/redirects/bulk
Content-Type: application/json

Creates or updates up to **500** redirects in one call, matched on `from`. Needs a key with **Website Content: Read and Write** (`website-content:write`).

| Field | Type | Rules |
| --- | --- | --- |
| `redirects` | array | Required, 1–500 items. |
| `redirects.*.from` | string | Required. Each path once per call. Same rules as **Create Redirect**. |
| `redirects.*.to` | string | Required. Same rules as **Create Redirect**. |

Everything is written in one transaction. The response returns counts, not the rows. Split a larger list into calls of 500.

Reference: https://docs.gorilladash.com/gorilla-dash-rest-ful-api/website-content/redirects/bulk-upsert-redirects

## Request

### Headers

- `GorillaDash-Api-Key` (string, optional) — Gorilla Dash API Key
- `GorillaDash-Api-Secret` (string, optional) — Gorilla Dash API Secret

### Body (application/json)

This endpoint expects an object.

- `redirects` (list of ApiV1WebsiteContentWebsites7BwebsiteId7DRedirectsBulkPutRequestBodyContentApplicationJsonSchemaRedirectsItems, required)

## Response

### 201

Created

- `success` (boolean, required)
- `status` (integer, required)
- `data` (ApiV1WebsiteContentWebsites7BwebsiteId7DRedirectsBulkPutResponsesContentApplicationJsonSchemaData, required)

## Errors

### 422 Unprocessable Entity Error

Unprocessable Content

- `message` (string, required)
- `errors` (ApiV1WebsiteContentWebsites7BwebsiteId7DRedirectsBulkPutResponsesContentApplicationJsonSchemaErrors, required)

## Types

### ApiV1WebsiteContentWebsites7BwebsiteId7DRedirectsBulkPutRequestBodyContentApplicationJsonSchemaRedirectsItems

- `from` (string, required)
- `to` (string, required)

### ApiV1WebsiteContentWebsites7BwebsiteId7DRedirectsBulkPutResponsesContentApplicationJsonSchemaData

- `created` (integer, required)
- `updated` (integer, required)
- `unchanged` (integer, required)

### ApiV1WebsiteContentWebsites7BwebsiteId7DRedirectsBulkPutResponsesContentApplicationJsonSchemaErrors

- `redirects.1.from` (list of string, required)

## Examples

**Request**

```json
{
  "redirects": [
    {
      "from": "/NAB",
      "to": "https://www.nab.com.au/"
    },
    {
      "from": "/resource/franchising-code",
      "to": "/resources/"
    }
  ]
}
```

**Response**

```json
{
  "success": true,
  "status": 201,
  "data": {
    "created": 2,
    "updated": 0,
    "unchanged": 0
  }
}
```

**SDK Code**

```python Website Content_Redirects_Bulk Upsert Redirects_example
import requests

url = "https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/redirects/bulk"

payload = { "redirects": [
        {
            "from": "/NAB",
            "to": "https://www.nab.com.au/"
        },
        {
            "from": "/resource/franchising-code",
            "to": "/resources/"
        }
    ] }
headers = {
    "GorillaDash-Api-Key": "{{API_KEY}}",
    "GorillaDash-Api-Secret": "{{GD_RESTFUL_SECRET}}",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Website Content_Redirects_Bulk Upsert Redirects_example
const url = 'https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/redirects/bulk';
const options = {
  method: 'PUT',
  headers: {
    'GorillaDash-Api-Key': '{{API_KEY}}',
    'GorillaDash-Api-Secret': '{{GD_RESTFUL_SECRET}}',
    'Content-Type': 'application/json'
  },
  body: '{"redirects":[{"from":"/NAB","to":"https://www.nab.com.au/"},{"from":"/resource/franchising-code","to":"/resources/"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Website Content_Redirects_Bulk Upsert Redirects_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/redirects/bulk"

	payload := strings.NewReader("{\n  \"redirects\": [\n    {\n      \"from\": \"/NAB\",\n      \"to\": \"https://www.nab.com.au/\"\n    },\n    {\n      \"from\": \"/resource/franchising-code\",\n      \"to\": \"/resources/\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("GorillaDash-Api-Key", "{{API_KEY}}")
	req.Header.Add("GorillaDash-Api-Secret", "{{GD_RESTFUL_SECRET}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Website Content_Redirects_Bulk Upsert Redirects_example
require 'uri'
require 'net/http'

url = URI("https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/redirects/bulk")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["GorillaDash-Api-Key"] = '{{API_KEY}}'
request["GorillaDash-Api-Secret"] = '{{GD_RESTFUL_SECRET}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"redirects\": [\n    {\n      \"from\": \"/NAB\",\n      \"to\": \"https://www.nab.com.au/\"\n    },\n    {\n      \"from\": \"/resource/franchising-code\",\n      \"to\": \"/resources/\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Website Content_Redirects_Bulk Upsert Redirects_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/redirects/bulk")
  .header("GorillaDash-Api-Key", "{{API_KEY}}")
  .header("GorillaDash-Api-Secret", "{{GD_RESTFUL_SECRET}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"redirects\": [\n    {\n      \"from\": \"/NAB\",\n      \"to\": \"https://www.nab.com.au/\"\n    },\n    {\n      \"from\": \"/resource/franchising-code\",\n      \"to\": \"/resources/\"\n    }\n  ]\n}")
  .asString();
```

```php Website Content_Redirects_Bulk Upsert Redirects_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/redirects/bulk', [
  'body' => '{
  "redirects": [
    {
      "from": "/NAB",
      "to": "https://www.nab.com.au/"
    },
    {
      "from": "/resource/franchising-code",
      "to": "/resources/"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'GorillaDash-Api-Key' => '{{API_KEY}}',
    'GorillaDash-Api-Secret' => '{{GD_RESTFUL_SECRET}}',
  ],
]);

echo $response->getBody();
```

```csharp Website Content_Redirects_Bulk Upsert Redirects_example
using RestSharp;

var client = new RestClient("https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/redirects/bulk");
var request = new RestRequest(Method.PUT);
request.AddHeader("GorillaDash-Api-Key", "{{API_KEY}}");
request.AddHeader("GorillaDash-Api-Secret", "{{GD_RESTFUL_SECRET}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"redirects\": [\n    {\n      \"from\": \"/NAB\",\n      \"to\": \"https://www.nab.com.au/\"\n    },\n    {\n      \"from\": \"/resource/franchising-code\",\n      \"to\": \"/resources/\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Website Content_Redirects_Bulk Upsert Redirects_example
import Foundation

let headers = [
  "GorillaDash-Api-Key": "{{API_KEY}}",
  "GorillaDash-Api-Secret": "{{GD_RESTFUL_SECRET}}",
  "Content-Type": "application/json"
]
let parameters = ["redirects": [
    [
      "from": "/NAB",
      "to": "https://www.nab.com.au/"
    ],
    [
      "from": "/resource/franchising-code",
      "to": "/resources/"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/redirects/bulk")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```