---
title: "Pages API"
url: "https://adaptocms.com/docs/pages-api/"
source: adaptocms.com
---

# Pages API

The Pages API provides access to static pages — about pages, landing pages, legal pages, and any content organized in a hierarchical page structure. Pages support parent-child relationships, translations, and tags.

## Endpoints Overview

Method

Endpoint

Description

`GET`

`/v1/pages`

List pages (paginated)

`GET`

`/v1/pages/preview`

List page previews (lightweight)

`GET`

`/v1/pages/{page_id}`

Get page by ID

`GET`

`/v1/pages/by-slug/{slug}`

Get page by slug

* * *

## List Pages

```
GET /v1/pages
```

Returns a paginated list of pages.

### Query Parameters

Parameter

Type

Required

Description

`status`

string

No

Filter by status: `draft`, `published`, `archived`

`language`

string

No

Filter by language code

`tag`

string

No

Filter by tag

`field`

string

No

Sort field

`order`

string

No

Sort order: `asc` or `desc`

`page`

integer

No

Page number (default: 1)

`limit`

integer

No

Items per page (default: 20)

### Example Request

```
curl -X GET "https://public-api.adaptocms.com/v1/pages?language=en&status=published" \
  -H "x-api-key: YOUR_API_KEY"
```

### Example Response

```
{
  "items": [
    {
      "id": "page-001",
      "title": "About Us",
      "content": "<h2>Our Story</h2><p>We started in 2024...</p>",
      "slug": "about-us",
      "menu_label": "About",
      "parent_id": null,
      "language": "en",
      "tags": ["company"],
      "status": "published",
      "created_at": "2026-01-05T12:00:00",
      "updated_at": "2026-03-10T09:30:00",
      "published_at": "2026-01-06T08:00:00",
      "media_objects_placements": [],
      "translation_of_id": null,
      "custom_fields": {},
      "file_urls": null
    }
  ],
  "total": 8,
  "page": 1,
  "limit": 20,
  "pages": 1
}
```

* * *

## List Pages Preview

```
GET /v1/pages/preview
```

Returns a lightweight paginated list **without** `content`, `custom_fields`, `file_urls`, or `media_objects_placements`. Use this for building site navigation, menus, and sitemaps.

Accepts the same query parameters as `GET /v1/pages`.

### Example Request

```
curl -X GET "https://public-api.adaptocms.com/v1/pages/preview?language=en" \
  -H "x-api-key: YOUR_API_KEY"
```

### Example Response

```
{
  "items": [
    {
      "id": "page-001",
      "title": "About Us",
      "slug": "about-us",
      "menu_label": "About",
      "parent_id": null,
      "language": "en",
      "tags": ["company"],
      "status": "published",
      "created_at": "2026-01-05T12:00:00",
      "updated_at": "2026-03-10T09:30:00",
      "published_at": "2026-01-06T08:00:00",
      "translation_of_id": null
    }
  ],
  "total": 8,
  "page": 1,
  "limit": 20,
  "pages": 1
}
```

### Use Case: Building a Navigation Menu

```
// Fetch all page previews and build a hierarchical menu
const { items: pages } = await fetch(
  `${BASE_URL}/v1/pages/preview?language=en`,
  { headers: { 'x-api-key': API_KEY } }
).then(r => r.json());

// Build tree structure
const rootPages = pages.filter(p => p.parent_id === null);
const childPages = pages.filter(p => p.parent_id !== null);

const menu = rootPages.map(root => ({
  label: root.menu_label || root.title,
  slug: root.slug,
  children: childPages
    .filter(c => c.parent_id === root.id)
    .map(c => ({ label: c.menu_label || c.title, slug: c.slug }))
}));
```

* * *

## Get Page by ID

```
GET /v1/pages/{page_id}
```

### Path Parameters

Parameter

Type

Required

Description

`page_id`

string (UUID)

Yes

The unique identifier of the page

### Example Request

```
curl -X GET "https://public-api.adaptocms.com/v1/pages/page-001" \
  -H "x-api-key: YOUR_API_KEY"
```

* * *

## Get Page by Slug

```
GET /v1/pages/by-slug/{slug}
```

Retrieve a page by its URL-friendly slug. This is the primary method for page routing in front-end applications.

### Path Parameters

Parameter

Type

Required

Description

`slug`

string

Yes

The URL-friendly slug of the page

### Example Request

```
curl -X GET "https://public-api.adaptocms.com/v1/pages/by-slug/about-us" \
  -H "x-api-key: YOUR_API_KEY"
```

### Use Case: Page Routing in Next.js

```
// pages/[slug].tsx
export async function getStaticProps({ params }) {
  const page = await fetch(
    `https://public-api.adaptocms.com/v1/pages/by-slug/${params.slug}`,
    { headers: { 'x-api-key': process.env.ADAPTO_API_KEY } }
  ).then(r => r.json());

  return { props: { page }, revalidate: 60 };
}

export async function getStaticPaths() {
  const { items } = await fetch(
    'https://public-api.adaptocms.com/v1/pages/preview?language=en',
    { headers: { 'x-api-key': process.env.ADAPTO_API_KEY } }
  ).then(r => r.json());

  return {
    paths: items.map(p => ({ params: { slug: p.slug } })),
    fallback: 'blocking'
  };
}
```
