Skip to main content

Overview

Use this endpoint to retrieve all published blog posts from your Marble CMS workspace. The response includes post metadata, content, authors, categories, and tags with pagination support.
curl "https://api.marblecms.com/v1/cm6ytuq9x0000i803v0isidst/posts"
{
  "posts": [
    {
      "id": "clt92n38p000108l48zkj41an",
      "slug": "introducing-marblecms",
      "title": "Introducing Marble",
      "content": "<h1>Hello World!</h1><p>This is the content of the post.</p>",
      "featured": true,
      "description": "The modern headless CMS for modern web applications.",
      "coverImage": "...",
      "publishedAt": "2024-03-05T00:00:00.000Z",
      "authors": [
        {
          "id": "clt92f96m000008l4gken6v2t",
          "name": "John Doe",
          "slug": "john-doe",
          "image": "...",
          "bio": "John is a software developer and writer.",
          "role": "Software Developer",
          "socials": [
            {
              "url": "https://twitter.com/johndoe",
              "platform": "x"
            }
          ]
        }
      ],
      "category": {
        "id": "clt92hrnp000208l43kbo28d0",
        "name": "Announcements",
        "slug": "announcements",
        "description": "Latest news and updates.",
        "count": {
          "posts": 5
        }
      },
      "tags": [
        {
          "id": "clt92k3c1000408l47h5f0b5y",
          "name": "Tutorials",
          "slug": "tutorials",
          "description": null,
          "count": {
            "posts": 12
          }
        }
      ],
      "attribution": null
    }
  ],
  "pagination": {
    "limit": 10,
    "currentPage": 1,
    "previousPage": null,
    "nextPage": 2,
    "totalPages": 13,
    "totalItems": 125
  }
}

Query Parameters

Use query parameters to paginate, sort, and filter the results.
limit
integer | "all"
default:"10"
Maximum number of items to return. Use all to return all posts in a single response.
page
integer
default:"1"
Page number to return. Applicable when limit is set to a number.
order
string
default:"desc"
Sort order by publishedAt. Accepted values: asc, desc.
category
string
Filter by category slug.
tags
string
Comma-separated list of tag slugs to filter by, e.g. tags=product,engineering.
query
string
Full-text search across title and content.
Responses include a pagination object with limit, currentPage, previousPage, nextPage, totalPages, and totalItems. For advanced usage and error cases (like invalid page numbers), see the Pagination guide.