> ## Documentation Index
> Fetch the complete documentation index at: https://docs.marblecms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get post

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



## OpenAPI

````yaml https://api.marblecms.com/openapi.json get /v1/posts/{identifier}
openapi: 3.1.0
info:
  title: Marble API
  version: 1.0.0
  description: A headless CMS API for managing and delivering content programmatically.
servers:
  - url: https://api.marblecms.com
    description: Production
security:
  - apiKey: []
paths:
  /v1/posts/{identifier}:
    get:
      tags:
        - Posts
      summary: Get post
      description: Get a single post by ID or slug, with optional status filtering
      parameters:
        - schema:
            type: string
            example: my-post-slug
            description: Post ID or slug
          required: true
          description: Post ID or slug
          name: identifier
          in: path
        - schema:
            $ref: '#/components/schemas/ContentFormat'
          required: false
          description: Content format (html or markdown)
          name: format
          in: query
        - schema:
            type: string
            enum:
              - published
              - draft
              - scheduled
              - all
            default: published
            example: published
            description: >-
              Filter by post status. Use 'published' for live posts, 'draft' for
              unpublished posts, or 'all' for both. Use 'scheduled' for posts
              waiting to go live. 'all' never includes scheduled posts.
          required: false
          description: >-
            Filter by post status. Use 'published' for live posts, 'draft' for
            unpublished posts, or 'all' for both. Use 'scheduled' for posts
            waiting to go live. 'all' never includes scheduled posts.
          name: status
          in: query
      responses:
        '200':
          description: The requested post
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostResponse'
        '404':
          description: Post not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServerError'
components:
  schemas:
    ContentFormat:
      type: string
      enum:
        - html
        - markdown
      example: html
      description: Content format (html or markdown)
    PostResponse:
      type: object
      properties:
        post:
          $ref: '#/components/schemas/Post'
      required:
        - post
    NotFound:
      type: object
      properties:
        error:
          type: string
          example: Post not found
        message:
          type: string
          example: The requested resource does not exist
      required:
        - error
        - message
    ServerError:
      type: object
      properties:
        error:
          type: string
          example: Internal server error
        message:
          type: string
          example: Failed to fetch resource
      required:
        - error
    Post:
      type: object
      properties:
        id:
          type: string
          example: cryitfjp5678mn09qrstuvwx
        slug:
          type: string
          example: getting-started-with-nextjs
        title:
          type: string
          example: Getting Started with Next.js
        status:
          type: string
          enum:
            - published
            - draft
            - scheduled
          example: published
        featured:
          type: boolean
          example: false
        coverImage:
          type: string
          nullable: true
          example: https://media.marblecms.com/cover.jpg
        description:
          type: string
          example: A beginner's guide to Next.js
        publishedAt:
          type: string
          format: date-time
          example: '2024-01-15T10:00:00Z'
        updatedAt:
          type: string
          format: date-time
          example: '2024-01-16T12:00:00Z'
        authors:
          type: array
          items:
            $ref: '#/components/schemas/AuthorRef'
        category:
          $ref: '#/components/schemas/CategoryRef'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagRef'
        fields:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
              - type: array
                items:
                  type: string
              - nullable: true
          description: Custom field values keyed by field key
          example:
            release_date: '2024-01-15'
            priority_score: 5
            hashtags:
              - '#javascript'
              - '#nextjs'
        content:
          type: string
          example: <p>Hello world</p>
      required:
        - id
        - slug
        - title
        - status
        - featured
        - coverImage
        - description
        - publishedAt
        - updatedAt
        - authors
        - category
        - tags
        - fields
        - content
    AuthorRef:
      type: object
      properties:
        id:
          type: string
          example: cryitfjp1234jl04vdnycek8
        name:
          type: string
          example: John Doe
        image:
          type: string
          nullable: true
          example: https://media.marblecms.com/avatar.jpg
        bio:
          type: string
          nullable: true
          example: Technical writer and developer
        role:
          type: string
          nullable: true
          example: Editor
        slug:
          type: string
          example: john-doe
        socials:
          type: array
          items:
            $ref: '#/components/schemas/SocialRef'
      required:
        - id
        - name
        - image
        - bio
        - role
        - slug
        - socials
    CategoryRef:
      type: object
      properties:
        id:
          type: string
          example: cryitfjp1234jl04vdnycek8
        name:
          type: string
          example: Technology
        slug:
          type: string
          example: technology
        description:
          type: string
          nullable: true
          example: Tech news and tutorials
      required:
        - id
        - name
        - slug
        - description
    TagRef:
      type: object
      properties:
        id:
          type: string
          example: cryitfjp1234jl04vdnycek8
        name:
          type: string
          example: JavaScript
        slug:
          type: string
          example: javascript
        description:
          type: string
          nullable: true
          example: JavaScript tutorials
      required:
        - id
        - name
        - slug
        - description
    SocialRef:
      type: object
      properties:
        url:
          type: string
          format: uri
          example: https://twitter.com/johndoe
        platform:
          type: string
          example: twitter
      required:
        - url
        - platform
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: Your Marble API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.