v1

latestOpenAPI 3.1.02026-07-13305453.8 KB
Posts

Get post

Get a single post by ID or slug, with optional status filtering

get/v1/posts/{identifier}

Path parameters

identifierstring required

Post ID or slug

Example:my-post-slug

Post ID or slug

Query parameters

format'html' | 'markdown'

Content format (html or markdown)

Example:html

Content format (html or markdown)

status'published' | 'draft' | 'all'

Filter by post status. Use 'published' for live posts, 'draft' for unpublished posts, or 'all' for both.

Example:published

Filter by post status. Use 'published' for live posts, 'draft' for unpublished posts, or 'all' for both.

Response

The requested post

Example response

{
  "post": {
    "id": "cryitfjp5678mn09qrstuvwx",
    "slug": "getting-started-with-nextjs",
    "title": "Getting Started with Next.js",
    "status": "published",
    "coverImage": "https://media.marblecms.com/cover.jpg",
    "description": "A beginner's guide to Next.js",
    "publishedAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-16T12:00:00Z",
    "authors": [
      {
        "id": "cryitfjp1234jl04vdnycek8",
        "name": "John Doe",
        "image": "https://media.marblecms.com/avatar.jpg",
        "bio": "Technical writer and developer",
        "role": "Editor",
        "slug": "john-doe",
        "socials": [
          {
            "url": "https://twitter.com/johndoe",
            "platform": "twitter"
          }
        ]
      }
    ],
    "category": {
      "id": "cryitfjp1234jl04vdnycek8",
      "name": "Technology",
      "slug": "technology",
      "description": "Tech news and tutorials"
    },
    "tags": [
      {
        "id": "cryitfjp1234jl04vdnycek8",
        "name": "JavaScript",
        "slug": "javascript",
        "description": "JavaScript tutorials"
      }
    ],
    "fields": {
      "release_date": "2024-01-15",
      "priority_score": 5,
      "hashtags": [
        "#javascript",
        "#nextjs"
      ]
    },
    "content": "<p>Hello world</p>"
  }
}