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

# Get Page Content (by Permalink)

POST https://api.customerhub.com/web_api/routes
Content-Type: application/json

**Use this to fetch the rendered content of a page** (a product page, a standalone page, or a page inside a collection). Given a permalink, it resolves the page and returns its fully compiled content — the same payload the experience app loads on every navigation.

**Where do permalinks come from?** From the other catalog endpoints: list products with `GET /products` (*Products & Library*), look up a page with `GET /pages/:id` or `GET /page?permalink=...` (*Pages*), or read the navigation/products in `GET /app` and `GET /dashboard`. Take the resulting permalink (e.g. `/product-slug/page-slug`) and pass it here.

**Authentication:** Public with visitor fallback.

**Request body:**
- `permalink` (required) — The full page permalink (e.g. `/product-slug/page-slug`)
- `collection` (optional) — Collection slug, when the page is being viewed within a collection context

**Response:**
- `item` — Page metadata (id, title, slug, type, access status)
- `user_product` — Product data when the page belongs to a product
- `collection` — Collection data when accessed within a collection context
- `page_version` — The page version being rendered
- `compiled_content` — Fully rendered content (Liquid templates compiled with app, brand, user, theme, and product drops)

**Access control:**
- If the page is locked (the user lacks access), only metadata is returned — `compiled_content` is omitted
- For products within collections, access is checked against the collection's product list

**Errors:**
- `401` — Access denied (the page requires authentication or product access)

Reference: https://customerhub.com/api/api-reference/routes-page-content/get-page-content-by-permalink

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects an object.

- `permalink` (string, optional)
- `collection` (string, optional)

## Response

### 200

OK

## Examples

**Request**

```json
{
  "permalink": "/product-slug/page-slug",
  "collection": ""
}
```

**Response**

```json
{
  "data": {
    "collection": null,
    "compiled_content": "<div class='app'></div>",
    "draft": false,
    "media": {},
    "page": {
      "allow_comments": false,
      "available": true,
      "available_on": null,
      "available_text": "",
      "comments_count": 1,
      "complete": false,
      "estimated_minutes": null,
      "id": "61243d86-e5d5-466f-b4fe-c09787380316",
      "permalink": "/getting-started/welcome",
      "product_id": "276c0669-64b7-4294-a8d3-30e5f1f77b6c",
      "settings": null,
      "slug": "welcome",
      "title": "Welcome",
      "type": "Pages::Standard"
    },
    "page_version": {
      "contents": {
        "columns": {},
        "contentBlocks": {},
        "media": {},
        "rows": {},
        "sections": {}
      },
      "id": "23185998-8234-49e1-ae2c-bdda9151f069",
      "updated_at": "2026-09-16 15:32:12 UTC"
    },
    "product": {
      "allow_comments": false,
      "available": true,
      "card_label": null,
      "card_style": "default",
      "checkout_url": null,
      "comments_count": 1,
      "delivery_user_advanced": false,
      "description": "Product description",
      "estimated_minutes_total": null,
      "id": "276c0669-64b7-4294-a8d3-30e5f1f77b6c",
      "image": "https://app.customerhub.com/images/media_defaults/image.png",
      "is_collection": false,
      "member_count": 1,
      "ordered_items": {
        "61243d86-e5d5-466f-b4fe-c09787380316": {
          "available": true,
          "available_on": null,
          "available_text": "",
          "complete": false,
          "draft": false,
          "estimated_minutes": null,
          "id": "61243d86-e5d5-466f-b4fe-c09787380316",
          "order": 0,
          "permalink": "/getting-started/welcome",
          "slug": "welcome",
          "title": "Welcome",
          "type": "Pages::Standard"
        }
      },
      "payment_link_id": null,
      "percent_complete": 0,
      "permalink": "/getting-started/next-page",
      "progress": false,
      "purchase_url": null,
      "sales_page": null,
      "show_menu": false,
      "slug": "getting-started",
      "title": "Getting Started",
      "total_pages": 1,
      "total_pages_complete": 0
    }
  }
}
```

**SDK Code**

```python Routes & Page Content_getPageContentByPermalink_example
import requests

url = "https://api.customerhub.com/web_api/routes"

payload = {
    "permalink": "/product-slug/page-slug",
    "collection": ""
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Routes & Page Content_getPageContentByPermalink_example
const url = 'https://api.customerhub.com/web_api/routes';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"permalink":"/product-slug/page-slug","collection":""}'
};

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

```go Routes & Page Content_getPageContentByPermalink_example
package main

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

func main() {

	url := "https://api.customerhub.com/web_api/routes"

	payload := strings.NewReader("{\n  \"permalink\": \"/product-slug/page-slug\",\n  \"collection\": \"\"\n}")

	req, _ := http.NewRequest("POST", 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(res)
	fmt.Println(string(body))

}
```

```ruby Routes & Page Content_getPageContentByPermalink_example
require 'uri'
require 'net/http'

url = URI("https://api.customerhub.com/web_api/routes")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"permalink\": \"/product-slug/page-slug\",\n  \"collection\": \"\"\n}"

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

```java Routes & Page Content_getPageContentByPermalink_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.customerhub.com/web_api/routes")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"permalink\": \"/product-slug/page-slug\",\n  \"collection\": \"\"\n}")
  .asString();
```

```php Routes & Page Content_getPageContentByPermalink_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.customerhub.com/web_api/routes', [
  'body' => '{
  "permalink": "/product-slug/page-slug",
  "collection": ""
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Routes & Page Content_getPageContentByPermalink_example
using RestSharp;

var client = new RestClient("https://api.customerhub.com/web_api/routes");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"permalink\": \"/product-slug/page-slug\",\n  \"collection\": \"\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Routes & Page Content_getPageContentByPermalink_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "permalink": "/product-slug/page-slug",
  "collection": ""
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.customerhub.com/web_api/routes")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```