How to

Get list of CMS pages

Retrieve and display a list of CMS pages using tags to filter content with Geins Merchant API

Overview

Learn how to retrieve a list of your CMS pages from your Geins backend. This guide covers fetching pages with tag-based filtering, perfect for displaying campaign pages, landing pages, or any custom content.

Prerequisites

  • Merchant API key
  • CMS pages configured in your Geins backend
  • (Optional) Tags configured on your CMS pages

Goal

  • Fetch all CMS pages
  • Filter pages by tags (include/exclude)
  • Display a list of campaign pages

Architecture at a glance

  • Query CMS pages → Filter by tags → Display list → Link to individual pages

Step-by-step

Get all CMS pages

Retrieve all available CMS pages without any filtering.

Try it out in the GraphQL Playground using the query, headers and variables below.

Request example

query cmsPages(
  $channelId: String
  $languageId: String
  $marketId: String
) {
  cmsPages(
    channelId: $channelId
    languageId: $languageId
    marketId: $marketId
  ) {
    id
    name
    alias
    activeFrom
    activeTo
    tags
    meta {
      title
      description
      keywords
    }
    canonicalUrl
  }
}

Response example

200 OK
response.json
{
  "data": {
    "cmsPages": [
      {
        "id": 1,
        "name": "Summer Sale 2025",
        "alias": "summer-sale-2025",
        "activeFrom": "2025-06-01T00:00:00Z",
        "activeTo": "2025-08-31T23:59:59Z",
        "tags": ["campaign", "sale", "summer"],
        "meta": {
          "title": "Summer Sale 2025 - Up to 50% Off",
          "description": "Don't miss our biggest summer sale of the year!",
          "keywords": "summer, sale, discount, campaign"
        },
        "canonicalUrl": "/campaigns/summer-sale-2025"
      },
      {
        "id": 2,
        "name": "Black Friday 2025",
        "alias": "black-friday-2025",
        "activeFrom": "2025-11-29T00:00:00Z",
        "activeTo": "2025-11-29T23:59:59Z",
        "tags": ["campaign", "sale", "black-friday"],
        "meta": {
          "title": "Black Friday 2025 - Massive Savings",
          "description": "Amazing Black Friday deals on all products!",
          "keywords": "black friday, sale, deals"
        },
        "canonicalUrl": "/campaigns/black-friday-2025"
      },
      {
        "id": 3,
        "name": "About Us",
        "alias": "about-us",
        "activeFrom": null,
        "activeTo": null,
        "tags": ["info", "company"],
        "meta": {
          "title": "About Us - Our Story",
          "description": "Learn more about our company and mission.",
          "keywords": "about, company, information"
        },
        "canonicalUrl": "/about-us"
      }
    ]
  }
}

Filter pages by included/excluded tags

Retrieve only pages that have specific tags, such as campaign pages.

Request example

query cmsPages(
  $includeTags: [String]
  $excludeTags: [String]
  $channelId: String
  $languageId: String
  $marketId: String
) {
  cmsPages(
    includeTags: $includeTags
    excludeTags: $excludeTags
    channelId: $channelId
    languageId: $languageId
    marketId: $marketId
  ) {
    id
    name
    alias
    tags
    activeFrom
    activeTo
    meta {
      description
    }
    canonicalUrl
  }
}

Response example

200 OK
response.json
{
  "data": {
    "cmsPages": [
      {
        "id": 1,
        "name": "summer-sale-2025",
        "title": "Summer Sale 2025",
        "alias": "summer-sale-2025",
        "tags": ["campaign", "sale", "summer"],
        "activeFrom": "2025-06-01T00:00:00Z",
        "activeTo": "2025-08-31T23:59:59Z",
        "meta": {
          "description": "Don't miss our biggest summer sale of the year!"
        },
        "canonicalUrl": "/campaigns/summer-sale-2025"
      },
      {
        "id": 2,
        "name": "black-friday-2025",
        "title": "Black Friday 2025",
        "alias": "black-friday-2025",
        "tags": ["campaign", "sale", "black-friday"],
        "activeFrom": "2025-11-29T00:00:00Z",
        "activeTo": "2025-11-29T23:59:59Z",
        "meta": {
          "description": "Amazing Black Friday deals on all products!"
        },
        "canonicalUrl": "/campaigns/black-friday-2025"
      }
    ]
  }
}

Options

Multi-market support

All queries support optional parameters for multi-market functionality:

  • channelId: Target specific sales channels
  • languageId: Set content language
  • marketId: Target specific markets
Read more about channelId, languageId, and marketId in the how-to about using multi-market support.
Related