> 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.

# Upsert Page

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

Creates the page, or updates the one with the same **slug**. Needs a key with **Website Content: Read and Write** (`website-content:write`).

The body and rules are the same as **Create Page**. Sending an identical payload again writes nothing: no duplicate, the id is kept and `updated_at` does not change, so a migration can be re-run safely.

A soft-deleted page with the same slug is restored.

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

## 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.

- `name` (string, required)
- `slug` (string, required)
- `parent_slug` (string, required)
- `sort` (integer, required)
- `meta_title` (string, required)
- `meta_description` (string, required)
- `no_index` (boolean, required)
- `show_in_menu` (boolean, required)
- `contents` (list of ApiV1WebsiteContentWebsites7BwebsiteId7DPagesUpsertPutRequestBodyContentApplicationJsonSchemaContentsItems, required)

## Response

### 201

Created

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

## Types

### ApiV1WebsiteContentWebsites7BwebsiteId7DPagesUpsertPutRequestBodyContentApplicationJsonSchemaContentsItems

- `name` (string, required)
- `type` (string, required)
- `value` (string, required)

### ApiV1WebsiteContentWebsites7BwebsiteId7DPagesUpsertPutResponsesContentApplicationJsonSchemaData

- `id` (integer, required)
- `website_id` (integer, required)
- `name` (string, required)
- `slug` (string, required)
- `parent_id` (integer, required)
- `parent_slug` (string, required)
- `sort` (integer, required)
- `meta_title` (string, required)
- `meta_description` (string, required)
- `no_index` (boolean, required)
- `show_in_menu` (boolean, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `contents` (list of ApiV1WebsiteContentWebsites7BwebsiteId7DPagesUpsertPutResponsesContentApplicationJsonSchemaDataContentsItems, required)

### ApiV1WebsiteContentWebsites7BwebsiteId7DPagesUpsertPutResponsesContentApplicationJsonSchemaDataContentsItems

- `id` (integer, required)
- `name` (string, required)
- `type` (string, required)
- `editor_type` (string, required)
- `value` (string, required)
- `media` (list of any, required)
- `source` (string, required)

## Examples

**Request**

```json
{
  "name": "Board of Directors",
  "slug": "about/board-of-directors",
  "parent_slug": "about",
  "sort": 3,
  "meta_title": "Board",
  "meta_description": "Who runs the council",
  "no_index": false,
  "show_in_menu": true,
  "contents": [
    {
      "name": "Heading",
      "type": "text",
      "value": "Our board"
    },
    {
      "name": "Body",
      "type": "html",
      "value": "<p>Hello</p>"
    },
    {
      "name": "Banner Image",
      "type": "image",
      "value": "string",
      "media_id": 812
    }
  ]
}
```

**Response**

```json
{
  "success": true,
  "status": 201,
  "data": {
    "id": 5521,
    "website_id": 206,
    "name": "Board of Directors",
    "slug": "about/board-of-directors",
    "parent_id": 5520,
    "parent_slug": "about",
    "sort": 3,
    "meta_title": "Board",
    "meta_description": "Who runs the council",
    "no_index": false,
    "show_in_menu": true,
    "created_at": "2026-10-07T01:20:00+00:00",
    "updated_at": "2026-10-07T01:20:00+00:00",
    "contents": [
      {
        "id": 90209,
        "name": "Heading",
        "type": "text",
        "editor_type": "Short Text",
        "value": "Our board",
        "media": [],
        "source": "single"
      },
      {
        "id": 90210,
        "name": "Body",
        "type": "html",
        "editor_type": "Rich Text",
        "value": "<p>Hello</p>",
        "media": [],
        "source": "single"
      },
      {
        "id": 90211,
        "name": "Banner Image",
        "type": "image",
        "editor_type": "Single Image",
        "value": "string",
        "media": [
          {
            "id": 812,
            "url": "https://cdn.gorilladash.com/media/812/board.jpg"
          }
        ],
        "source": "single"
      }
    ]
  }
}
```

**SDK Code**

```python Website Content_Pages_Upsert Page_example
import requests

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

payload = {
    "name": "Board of Directors",
    "slug": "about/board-of-directors",
    "parent_slug": "about",
    "sort": 3,
    "meta_title": "Board",
    "meta_description": "Who runs the council",
    "no_index": False,
    "show_in_menu": True,
    "contents": [
        {
            "name": "Heading",
            "type": "text",
            "value": "Our board"
        },
        {
            "name": "Body",
            "type": "html",
            "value": "<p>Hello</p>"
        },
        {
            "name": "Banner Image",
            "type": "image",
            "value": "string",
            "media_id": 812
        }
    ]
}
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_Pages_Upsert Page_example
const url = 'https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/pages/upsert';
const options = {
  method: 'PUT',
  headers: {
    'GorillaDash-Api-Key': '{{API_KEY}}',
    'GorillaDash-Api-Secret': '{{GD_RESTFUL_SECRET}}',
    'Content-Type': 'application/json'
  },
  body: '{"name":"Board of Directors","slug":"about/board-of-directors","parent_slug":"about","sort":3,"meta_title":"Board","meta_description":"Who runs the council","no_index":false,"show_in_menu":true,"contents":[{"name":"Heading","type":"text","value":"Our board"},{"name":"Body","type":"html","value":"<p>Hello</p>"},{"name":"Banner Image","type":"image","value":"string","media_id":812}]}'
};

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

```go Website Content_Pages_Upsert Page_example
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"name\": \"Board of Directors\",\n  \"slug\": \"about/board-of-directors\",\n  \"parent_slug\": \"about\",\n  \"sort\": 3,\n  \"meta_title\": \"Board\",\n  \"meta_description\": \"Who runs the council\",\n  \"no_index\": false,\n  \"show_in_menu\": true,\n  \"contents\": [\n    {\n      \"name\": \"Heading\",\n      \"type\": \"text\",\n      \"value\": \"Our board\"\n    },\n    {\n      \"name\": \"Body\",\n      \"type\": \"html\",\n      \"value\": \"<p>Hello</p>\"\n    },\n    {\n      \"name\": \"Banner Image\",\n      \"type\": \"image\",\n      \"value\": \"string\",\n      \"media_id\": 812\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_Pages_Upsert Page_example
require 'uri'
require 'net/http'

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

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  \"name\": \"Board of Directors\",\n  \"slug\": \"about/board-of-directors\",\n  \"parent_slug\": \"about\",\n  \"sort\": 3,\n  \"meta_title\": \"Board\",\n  \"meta_description\": \"Who runs the council\",\n  \"no_index\": false,\n  \"show_in_menu\": true,\n  \"contents\": [\n    {\n      \"name\": \"Heading\",\n      \"type\": \"text\",\n      \"value\": \"Our board\"\n    },\n    {\n      \"name\": \"Body\",\n      \"type\": \"html\",\n      \"value\": \"<p>Hello</p>\"\n    },\n    {\n      \"name\": \"Banner Image\",\n      \"type\": \"image\",\n      \"value\": \"string\",\n      \"media_id\": 812\n    }\n  ]\n}"

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

```java Website Content_Pages_Upsert Page_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/pages/upsert")
  .header("GorillaDash-Api-Key", "{{API_KEY}}")
  .header("GorillaDash-Api-Secret", "{{GD_RESTFUL_SECRET}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Board of Directors\",\n  \"slug\": \"about/board-of-directors\",\n  \"parent_slug\": \"about\",\n  \"sort\": 3,\n  \"meta_title\": \"Board\",\n  \"meta_description\": \"Who runs the council\",\n  \"no_index\": false,\n  \"show_in_menu\": true,\n  \"contents\": [\n    {\n      \"name\": \"Heading\",\n      \"type\": \"text\",\n      \"value\": \"Our board\"\n    },\n    {\n      \"name\": \"Body\",\n      \"type\": \"html\",\n      \"value\": \"<p>Hello</p>\"\n    },\n    {\n      \"name\": \"Banner Image\",\n      \"type\": \"image\",\n      \"value\": \"string\",\n      \"media_id\": 812\n    }\n  ]\n}")
  .asString();
```

```php Website Content_Pages_Upsert Page_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/pages/upsert', [
  'body' => '{
  "name": "Board of Directors",
  "slug": "about/board-of-directors",
  "parent_slug": "about",
  "sort": 3,
  "meta_title": "Board",
  "meta_description": "Who runs the council",
  "no_index": false,
  "show_in_menu": true,
  "contents": [
    {
      "name": "Heading",
      "type": "text",
      "value": "Our board"
    },
    {
      "name": "Body",
      "type": "html",
      "value": "<p>Hello</p>"
    },
    {
      "name": "Banner Image",
      "type": "image",
      "value": "string",
      "media_id": 812
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'GorillaDash-Api-Key' => '{{API_KEY}}',
    'GorillaDash-Api-Secret' => '{{GD_RESTFUL_SECRET}}',
  ],
]);

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

```csharp Website Content_Pages_Upsert Page_example
using RestSharp;

var client = new RestClient("https://api.gorilladash.com/api/v1/website-content/websites/%7BWEBSITE_ID%7D/pages/upsert");
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  \"name\": \"Board of Directors\",\n  \"slug\": \"about/board-of-directors\",\n  \"parent_slug\": \"about\",\n  \"sort\": 3,\n  \"meta_title\": \"Board\",\n  \"meta_description\": \"Who runs the council\",\n  \"no_index\": false,\n  \"show_in_menu\": true,\n  \"contents\": [\n    {\n      \"name\": \"Heading\",\n      \"type\": \"text\",\n      \"value\": \"Our board\"\n    },\n    {\n      \"name\": \"Body\",\n      \"type\": \"html\",\n      \"value\": \"<p>Hello</p>\"\n    },\n    {\n      \"name\": \"Banner Image\",\n      \"type\": \"image\",\n      \"value\": \"string\",\n      \"media_id\": 812\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Website Content_Pages_Upsert Page_example
import Foundation

let headers = [
  "GorillaDash-Api-Key": "{{API_KEY}}",
  "GorillaDash-Api-Secret": "{{GD_RESTFUL_SECRET}}",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Board of Directors",
  "slug": "about/board-of-directors",
  "parent_slug": "about",
  "sort": 3,
  "meta_title": "Board",
  "meta_description": "Who runs the council",
  "no_index": false,
  "show_in_menu": true,
  "contents": [
    [
      "name": "Heading",
      "type": "text",
      "value": "Our board"
    ],
    [
      "name": "Body",
      "type": "html",
      "value": "<p>Hello</p>"
    ],
    [
      "name": "Banner Image",
      "type": "image",
      "value": "string",
      "media_id": 812
    ]
  ]
] 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/pages/upsert")! 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()
```